EventGateway API Overview

Production Environment
https://eventgateway.crmls.io/docs/swagger/index.html
Development Environment
https://eventgateway-dev.crmls.io/docs/swagger/index.html

Security

In order to begin posting events to our event gateway you must have an APIKey and a token. You need an APIKey in order to request a token. Once you have a token you must accompany each subsequent reguest only with the token, you no longer need to use the APIKey

Token request using query parameter:

POST https://eventgateway.crmls.io/api/token?apiKey=abcdef123456789

Token request response body

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiI5YzA3NmRmOC1hODBkLTRlMjQtMjZjOC0wOGQ4ZGQ1MjJjMTEiLCJ1bmlxdWVfbmFtZSI6IjljMDc2ZGY4LWE4MGQtNGUyNC0yNmM4LTA4ZDhkZDUyMmMxMSIsInJvbGUiOlsidXNlciIsInVzZXIiXSwibmJmIjoxNjE0ODc0MDgyLCJleHAiOjE2MTU0Nzg4ODIsImlhdCI6MTYxNDg3NDA4Mn0.2NQrFpaGGtcJJ7o3bagmpZhYvNDbDJLbmfupPhW3qvE",
  "expiration": "YYYY-MM-DDTHH:MM:SS.mmmmmmm+00:00"
}

Event Post

Once you have a token you may now post events to the events endpoint

POST https://eventgateway.crmls.io/api/app/events

In the http request headers you must have the token in an authorization header section like the following example with "Bearer" prefixed

POST https://eventgateway.crmls.io/api/app/events HTTP/1.1
Host: crmls-eventgateway.azurewebsites.net
Connection: keep-alive
Content-Length: 235
accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiI5YzA3NmRmOC1hODBkLTRlMjQtMjZjOC0wOGQ4ZGQ1MjJjMTEiLCJ1bmlxdWVfbmFtZSI6IjljMDc2ZGY4LWE4MGQtNGUyNC0yNmM4LTA4ZDhkZDUyMmMxMSIsInJvbGUiOlsidXNlciIsInVzZXIiXSwibmJmIjoxNjE0ODc0MDgyLCJleHAiOjE2MTU0Nzg4ODIsImlhdCI6MTYxNDg3NDA4Mn0.2NQrFpaGGtcJJ7o3bagmpZhYvNDbDJLbmfupPhW3qvE
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36
Content-Type: application/json
Origin: https://eventgateway.crmls.io
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

Request body

{
  "eventName": "Offer1234",
  "eventTime": "2021-03-04T16:36:54.591Z",
  "messageType": "Offer",
  "message": {
              "ListingId":"#####",
              "OfferId":"#####",
              "OfferAmount":"#####",
             }
}

The response body if successful

{
  "eventName": "Offer1234",
  "eventTime": "2021-03-04T16:36:54.591+00:00",
  "sourceAccount": "9c076df8-a80d-4e24-26c8-08d8dd522c11",
  "message": {
    "ListingId": "#####",
    "OfferId": "#####",
    "OfferAmount": "#####"
  },
  "messageType": "Offer",
  "createdBy": null,
  "createdOn": "2021-03-04T16:47:21.9708899+00:00",
  "id": "0c70ba04-3b00-48ea-e055-08d8df2c62ef",
  "modifiedBy": null,
  "modifiedOn": "2021-03-04T16:47:21.9708899+00:00"
}

Happy Coding!!