Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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:

curl -X POST "http://beta-api-ambita.com/kode/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\"}"

Example response:

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

JSON body:

Property

Description

Type:

message

The message content that is going to be sent.

String

organizationName

The organization name of who sent the push message.

String

type

The type of message: CUSTOMER or DISTRIBUTOR.

String

municipalityNumber

The municipality number of the sender.

Integer

The actual push message that will be sent, will look something like this:

{
 "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:

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

Example response:

[
  {
    "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"
  }
]

  • No labels