Creates a new conversation resource in which both the sender and recipient(s) of the message are participating. The message posted will be the first message in said conversation.
POST https://api.speakap.io/networks/:eid/messages/
Request
URI: | /networks/{networkEID}/messages/ |
---|---|
Method: | POST |
Content-Type: | application/json |
Authentication: | OAuth 2.0 |
Name | Type | Description |
---|---|---|
networkEID | EID | Network EID |
Supply a complete private message resource in the request body supplemented with
one or more recipient
objects. You should omit the created
date as it will be set
server-side.
Name | Type | Description |
---|---|---|
recipient | object | Message recipient (one-on-one conversations) |
recipient EID | EID | Unique entity identifier |
recipient type | string | 'user' |
recipients | array | Since 1.0.7 List of message recipient objects (group conversations) |
{
"messageType": "private",
"body": "I buy and sell men like myself every day.",
"recipient": {
"EID": "1234567890ABCDEF",
"type": "user"
}
}
{
"messageType": "private",
"body": "Take the pen!",
"recipients": [
{
"EID": "0123456789ABCDEF",
"type": "user"
},
{
"EID": "ABCDEF0123456789",
"type": "user"
}
]
}
Response
The response will return both the EID of the newly created message and of the initiated conversation.
Status code: |
---|
See Create Message
The entity body will be a regular feedback object with the following additional data:
Name | Type | Description |
---|---|---|
conversation | object | Partial conversation object |
conversation. EID | EID | Unique entity identifier |
conversation. new | boolean | true |
conversation. conversationType | string | one-on-one or group |
conversation. started | datetime | Date the conversation was started (ISO 8601 compliant) |
{
"EID":"ABCDEF1234567890",
"status":"First message of conversation scheduled for insertion",
"uri":"http://io.speakap.com/networks/1234567890ABCDEF/messages/ABCDEF1234567890/",
"data": {
"conversation": {
"EID": "FEDCBA0987654321",
"new": true,
"conversationType": "one-on-one",
"started": "2014-01-07T14:52:33.872+01:00"
}
}
}