API Authentication

Introduction

To be able to communicate with the Recommender Platform API all calls have to be authenticated. Any consumer has to authenticate via valid username and password. On a successful authentication the API will return a Bearer Token which is valid for 24 hours. After this period the consumer has to authenticate again.

The username and password needed for the API authentication are created by MOOST. If you do not have valid credentials please get in touch with hello@moost.io.

Any request to any endpoint other than the login endpoint has to include the returned bearer token as authentication header.

How to obtain a bearer token

To be able to communicate with any endpoint on the Recommender Platform API, a successful login has to be made via the login endpoint.

Request

To obtain a bearer token from the Recommender Platform API, the consumer has to send a POST Request to the API with the username and password in the body.

{
    "username": "hans.muster@moost.io",
    "password": "S3cur3P455w0rd"
}

Example

curl -X POST https://api.moost.io/login/v1 -H 'Content-Type: application/json' -d '{"username":"lucas.senn@moost.io","password":"testpassword"}' -v

Response

If valid credentials were supplied to the login endpoint of the Recommender Platform API, it responds with a Bearer Token which can be found in the Authorization Header field. The returned Bearer Token has to be included in the Header of any future request that is sent to the Recommender Platform API.

HTTP Status Code

Description

200

The authentication was successful. The Bearer Token is embedded in the header field “Authorization”.

401

The provided credentials have expired. You have to call the reset password endpoint first.

403

The provided credentials are not valid.

Last updated

© 2023 MOOST AG