Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To utilize this API endpoint, the user will need an access token from a client which has the push message scope.

How to create push message

Example request:

Code Block
curl -X POST "http://betadev-api-ambita.com/infoland-hubkode/v1/distributormessages/distributor/messages" 
-H "accept: */*" 
-H "Authorization: Bearer <access token>"
 -H "Content-Type: application/json" -d
 "{ \"message\": \"Meldingen din her\",
  \"organizationCode\": \"string\", 
  \"type\": \"string\"}"

...

Code Block
{
 "content": {
    "body": {
      "id": "8608863f-e39a-4129-83be-c7cfd2701aee",
      "message": "This is a test message from create",
      "organizationCode": "K9999INFOLAND",
      "type": "CUSTOMER"
    }
  },
  "eventAction": "Created",
  "eventType": "DistributorMessages"
}

How to get list of push messages

Example request:

Code Block
curl -X GET "http://dev-api-ambita.com/kode/v1/distributormessages/distributor/messages" 
-H "accept: */*" -H "Authorization: Bearer <Token>"

Example response:

Code Block
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "message": "Dette er et eksempel",
    "organizationCode": "INFOLAND",
    "type": "CUSTOMER"
  },
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "message": "Dette er et eksempel2",
    "organizationCode": "INFOLAND",
    "type": "CUSTOMER"
  }
]