Saltar al contenido principal

API - Start Interacting

The Whats UY API is your gateway to interact with your WhatsApp accounts and beyond, providing access to a variety of features and possibilities. In this section, we'll show you how to log in and get a token to use in your requests to the API.

Authentication

To interact with the Whats UY API, you'll need to authenticate. To do this, you must obtain an access token by making a POST request to the login action that the API provides. Here's an example using curl.

curl --location --request POST 'https://apirest.whatsuy.com/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "user@mail.com",
"password": "supersecurepassword"
}'

The response to this request should look like this:

{
"username": "9812374839",
"accountStatus": "ok",
"active": true,
"email": "user@mail.com",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVFJ7.eyJ1c2VyIjp7YmlkIjoiNjJiZGJhZGNmMjFmN2E1ZHY1MzM0N2I1In1sImlhdCI6MTY2MTc3NTQwOX0.D_gkF09G7kSjopCbfoquILK4duUWoa4MprZid1czyq2w"
}

Using the Token

Subsequent requests to the Whats UY API will require the token generated during the login action. This token acts as a key that not only allows access to the API, but also identifies the user who is making the request.

Make sure to include the token in the authorization header of your requests, as in the following example:

curl --location --request GET 'https://apirest.whatsuy.com/user/me' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVFJ7.eyJ1c2VyIjp7YmlkIjoiNjJiZGJhZGNmMjFmN2E1ZHY1MzM0N2I1In1sImlhdCI6MTY2MTc3NTQwOX0.D_gkF09G7kSjopCbfoquILK4duUWoa4MprZid1czyq2w'

With the authentication properly set up, you're ready to explore all that the Whats UY API has to offer, from sending and receiving messages to designing custom bots and analyzing the mood of the conversations.