Skip to content

Instantly share code, notes, and snippets.

@lperrin
Last active August 29, 2015 14:06
Show Gist options
  • Save lperrin/9eeaec4ed3ca839e161d to your computer and use it in GitHub Desktop.
Save lperrin/9eeaec4ed3ca839e161d to your computer and use it in GitHub Desktop.
Front Contact API

The Front Contact API makes it possible to programmatically create of update contacts of your company. To use it, you need a login/password that you can retrieve by contacting us at [email protected].

The API is located at https://api.frontapp.com/api/1/contacts and uses a BASIC auth.

At the moment, it only accepts JSON POST requests:

{
  "name": "Bruce Wayne",
  "description": "CEO / Wayne.inc",
  "fields": [{
    "source": "email",
    "handle": "[email protected]"
  }, {
    "source": "email",
    "handle": "[email protected]"
  }, {
    "source": "twitter",
    "handle": "@Batman"
  }, {
    "source": "phone",
    "handle": "+123456789"
  }],
  "link": [
    {"url": "https://wayne.inc"}
  ]
}

If successful, the API will return a "202 Accepted" status. The contact will be updated less than a second later.

Notes:

  • Don't forget to set "Content-type: application/json".
  • You can specificy multiple email addresses, Twitter accounts and phone numbers. If the addresses belongs to different contacts, they will be merged.
  • Phone numbers should be passed in the international format, e.g. +16508149999. Otherwise, the API will attempt to clean them and assume the country code to be +1 if unspecified.
  • The description will appear in the header of conversations start by the contact.
  • The links appear at the bottom of the contact info. You can see it if you click on a contact name anywhere in the app. It's useful if you want to link Front with your CRM.

Assuming that contact.json contains a valid body, you can test the API with this command:

curl --user company:password -H "Content-Type: application/json" --data @contact.json https://api.frontapp.com/api/1/contacts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment