This endpoint exports the history of an Incident by email.
Request
To export the Logs of an Incident please make a POST request to the following URL:
| HTTP Method | URL |
|---|---|
| POST | https://industrial.api.ubidots.com/api/v2.0/incidents/<incident_id>/logs/_/export/ |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| incident_id | String | The id of the Incident. Incidents have no label, so the ~label form is not supported |
Query Parameters
Any filter accepted by Get Incident Logs, e.g. ?type__in=comment,change_state. The export contains the same Logs, in the same order, that Get Incident Logs returns for the same query.
Body Parameters
| Parameter | Type | Required? | Default Value | Description |
|---|---|---|---|---|
| export.format | String | No | csv | Format of the file: csv or jsonl |
| export.emails | String or String Array | Yes | N/A (required) | Recipients of the download link, as a list or a comma-separated string |
Header
| Parameter | Required? | Description |
|---|---|---|
| X-Auth-Token | Yes | Authentication Token of account |
| Content-Type | Yes | application/json |
$ curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/incidents/<incident_id>/logs/_/export/?type__in=comment,change_state' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-H 'Content-Type: application/json' \
-d '{
"export": {
"format": "csv",
"emails": "[email protected]"
}
}'{
"task": {
"id": "7f1c2b9e-3a4d-4f5e-9b8c-1d2e3f4a5b6c"
}
}{
"code": 400001,
"message": "Validation Error.",
"detail": {
"export": {
"format": [
"\"xlsx\" is not a valid choice."
]
}
}
}{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}{
"code": 402001,
"message": "Your current plan does not include Incidents feature."
}{
"detail": "You do not have permission to perform this action."
}{
"code": 404001,
"message": "The request was not found."
}Response
Returns 202 Accepted with the id of the export job. The job runs in the background and emails a download link to the recipients when the file is ready.
An unknown Incident returns 404 Not Found right away. If the Incident is deleted before the job runs, the job fails and no file is sent.

