Generate access token

The authentication service is mainly used to obtain the token which will be used to stamp our CFDI (xml) already issued, In order to use this service, it is necessary that you have a username and a password to receive the token.

There are two different access tokens, temporary token and infinite token, the temporary token has a life time of two hours and the infinite does not expire unless it is revoked and it can be renewed.

Authenticate using API services

🧰 Production URL : https://services.sw.com.mx

Endpoint

MethodRoute
POST /security/authenticate

Headers

HeaderValue
user$email
password$password

Request Example

curl --request POST \
  --url https://services.test.sw.com.mx/security/authenticate \
  --header 'password: $password' \
  --header 'user: $email

Response Example

{
  "data": {
    "token": "T2lYQ0t4L0RHVkR4dHZ5N....",
    "expires_in": 1684523799,
    "tokeny_type": "Bearer"
  },
  "status": "success"
}

Authenticate using infinite Token

For this process, we must enter the ADT 2.0 portal in the following link. ADT 2.0

We will enter with our credentials, email and password.

Once you’re inside the portal, navigate to the left side of the screen and click on the gear symbol located in the menu.

Then, we will click on “Credenciales Acceso”, this will open a text box, where the infinite token comes.

Inside the text box, we can see the access token by clicking on the “Show” option, or alternatively, by clicking the “Copy” button and placing it in our implementation.

Also, if necessary, you can regenerate the token to obtain a new one if needed.

Note: It is important to mention that with any of the two tokens, you can access the use of our services, but we recommend infinity for performance.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Updated on diciembre 28, 2023

Related Articles