Labels

Labels

You can use the API to get or set label information.

The Model

The API tag is used to implement internationalization and multilingual for the widget and chatbots.

Key

Type

Description

id

String

The unique identifier for the label which is given by Tiledesk.

data

Object

The label data model.

attributes

Object

The custom attributes which are set for the label.

createdAt

String

The time (ISO-8601 date string) when the label was created.

updatedAt

String

The time (ISO-8601 date string) when the label was updated.

createdBy

String

The unique identifier of the row creator

id_project

String

The unique identifier of the project

Label Data Model

Key

Type

Description

lang

String

The language identifier

data

Object

The translation labels data

category

String

The label data category

default

Boolean

Determines if this translation is the default for the project.

get
Get all labels for the project_id

https://api.tiledesk.com/v2/:project_id/labels
Allows an account to list all the labels.
Request
Response
Request
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
Response
200: OK
TODO

Example

curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels

get
Get a label by language ID

https://api.tiledesk.com/v2/:project_id/labels/:id
Fetches a label by his or her language ID
Request
Response
Request
Path Parameters
id
required
string
the language identifier(Ex. EN, IT, ES, etc.)
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
Response
200: OK
TODO

Example

curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/EN

post
Create or update a label

https://api.tiledesk.com/v2/:project_id/labels
Allows to add or update labels.
Request
Response
Request
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
lang
required
string
the language identifier
data
required
object
the data object
default
optional
boolean
Dermine if this is the default language
Response
200: OK
TODO

Example:

curl -v -X POST -H 'Content-Type: application/json' -u [email protected]:123456 -d '{"lang":"andrea", "data":{OBJECT}}' https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels

patch
Make a language as default for the project

https://api.tiledesk.com/v2/:project_id/labels/:lang/default
Make a language as default for the project
Request
Response
Request
Path Parameters
project_id
required
string
The project_id is a unique code assigned to your project when you create it in Tiledesk
lang
required
string
The language identifier
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Content-Type
required
string
use "application/json" value
Response
200: OK
TODO

Example:

curl -v -X PATCH -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/EN/default

delete
Delete a label by language identifier

https://api.tiledesk.com/v2/:project_id/labels/:lang
Allows to delete a label by language identifier.
Request
Response
Request
Path Parameters
project_id
required
string
The project_id is a unique code assigned to your project when you create it in Tiledesk
lang
required
string
The lang indentifier.
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Response
200: OK
TODO

Example:

curl -v -X DELETE -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/EN

delete
Delete all the labels of the project

https://api.tiledesk.com/v2/:project_id/labels/
Allows to delete all the labels of the project
Request
Response
Request
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
Response
200: OK
TODO

Example:

curl -v -X DELETE -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/

get
Get all predefined labels

https://api.tiledesk.com/v2/:project_id/labels/default
Request
Response
Request
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
Response
200: OK
TODO

Example

curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/default

get
Get all the standard pre-translated labels

https://api.tiledesk.com/v2/:project_id/labels/default
Request
Response
Request
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
Response
200: OK
TODO

Example

curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/default

get
Get the standard pre-translated label by language id

https://api.tiledesk.com/v2/:project_id/labels/default/lang
Request
Response
Request
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
Response
200: OK
TODO

Example

curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/default/EN

post
Create a label clone from a pre-traslated language

https://api.tiledesk.com/v2/:project_id/labels/default/clone
Request
Response
Request
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
lang
required
string
the language identifier
Response
200: OK
TODO

Example:

curl -v -X POST -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v2/5b55e806c93dde00143163dd/labels/default/clone