Create Message
CUSTOM-IMPORTANT
Apps are only allowed to create a special kind of update with type app_update.
CUSTOM-ENDPOINT
POST https://api.speakap.io/networks/:eid/messages/
Use Cases
- Create updates directed at a group
- Create updates directed at a single user
CUSTOM-AUTHORIZATION
Permissions: post_updates, post_to_any_group
CUSTOM-REQUEST
- URI: /networks/{networkEID}/messages/
- Method: POST
- Content-Type: application/json
- Authentication: OAuth 2.0
Parameters
| Name | Type | Description |
|---|---|---|
| networkEID | EID | Network EID |
Request body
Supply a complete message resource in the request body possibly supplemented with a recipient or parent object. You should omit created date as it will be set server-side. The author relation will be automatically set to the logged in user.
| Name | Type | Description |
|---|---|---|
| recipient | object | Message recipient |
| recipient.EID | EID | Unique entity identifier |
| recipient.type | string | Recipient type ('network', 'group', 'user' or 'conversation') |
| parent | object | Parent message in case of a comment |
| parent.EID | EID | Unique entity identifier |
| parent.type | string | Message type |
Examples
Sending an update as an Application client:
{
"messageType": "app_update",
"localizableBody": {
"en-US" : "I would like to buy a hamburger.",
"fr-FR" : "Je voudrais acheter un hamburger.",
"nl-NL" : "Ik wil graag een hamburger kopen."
},
"recipient": {
"EID": "1234567890ABCDEF",
"type": "network"
}
}Response
| Status | Data |
|---|---|
| 202 | Accepted for insertion: returns a Feedback object |
| 400 | Invalid data: returns an Error object |
| 403 | Unauthorized: returns an Error object |
| 404 | Unknown network: returns an Error object |