API

ComeCat has very simple API to send message from external server( client too ). You just have to save the API key which you can generate from ComeCat console, and put the API key to http request header.

Click "API/Webhook" in side menu. Screen1

Click "API" tab and you can see the api key. Screen1

Sample Request

Here is sample request hot to send message via API.

curl -X "POST" "https://app.come.cat/api/v3/cc/send" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -H 'apikey: TEC4DBqpe0Lu5QJHL352SIS1uxsOdYeh' \
     -d $'{
  "message": "hi",
  "roomID": "3-5b0bb401485388dbbcaac87f"
}'

You will get the roomID from webhook request when you receive message.

And you will receive this from server when the message is successfully sent.

{
    "message": {
        "id": "5b0bc82134b25beef4fd5f21",
        "message": "hi",
        "roomID": "3-5b0bb401485388dbbcaac87f",
        "created": 1527498785349
    },
    "user": {
        "id": "5acf3e00b8571e44291fccb8",
        "name": "Ken",
        "avatar": {
            "picture": {
                "originalName": "0.jpg",
                "size": 6281,
                "mimeType": "image/png",
                "nameOnServer": "3fqfPyYVVm4cNr4xHC9XWMyqEpozsRSS"
            },
            "thumbnail": {
                "originalName": "0.jpg",
                "size": 24117,
                "mimeType": "image/png",
                "nameOnServer": "IXAzEgQr5aK1ZjvlbniLoyRdDAondRbw"
            }
        },
        "description": "",
        "organizationId": "5a82fb03952d9d860872f63c",
        "sortName": "ken",
        "userid": "ken@clover.studio",
        "created": 1523531264800
    }
}