Skip to content

Authentication and Authorization

BankGround uses OAuth2 for authentication and authorization. Follow the steps below to get started.

Create a new user 🙋‍♂️🙋🏻‍♀️

First, you need to register with BankGround. To create an account use a POST /users operation.

E.g.

{
    "first_name": "Charles",
    "last_name": "Goose",
    "email": "karel@example.net",
    "password": "hello_pass",
    "company": "APImate"
}

The response for a correct request will be a JSON object with the following structure:

{
    "first_name": "Charles",
    "last_name": "Goose",
    "email": "karel@apimate.example.net",
    "company": "APImate",
    "last_login": "2023-05-23T14:13:53.294393+00:00"
}

Login 🗝️

Once you have an account you can log in. To login make a POST request to the /token endpoint. Use application/x-www-form-urlencoded Content-Type and provide the following parameters: - username - password

A positive response will look like this:

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJrYXJlbEBleGFtcGxlLm5ldCIsImV4cCI6MTY4NDkzNzk5Mn0.6hqM7KpmzMbpgRcn_juYg3WBMVqnUoi0AuXZNPbSqqI",
    "token_type": "bearer"
}

Yippee! 👏 You are now logged in and can start using BankGround API.

Check it out ✔️

Let's see all your account information with a GET /me request.

You need to use the access token you received in the previous step. Add it to the request as a Bearer token.

Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJrYXJlbEBhcGltYXRlLmV4YW1wbGUubmV0IiwiZXhwIjoxNjg0OTM4NjM2fQ.uPrOnhX9fr0LPMKvxWS0rZ7cLt91Yh9A53igCYYLLAU
Host: bankground.apimate.eu

The expected response:

{
    "first_name": "Charles",
    "last_name": "Goose",
    "email": "karel@apimate.example.net",
    "company": "APImate",
    "last_login": "2023-05-23T14:30:36.526391+00:00"
}
👍 If you get such response, you are ready to go. Use the bearer token in all your requests to BankGround API.

⛔ If you get a 401 Unauthorized response, you probably forgot to add the access token to the request. Check the Authorization header and try again. Don't give up!

Once you are registered, you can open a BankGround account.