API Docs

REST API documentation with examples

You can use Koraki web API to create notifications programmatically. This lets you integrate Koraki with almost any system you currently use. You need to identify a triggering event of any other system (ex., Place order of your custom shopping cart application) to create a notification and use web Koraki API post notification method to generate a notification.

Integrate with custom apps

All the requests are required to have basic authorization header. You can obtain credentials (Client Id and Client Secret) of a Koraki application by logging into admin panel and going to Details tab of an application. Client id and client secret is joined together with a colon in between and then encoded using base-64 encoding method.

Authorization: Basic base64(client_id:client_secret)

All the responses are sent in JSON encoded format. Following header is also required to be sent with each request.

Accept: application/json

You can find Client Id and Secret inside application details tab

get
Gets all notifications

https://api.koraki.io/api/v1.0/notifications
Returns all the notifications of the application. curl -X GET https://api.koraki.io/api/v1.0/Notifications -H 'authorization: Basic <BASE 64 ENCODED TOKEN>' -H 'content-type: application/json'
Request
Response
Headers
Authentication
required
string
Authorization header using the Basic scheme. i.e., Basic [Base64Encode(lient_id:client_secret)]
Query Parameters
PageSize
optional
integer
Number of items per page. Default is 20
PageNumber
optional
integer
Page number. Default is 1
Statuses
optional
array
Notification statuses to filter as an array of strings. Returns notifications of all statuses if not provided
200: OK
Returns notifications list
{
"pageNumber": 0,
"pageSize": 0,
"pageCount": 0,
"totalRecordCount": 0,
"items": [
{
"status": "Created",
"notificationText": "string",
"thumbnailUrl": "string",
"variables": "string",
"location": "string",
"createdOn": "2018-09-16T18:48:14.714Z",
"type": "Normal",
"id": 0
}
]
}
401: Unauthorized
Not authorized to perform the action
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
404: Not Found
Application not found
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}

get
Gets a notification

https://api.koraki.io/api/v1.0/notifications/:id
Returns a single notification curl -X GET https://api.koraki.io/api/v1.0/Notifications/:id -H 'authorization: Basic <BASE 64 ENCODED TOKEN>' -H 'content-type: application/json'
Request
Response
Path Parameters
Id
required
integer
Notification id
200: OK
{
"status": "Created",
"notificationText": "string",
"thumbnailUrl": "string",
"variables": "string",
"location": "string",
"createdOn": "2018-09-21T08:09:21.955Z",
"type": "Normal",
"id": 0
}
401: Unauthorized
Not authorized to perform the action
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
404: Not Found
Notification not found
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}

post
Creates a new notification

https://api.koraki.io/api/v1.0/notifications
Creates a new notification. curl -X POST https://api.koraki.io/api/v1.0/Notifications -H 'authorization: Basic <BASE 64 ENCODED TOKEN>' -H 'content-type: application/json' -d '{ "status": "Ready", "variables": "{'key1' : 'value1'}", "notificationText": "Alex joined i2CS, Inc. organization", "localizedNotificationTexts" : { "en" : "Alice from Melbourne bought an Apple", "fr" : "Alice de Melbourne a acheté une pomme" } "iPAddress": "192.206.151.131", "createdOn": "2018/12/26" }'
Request
Response
Headers
Authentication
required
string
Authorization header using the Basic scheme. i.e., Basic [Base64Encode(lient_id:client_secret)]
Body Parameters
NotificationText
optional
string
Notification text. This can have html link tags as well.
LocalizedNotificationTexts
optional
object
Object containing localized strings of the notification with ISO 639-1 standard language code being the key and localized notification being the string.
IpAddress
optional
string
IP address of the lead/customer who is making the event of the notification. This is used only to get location thumbnail if the Location field is not provided.
Location
optional
string
String representation of the location of the lead/customer who is making the event of the notification. Ex. Deleware, USA
Group
optional
string
If two notifications with same group is added, the previous one will be overwritten by the new.
ThumbnailUrl
optional
string
URL to an image resource to be displayed with the notification. If none provided it will generate a thumbnail based on the location.
CreatedOn
optional
string
Datetime of the event of the notification.
200: OK
{
"status": "Created",
"notificationText": "string",
"thumbnailUrl": "string",
"variables": "string",
"location": "string",
"createdOn": "2018-09-16T18:48:14.731Z",
"type": "Normal",
"id": 0
}
401: Unauthorized
Not authorized to perform the action
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
404: Not Found
Application not found
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
406: Not Acceptable
Can not accept the data passed
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}

delete
Deletes a notification

https://api.koraki.io/api/v1.0/notifications/:id
Deletes a notification by id. curl -X DELETE https://api.koraki.io/api/v1.0/Notifications/:id -H 'authorization: Basic <BASE 64 ENCODED TOKEN>' -H 'content-type: application/json'
Request
Response
Path Parameters
Id
required
integer
Notification id
Headers
Authentication
required
string
Authorization header using the Basic scheme. i.e., Basic [Base64Encode(lient_id:client_secret)]
204: No Content
Success response with no content
401: Unauthorized
Not authorized to perform the action
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
404: Not Found
Notification or application not found
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}
406: Not Acceptable
Not Acceptable
{
"message": "string",
"isError": true,
"details": "string",
"errors": [
"string"
]
}