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:
NB! Municipality number is only 4 characters. Characters beyond that number will then make you not be able to create a message.
Code Block |
---|
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\",
\"municipalityNumber\": \"string\",
\"municipalityName\": \"string\",
\"type\": \"string\"}" |
Example response:
Code Block |
---|
{
"id": "8608863f-e39a-4129-83be-c7cfd2701aee",
"message": "This is a test message from create",
"municipalityName": "INFOLAND",
"municipalityNumber": "9999",
"dateCreated": "14-01-2021",
"type": "CUSTOMER"
} |
JSON body:
...
Property
...
Description
...
Type:
...
message
...
The message content that is going to be sent.
...
String
...
municipalityName
...
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.
...
String
...
dateCreated
...
The date when the push message was created.
...
LocalDateTime
The There is multiple types of Distributor Messages:
Type | Description |
---|---|
CUSTOMER | Messages ment for endusers of your application, this could be a notification about products or maintenance. |
DISTRIBUTOR | Messages ment for your support department, this could be information about some new functionality or configuration issues. |
The actual push message that will be sent, will look something like this:
Code Block |
---|
{ "content": { "body": { "id": "8608863f-e39a-4129-83be-c7cfd2701aee", "message": "This is a test message from create", "municipalityName": "INFOLAND", "municipalityNumber": "9999", "dateCreated": "14-01-2021", "type": "CUSTOMER" } }, "eventAction": "Created", "eventType": "DistributorMessages" } |
How to get list of push messages
Example request:
Code Block |
---|
curl -X GET "http://beta-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",
"municipalityName": "INFOLAND",
"municipalityNumber": "9999",
"dateCreated": "14-01-2021",
"type": "CUSTOMER"
},
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Dette er et eksempel2",
"municipalityName": "INFOLAND",
"municipalityNumber": "9999",
"dateCreated": "14-01-2021",
"type": "CUSTOMER"
}
] |