Authenticate for the API
Authentication
POST/api/v1/authenticate
Send two credentials: your own, and the customer's.
How authentication works- Yours
Authorization: Bearer- The customer's
User-Authorization: Bearer
Language
Environment
Credentials
Your credential
The customer's credential
Choose an environment first.
curl -X POST https://api.btcdirect.eu/api/v1/authenticate \ -H "Authorization: Bearer $BTCD_PARTNER_TOKEN" \ -H "User-Authorization: Bearer $BTCD_USER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "username": "johndoe", "password": "kDWPe4qf$&mgM26&8hX" }'Response
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"}Request
usernamestring
Username to authenticate with.
Examplejohndoe
passwordstring
Password belonging to the given username.
ExamplekDWPe4qf$&mgM26&8hX
Responses
200Successfully authenticated.400A list of possible errors for this endpoint.Body of the success response
tokenstring
Authentication token. Use this to request resources requiring authentication.
ExampleeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
refreshTokenstring
Refresh token. Use this to request a new authentication token.
ExampleeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.