Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can access the token via authentication in API using username and password. (edited)  

Documentation

  • Endpoint: POST /api/v2/users/sign_in

  • Authentication: Not required

  • Request Body Format: x-www-form-urlencoded

  • Body

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

    • user[password] (string, required): The password associated with the user's account.

  • Response Format: JSON

  • Response Attributes

    • user_id (integer): The unique identifier for the user.

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

    • authentication_token (string): The long-lived authentication token used for subsequent authenticated requests.

Example response

Code Block
{
    "user_id": 1,
    "email": "user@example.com",
    "authentication_token": "<long token>"
}

...

Using API with curl

cURL Request to authenticate:

curl -X POST -d user[email]="user@example.com" -d user[password]="pwd" https://staging.makerble.com/api/v2/users/sign_in
Response:
{"user_id": 1, "email": "user@example.com", "authentication_token": "<long token>"}

...