Subscriptions

post
Create a new subscription

https://api.tiledesk.com/v1/:project_id/subscriptions
Allows to add more subscriptions.
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
Content-Type
required
string
use "application/json" value
Body Parameters
event
required
string
the event method
target
required
string
the target url
200: OK
{
{
"__v":0,
"updatedAt":"2019-03-12T12:01:56.462Z",
"createdAt":"2019-03-12T12:01:56.462Z",
"target":"https://webhook.site/c312005b-5042-49e9-a769-0f3ba4245b51",
"event":"request.create",
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"5ab11c6b83dc240014d46095",
"_id":"5c879fb4f1ae6600173b8c75",
"secret":"56c189c8-33ae-4930-bd98-410a12aa45ce"
}

Example

curl -v -X POST -H 'Content-Type:application/json' -u andrea.leo@f21.it:123456 -d '{"event":"request.create", "target":"https://webhook.site/c312005b-5042-49e9-a769-0f3ba4245b51"}' https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/subscriptions

get
Get all subscriptions

https://api.tiledesk.com/v1/:project_id/subscriptions
Allows an account to list all active subscriptions.
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
200: OK
[
{
{
"__v":0,
"updatedAt":"2019-03-12T12:01:56.462Z",
"createdAt":"2019-03-12T12:01:56.462Z",
"target":"https://webhook.site/c312005b-5042-49e9-a769-0f3ba4245b51",
"event":"request.create",
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"5ab11c6b83dc240014d46095",
"_id":"5c879fb4f1ae6600173b8c75"
},
...
]

get
Get a subscription by id

https://api.tiledesk.com/v1/:project_id/subscriptions/:id
Fetches a subscription by his or her ID
Request
Response
Path Parameters
id
required
string
the subscription 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
200: OK
{
{
"__v":0,
"updatedAt":"2019-03-12T12:01:56.462Z",
"createdAt":"2019-03-12T12:01:56.462Z",
"target":"https://webhook.site/c312005b-5042-49e9-a769-0f3ba4245b51",
"event":"request.create",
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"5ab11c6b83dc240014d46095",
"_id":"5c879fb4f1ae6600173b8c75"
}

delete
Delete a subscription by id

https://api.tiledesk.com/v1/:project_id/subscriptions/:id
Delete a subscription by his or her ID
Request
Response
Path Parameters
id
required
string
the subscription 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
200: OK
{
"_id":"5c81593adf767b0017d1aa66",
"updatedAt":"2019-03-07T17:47:38.393Z",
"createdAt":"2019-03-07T17:47:38.393Z",
"lead_id":"SRbb2PfbSFcgICv9VQBcURZeloh1",
"fullname":"Guest",
"attributes":{ ... },
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"system",
"__v":0
}