Authentication

post
Authentication with email and password

https://api.tiledesk.com/v2/auth/signin
Allows to authenticate an agent using email and password.
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
email
required
string
the user email address
password
required
string
the user password
Response
200: OK
{
"success":true,
"token":"JWT XYZ",
"user":{
"_id":"5ab11c6b83dc240014d46095",
"email":"andrea.leo@f21.it"
}

post
Signup with email and password

https://api.tiledesk.com/v2/auth/signup
Allows to signup an agent using email and password.
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
email
required
string
the user email address
password
required
string
the user password
firstname
required
string
the user firstname
lastname
required
string
the user lastname
Response
200: OK
{
"success":true,
"msg":"Successfully created new user.",
"user":{
"_id":"5e2593f0cf6bcc00178e75f7",
"email":"andrea.leo@f22.it",
"emailverified":false,
"createdAt":"2020-01-20T11:50:08.778Z",
"updatedAt":"2020-01-20T11:50:08.778Z",
"__v":0
}
}

post
Anonymous authentication for a user.

https://api.tiledesk.com/v2/auth/signinAnonymously
Allows a user to authenticate anonymously on the system.
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
id_project
required
string
the project to which the user belongs
firstname
optional
string
the user firstname
lastname
optional
string
the user password
email
optional
string
the user email
attributes
optional
object
the user custom attributes
Response
200: OK
{
"success":true,
"token":"JWT XYZ",
"user":{
"_id":"5e25944ecf6bcc00178e75fa",
"email":"a0fe493b-a19b-44a0-99ce-414c65fc20b0@tiledesk.com",
"emailverified":false,
"createdAt":"2020-01-20T11:51:42.115Z",
"updatedAt":"2020-01-20T11:51:42.115Z",
"__v":0
}
}

post
Custom authentication for a user.

https://api.tiledesk.com/v2/auth/signinWithCustomToken
Allows to authenticate with a custom JWT token.
Request
Response
Request
Headers
Authorization
required
string
Custom JWT Authorization token.
Response
200: OK
{
"success":true,
"token":"JWT eyJ0eXYZ",
"user": {
"_id":"123456",
"firstname":"Andrea",
"lastname":"Leo",
"email":"andrea.l@test.it",
"code":"123456",
"sub":"userexternal",
"aud":"https://tiledesk.com/projects/5ec688ed13400f0012c2edd1",
"iat":1598865103,
"exp":1598865223
}
}

Example:

curl 'https://api.tiledesk.com/v2/auth/signinWithCustomToken' \
-X 'POST' \
-H 'authorization: JWT eyJ0eXAiOiJKVXYZZ....ZZZZZ'

You can find here How to Generate a Custom Authentication Token‚Äč