Authentication
All requests sent to Connect must include an authentication token, which is obtained by submitting a valid username and password.
During the authentication process, the API returns a token along with the expirationDate field, which indicates the token's validity period. By default, the expiration time is 24 hours, but this value can be configured as needed. It is essential that the client properly manages the token's lifecycle, ensuring it is renewed before expiration to avoid request failures.
The /Authenticate route allows users to obtain an access token to use other Connect features. To do this, a username and password must be submitted. If the credentials are correct, the route returns a valid token and its expiration date. In case of an error, such as invalid credentials or server issues, appropriate messages are returned.
Address of our services:
Homologation:
POST https://homologapix.clearsale.com.br/connect/v1/authenticate
Production:
Body Params
| Parameters | Properties | Required |
|---|---|---|
| user | string | Yes |
| password | string | Yes |
Request Example
POST https://homologapix.clearsale.com.br/connect/v1/authenticate
Content-Type: application/json
{
"user": "{Your User}",
"password": "{Your Password}"
}Status Response
| Return | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal Server Error |
Result Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"token": "{JWT Token}",
"expirationDate": "{Date and time of expiration}"
}Response with error
"User or Password not authorized"Updated 2 months ago
