Authorization


Processo de autenticação na plataforma.

Login

Method URI Headers Authorization
POST /api/v3/auth/login Content-Type:application/json Authorization: Bearer {token}

Attributes

  • email: teste@doc88.com.br (string, required) - Email de login
  • password: 12345678 (string, required) - Senha de acesso

Body

{
  "email": "teste@doc88.com.br",
  "password": "12345678"
}

Response

{success} Response 200 (application/json)

{
    "token": "eyJ0eXAiOiJKV1QiLCJ...."
}

{warning} Response 401 (application/json)

{
  "error": "Unauthorized"
}

Logout

Method URI Headers Authorization
POST /api/v3/auth/logout Content-Type:application/json Authorization: Bearer {token}

Response

{success} Response 200 (application/json)

{
    "message": "Logout successfully"
}

Me

Method URI Headers Authorization
GET /api/v3/auth/me Content-Type:application/json Authorization: Bearer {token}

Response

{success} Response 200 (application/json)

{
    "user": {
        "id": 3,
        "name": "teste",
        "avatar": "/avatar/avatar-3.jpg",
        "cellphone": null,
        "email": "teste@doc88.com.br",
        "active": true,
        "admin": false,
        "receive_alert_emails": 0
    },
    "account": {
        "id": 1,
        "name": "Conta Zordon"
    },
    "account_user": {
        "id": 1,
        "admin": true
    },
    "notification": false
}

Edit Profile

Method URI Headers Authorization
POST /api/v3/auth/profile Content-Type:application/json Authorization: Bearer {token}

Attributes

  • name: Name of teste Updated (string, required) - Nome do usuário
  • cellphone: 1112345678 (string, optional) - Telefone do usuário

Body

{
    "name": "Name of teste Updated",
    "cellphone": "1112345678"
}

Response

{success} Response 200 (application/json)

{warning} Response 401 (application/json)

{
  "error": "Unauthorized"
}