Events
Resource Fields
Metadata
Version | 1.0 |
Last Updated | March 16, 2017 |
Actions
Incoming webhook
POST /api/v1/webhook/:token/incoming.jsonInformation
Allowed for | Public |
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
event | string | Allowed characters are [a-Z] , _ , . and whitespace |
|
user | json | We accept the following keys email , phone , twitter_id , facebook_id , external_id and full_name . At least one identity is mandatory to specify. Note: For external_id , external_app name (like SalesForce, SugarCRM) is mandatory to pass because id could be same for two or more external apps. We will check for an existing user in Kayako in a pre-defined order (which prioritises email over phone and phone over social networks). On a positive match, we will attribute event to user's identity. If no match is found against any provided attribute, we will add a new user using the provided attributes. full_name will be useful to create new user. Example: {"email":"joy@brewfictus.com", "phone":"+4567798989", "full_name":"joy"} |
|
properties | json | We accept the properties in Key - Value pair We provide a few pre-defined keys url , icon_url , summary , color and source that are reserved and is intended to standardise event record and display. url: should be a valid url icon_url: should be a valid https url summary: should be a string to describe your event. Will be used to headline event in Kayako color: should be valid hexadecimal code source: source of the event - should be non-numeric and can only contain underscore and dot. Default: CUSTOM You can always add a new key - value pair. Example: {"accountID":"A/C-51434376767", "type":"meeting"} |
|
triggered_at | timestamp | ISO-8601 timestamp |
Request
curl -X POST https://brewfictus.kayako.com/api/v1/webhook/6LrzlgNlPAw6NxlLNy7Ua0qhIWbNenSI6Xsq4MEtY0moPeEdBFmTJ0cs7eoHprpU/incoming \
-d '{"event":"click_priing", "properties":{"url":"https://www.salesforce.com","icon_url":"https://c2.sfdcstatic.com/content/dam/web/en_is/www/images/logo/logo-company.png","accountID":"A/C 51434376767", "type":"meeting"}, "user":{"email":"joy@brewfictus.com", "full_name":"Joy"}}' \
-H "Content-Type: application/json"
Response
{
"status": 201,
"data": {
"id": 1,
"uuid": "a29dfad1-0638-414b-acaf-ee128473386b",
"event": "click_priing",
"user":
{
"id": 1,
"resource_type": "user_minimal"
}
,
"properties": {
"url": "https://www.salesforce.com",
"icon_url": "https://c2.sfdcstatic.com/content/dam/web/en_is/www/images/logo/logo-company.png",
"source": "CUSTOM",
"accountID": "A/C 51434376767",
"type": "meeting"
},
"triggered_at": "2015-07-29T00:00:47+05:00",
"created_at": "2015-07-29T00:05:41+05:00",
"resource_type": "event"
}
,
"resource": "event"
}
Bulk Incoming webhook
POST /api/v1/bulk/webhook/:token/incoming.jsonInformation
Allowed for | Public |
You can insert a maximum of 200 events at a time
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
events | array | Array of events to be inserted |
Request
curl -X POST https://brewfictus.kayako.com/api/v1/bulk/webhook/6LrzlgNlPAw6NxlLNy7Ua0qhIWbNenSI6Xsq4MEtY0moPeEdBFmTJ0cs7eoHprpU/incoming \
-d '{ "events": [{ "event": "click_pricing", "properties": { "url": "https://www.salesforce.com", "icon_url": "https://c2.sfdcstatic.com/content/dam/web/en_is/www/images/logo/logo-company.png", "accountID": "A/C 51434376767", "type": "meeting" }, "user": { "email": "joy@brewfictus.com", "full_name": "Joy" } }, { "event": "click_buy", "properties": { "url": "https://www.salesforce.com", "icon_url": "https://c2.sfdcstatic.com/content/dam/web/en_is/www/images/logo/logo-company.png", "accountID": "A/C 51434376790", "type": "customer" }, "user": { "email": "happy@brewfictus.com", "full_name": "Happy" } } ] }' \
-H "Content-Type: application/json"
Response
{
"status": 201
}