Requests

You can use the API to get the request information.

get
Get all requests

https://api.tiledesk.com/v1/:project_id/requests
Allows an account to list all the requests for the project.
Request
Response
Path Parameters
project_id
required
string
the Project Id is a unique code assigned to your project when you create it in Tiledesk.
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Query Parameters
sortField
optional
string
what field to sort the results by.
direction
optional
string
sort direction: 1 or -1. Return the results in ascending or descending order. defaults to desc
page
optional
string
what page of results to fetch. defaults to first page.
200: OK
{
"perPage":40,
"count":179,
"requests":[
{
"_id":"5c81593adf767b0017d1aa67",
"updatedAt":"2019-03-07T17:48:05.934Z",
"createdAt":"2019-03-07T17:47:38.405Z",
"request_id":"support-group-L_OG76RYhR0XFiMf2PK",
"requester_id":"5c81593adf767b0017d1aa66",
"first_text":"first text message",
"department":"5c34ba232c62730016da250e",
"sourcePage":"https://www.tiledesk.com",
"language":"it",
"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"5c81593adf767b0017d1aa66",
"__v":2,
"waiting_time":21709,
"agents":[
{
"__v":0,
"createdBy":"5aaa99024c3b110014b478f0",
"user_available":true,
"role":"admin",
"id_user":"5ab0f3fa57066e0014bfd71e",
"id_project":"5b55e806c93dde00143163dd",
"createdAt":"2018-10-03T14:40:19.521Z",
"updatedAt":"2019-03-07T17:47:38.405Z",
"_id":"5bb4d4d39214830015742b00"
}
],
"tags":[
],
"messages_count":7,
"participants":[
"5aaa99024c3b110014b478f0"
],
"status":200,
"lead":{..}
}
...
]
}

Example

curl -v -X GET -u andrea.leo@f21.it:123456 https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/requests

get
Get a request by id

https://api.tiledesk.com/v1/:project_id/requests/:id
Fetches a request by his or her request_id
Request
Response
Path Parameters
id
required
string
the request identifier
project_id
required
string
the Project Id is a unique code assigned to your project when you create it in Tiledesk.
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Query Parameters
sortField
optional
string
what field to sort the results by.
direction
optional
string
sort direction: 1 or -1. Return the results in ascending or descending order. defaults to desc
page
optional
string
what page of results to fetch. defaults to first page.
200: OK
{
"_id":"5c81593adf767b0017d1aa67",
"updatedAt":"2019-03-07T17:48:05.934Z",
"createdAt":"2019-03-07T17:47:38.405Z",
"request_id":"support-group-L_OG76RYhR0XFiMf2PK",
"requester_id":"5c81593adf767b0017d1aa66",
"first_text":"first text message",
"department":"5c34ba232c62730016da250e",
"sourcePage":"https://www.tiledesk.com",
"language":"it",
"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"5c81593adf767b0017d1aa66",
"__v":2,
"waiting_time":21709,
"agents":[
{
"__v":0,
"createdBy":"5aaa99024c3b110014b478f0",
"user_available":true,
"role":"admin",
"id_user":"5ab0f3fa57066e0014bfd71e",
"id_project":"5b55e806c93dde00143163dd",
"createdAt":"2018-10-03T14:40:19.521Z",
"updatedAt":"2019-03-07T17:47:38.405Z",
"_id":"5bb4d4d39214830015742b00"
}
],
"tags":[
],
"messages_count":7,
"participants":[
"5aaa99024c3b110014b478f0"
],
"status":200,
"lead":{..}
}

Example:

curl -v -X GET -u andrea.leo@f21.it:123456 https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/requests/support-group-L_OG76RYhR0XFiMf2PK