Send a Message
This endpoint sends a message.
info
This operation requires authentication. The logged user must be followed by recipients.
HTTP Request
POST /api/v2/pm/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
recipients | body | integer | true | The id(s) of the recipient(s) of the message |
group | body | integer | (one between recipients or group is required) | The id of the group (only if grouping and tagging features are enabled) |
message | body | string | false* | The content of the message. It is required when file_uuid param is missing |
file_uuid | body | string | false* | The private message file id. It is required when message param is missing |
Example Body Parameters
- JSON
{
"recipients": ["integer"],
"message": "string"
}
Example Request
- JavaScript
- Bash
const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/pm/',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/pm/ \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | list(Private Message) |
Example responses
- 201
[
{
"id": "integer",
"sender": {User},
"message": "string",
"created_at": "string",
"status": "string",
"file": {File},
"thread_id": "integer"
}
]