Replace instances of [resources] or [resource] with actual resource name.
Excerpt | ||||||
---|---|---|---|---|---|---|
|
Anchor | ||
---|---|---|
|
POST
...
messages
Create a [resource]message
Note: Only outgoing messages can be created through the API. Incoming messages are created by data provider modules.
METHOD: POST
ENDPOINT: /api/v2/[resources]messages/
AUTHENTICATED: No
The request body is a JSON representation of the [resource] message being created.
Example request
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
POST https://ushv3.dev/api/v2/[resources]messages
|
Anchor | ||
---|---|---|
|
GET
...
messages
Listing all [resources]messages
METHOD: GET
ENDPOINT: /api/v2/[resources]messages/
AUTHENTICATED: No
Query Parameters
Note with no parameters the messages API defaults to returning messages with direction = incoming and status != archived.
Name | Type | Description |
---|---|---|
q | Optional | Only [Resources] messages containing this search string will be returned, matched against 'tag' propertytitle' and 'message' properties |
type | Optional | Only [resources] messages of this type will be returned: report, revision, comment or alert |
direction | Optional | Filter messages based on direction. incoming or outgoing. Default: incoming |
status | Optional | Filter messages based on status. |
parent | Optional | Filter by parent message id |
contact | Optional | Filter by contact id |
data_feed | Optional | Filter by data feed id |
data_provider | Optional | Filter by data provider id |
post | Optional | Filter by post id |
order | Optional | Returned [resources] messages will be sorted in this order: ASC or DESC. Default: DESC |
order_by | Optional | Returned [resources] messages will be sorted by this field. Default: created |
limit | Optional | Limit number of results returned. Default: 50. Max: 500 |
offset | Optional | [Resources] messages returned will be offset by this number of results |
...
Panel | |||||||
---|---|---|---|---|---|---|---|
GET https://ushv3.dev/api/v2/[resources]messages
|
Search Example
Panel | |||||||
---|---|---|---|---|---|---|---|
GET https://ushv3.dev/api/v2/[resources]messages?q=Davidabc
|
Anchor | ||
---|---|---|
|
GET
...
messages/:id
Get a single [resource]single message
METHOD: GET
ENDPOINT: /api/v2/[resources]messages/:id
AUTHENTICATED: Yes
Query Parameters
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the [resource] message being updated. |
Example Request
Panel | |||||||
---|---|---|---|---|---|---|---|
GET http://ushv3.dev/api/v2/[resources]messages/1
|
Anchor | ||
---|---|---|
|
PUT
...
messages/:id
Update a [resource]a message
METHOD: PUT
ENDPOINT: /api/v2/[resources]messages/:id
AUTHENTICATED: Yes
Messages updates are subject to special rules depending on if they are incoming or outgoing
- Incoming messages only allow updates to 'status'. The message itself cannot be edited
- Outgoing messages allow most values to be updated as normal
Query Parameters
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the [resource] message being updated. |
Example Request
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Archive message, and try to edit the message text.. In this case the message is status is changed but other changes are ignored. PUT http://ushv3.dev/api/v2/[resources]messages/1
|
Anchor | ||
---|---|---|
|
DELETE
...
messages/:id
Deleting a [resource]a message
METHOD: DELETE
ENDPOINT: /api/v2/[resources]messages/:id AUTHENTICATED: YES
Query Parameters
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the [resource] being deleted. |
Example request
Panel | |||||||
---|---|---|---|---|---|---|---|
DELETE /api/v2/[resources]/2
|
Messages cannot be deleted through the API.