Get User Messages
This endpoint returns the user messages (sent and received) according to the filter received.
Parameters
filter
Object where search parameters are defined.
{
"from": "2023-10-12T13:39:14.968Z",
"to": "2023-10-13T13:39:14.968Z",
"type": "all"
"onlyProcessed": false
"SentStatus": int array - SentNotDelivered = 1, DeliveredNotRead = 3, Read = 5
}
Field | Description | ||||||||
from | The begining of the period from where we want to return messages. |
||||||||
to | The ending of the period from where we want to return messages. |
||||||||
type | The type of the desired messages
|
||||||||
processedOnly | Allows to force the return of processed messages only.
|
||||||||
geometryGeoJSON | JSON structure that defines the polygon.
|
||||||||
geometryGeoJSON.geometry | Used to define the points of the *polygon*
|
Response
{
"statusCode" - string - Status code,
"content" [
{
"id": 0
"companyId": 0
"timestamp": "2023-10-12T13:39:14.968Z",
"direction": "string",
"driverId": 0,
"driverName": "string",
"companyId": 0,
"vehicleId": 0,
"licensePlate": "string",
"text": "string",
"terminal": 'A',
"status": 0,
"statusTime" : "2023-10-12T13:39:14.968Z",
"direction": "string",
"vehicleIcon": 0,
"vehicleOtherIcon": 0,
"address": "string"
}
],
"error" {
message: "string"
}
}
Field | Description |
statusCode | Status code
|
content | The array of messages found
|
content[i].id | The identifier of the message.
|
content[i].companyId | The identifier of the company
|
td>content[i].timestamp | The moment when the message was sent or received by the user.
|
content[i].direction | Specified the direction of the message. Two values are possible: "sent" and "received" |
content[i].driverId | The ID of the driver associated with the terminal
|
content[i].driverName | The name of the driver associated with the terminal
|
content[i].vehicleId | The ID of the vehicle associated with the terminal, if any
|
content[i].licensePlate | The licensePlate of the vechicle, if a vehicle was associated with the terminal when the message was sent.
|
content[i].text | The text content of the message
|
content[i].terminal | Identifies the type of terminal.
See the complete list of available terminals types. |
content[i].status | The ID of the status of the message.
See the complete list of messages statuses. |
content[i].statustTime | The last time the status of the message was changed.
|
content[i].vehicleIcon | The ID of the icon of the vehicle, if avalilable.
|
content[i].id | The ID of a second icon of the vehicle, if available.
|
content[i].address | Address in case one is passed along with the message
|
error | Included in the response in the cases when an error occours.
|
message | Some text the describes the error occoured.
|
Response HTTP Codes
200 - OK
- Response with the expected results
400 - Bad request
- There are no vehicles for the user
401 - Unauthorized
- Invalid creadencials