Cadastro

POST {{APIV2}}/api/v2/auth/register

Login API

This API endpoint allows users to authenticate and obtain authorization to access protected resources.

Request Body

  • email (string, required): The email address of the user.

  • password (string, required): The password of the user.

Response

  • error (boolean): Indicates if an error occurred during the login process.

  • message (string): A message related to the login process.

  • user (object): Information about the user including their details, devices, and invoices.

  • authorization (object): Contains the token and its expiration details.

Sample Response

{
    "error": true,
    "message": "",
    "user": {
        "search": "",
        "cellphone": "",
        "email": "",
        "first_name": "",
        "last_name": "",
        "status": "",
        "status_finance": "",
        "devices_count": 0,
        "invoices_open_count": 0,
        "last_login_ip": "",
        "updated_at": "",
        "last_login_at": "",
        "devices": [
            {
                "number_device": "",
                "search": "",
                "server_search": "",
                "status": "",
                "status_situation": "",
                "created_at": "",
                "device_ip": "",
                "device_key": "",
                "device_name": "",
                "device_token": "",
                "last_activity": "",
                "api_info": {
                    "description": "",
                    "name": "",
                    "search": ""
                },
                "server": {
                    "apitoken_public": "",
                    "host_public": "",
                    "server_search": "",
                    "servername": "",
                    "status": "",
                    "type": "",
                    "documentation": null
                }
            }
        ]
    },
    "invoices": [],
    "authorization": {
        "token": "",
        "expires_in": 0,
        "type": ""
    }
}

Request Body

{"first_name"=>"José", "cellphone"=>"319922292012", "email"=>"testejhon123@gmail.com", "ref"=>"4THtBN", "password"=>"{{senha}}", "terms_accepted"=>true}

RESPONSES

status: OK

{"error":false,"message":"Usuário logado com sucesso!","user":{"search":"d4f0167c-ab83-4110-91b8-dd671aabeaea","cellphone":"14998462627","email":"jhondoe@gmail.com","first_name":"Ellon","last_name":"Musk","status":"active","status_finance":"active","devices_count":1,"invoices_open_count":0,"last_login_ip":"127.0.0.1","updated_at":"2023-08-22T01:39:11.000000Z","last_login_at":"2023-08-22T01:39:11.826045Z","devices":[{"number_device":null,"search":"487257eb-b6a8-46ee-962c....","server_search":null,"status":"FAIL","status_situation":"active","created_at":"2023-08-21T20:02:57.000000Z","device_ip":"127.0.0.1","device_key":"0987felizkk","device_name":"positivodebug3","device_token":"5a4d4422-2f10-4e0c-b99....","last_activity":"2023-08-21 20:32:44","api_info":{"description":null,"name":"API Whats","search":"487257eb-b6a8-46ee-962c...."},"server":null}]},"invoices":[],"authorization":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....","expires_in":1724204351,"type":"bearer"}}