Authentication
How to authenticate
All requests have to be authenticated, to do that, you need to send a header with your token, let's see how to do it:
First, to generate a TOKEN.
There's a lib for nodejs here: Click here
Important Information
All our endpoints expect and returns JSONs, you can test it using a tool like Postman or Insominia.
Endpoint: [POST] https://api.whats2api.com/authentication
Headers:
- Content-Type: application/json
- Accept: application/json
Body:
- email: Your user is email
- password: Your user is password
- strategy: local
Response
Which you will want to use 'accessToken as your token'
Important Information
Each token has a life of 1 day.
{ "accessToken": "xxxxxxx", "user": { "_id": "xxxxxxx", "email": "xxxxxxx", "createdAt": "xxxxxxx", "updatedAt": "xxxxxxx" } }