Cention
API Documentation
Cention Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Cention Contact Cards JSONAPI

Cention Contact Cards JSONAPI:

  • To create Cention contact card, a JSON Web Token (JWT) with ‘Access and create customer contacts’ claim attached is needed.
  • To create JWT go to Cention server → Administration tab → API → Access Tokens.
  • Check (tick) ‘‘Access and create customer contacts’ from Others.
  • Make sure to fill up the Key field else Save button will not be activated.
  • Screenshot:

The API follows JSONAPI specification: http://jsonapi.org/ . Following is some of the specification that must follow:


Contact Cards

  • Use HTTP POST with endpoint: https://<cention api domain>/s/<workspace>/capi/json/c3_contact_cards to create contact cards. If the name of your Cention workspace is “demo” and the cention api domain is api.cention.com then the endpoint would be: https://api.cention.com/s/demo/capi/json/c3_contact_cards
  • To ease the contact card creation and avoid duplication, the same endpoint will not create duplicate contact if any of the provided contacts found inside database. In such situation, the contact will be updated by appending on the found contact. NOTE: this is not compatible with JSONAPI specification.
  • Sample HTTP POST request body data format for creating/updating contact cards:
{
  "data": {
    "type": "c3_contact_cards",
    "attributes": {
      "contacts": {
        "email": [
          "tester.c3@cention.se",
          "tester.c3.2@cention.se"
        ],
        "facebook": [
          "12345@facebook.com"
        ],
        "custom": [
          {"label":"ID", "value":"AB07090"},
          {"label":"Address", "value":"Kuala Lumpur"},
          {"label":"Phone", "value":"09-12345678"}
        ],
        "name": "Tester Cention"
      }
    }
  }
}
  • Sample HTTP POST response data format for creating/updating contact cards (include id field):
{
  "data": {
    "type": "c3_contact_cards",
    "id": "13",
    "attributes": {
      "c3_id": 13,
      "contacts": {
        "name": "Tester Cention",
        "email": [
          "tester.c3@cention.se",
          "tester.c3.2@cention.se"
        ],
        "facebook": [
          "12345@facebook.com"
        ],
        "custom": [
          {"label":"ID", "value":"AB07090"},
          {"label":"Address", "value":"Kuala Lumpur"},
          {"label":"Phone", "value":"09-12345678"}
        ]
      }
    }
  }
}

Data.attributes

Field Type Description
contacts Object Object with supported contact fields such as email, facebook, etc.
name String Person name of the contacts belong to.

Data.attributes.contacts

Field Type Description
email Array of String Emails.
facebook Array of String Facebook account, ex: 12345@facebook.com.
vk Array of String VKontakte account, ex: centionvk-cc-12345.
line Array of String LINE messenger, ex: centionline-c12345.
voice Array of String Phone number (with plus sign).
custom Array of Object Object contain Names and values (ex: {“label”:“ID”, “value”:“AB07090”},{“label”:“Address”, “value”:“Kuala Lumpur”},..)

References:

  1. JSONAPI specification.