MainBrainer supports JWT Bearer Authentication
to authenticate all API requests. This endpoint creates the access token
that must be passed in the Authorization header of all your API requests on MainBrainer. To create the access token, you’ll need to pass your account’s private token in your request.You can also set your token validity. Log into your account and get your account’s private token from the Account Configuration menu.
Create a token to use further API POST API/token { "username": "xxxxxxxxxxx@xxxxx. com", "password": "xxxxxxx", "privatetoken": "00000000-0000-0000-0000-000000000000" }
userName | string or null Default: "[email protected]" The email address with which your account is registered on MainBrainer.com |
password | string or null Default: "xxxxxxxxxxx" The password you use to access your |
privateToken | string or null Default: "00000000-0000-0000-0000-000000000000" The private token assigned to your MainBrainer account and available under your account’s configuration menu. |
validity | string (LKP.eTokenValidity) The period for which you want your access token to remain valid. |
Returns the newly created token
If the item is null
Unauthorized
Conflict
Client Error
Server Error
{- "password": "xxxxxxxxxxx",
- "privateToken": "00000000-0000-0000-0000-000000000000",
- "validity": "Default"
}
{- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiMyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3J",
- "token_type": "Bearer",
- "expires_in": 120,
- "userName": "Tom",
- "issued": "2020-05-29T04:21:56.0000000+00:00",
- "expires": "2020-05-29T06:21:56.0000000+00:00",
- "timeZoneOffset": "UTC+00.00",
- "locale": "en-US"
}