Giter VIP home page Giter VIP logo

challenge-run-2022's Introduction

Bankin Bank API Mock

This is an API used for technical tests

Installing

npm install
npm start

The local server run on port 3000

Infos

Credentials Value
login BankinUser
password 12345678
clientId BankinClientId
clientSecret secret

Endpoints


Login

Used to get a Refresh Token for a registered User.

URL : /login

Method : POST

Auth required : Authorization Basic credentials is composed of APP client_id and client_secret base 64 encoded

Headers : Content-Type: application/json

Data constraints

{
    "user": "[valid login]",
    "password": "[password in plain text]"
}

Success Response

A token you need to refresh in order to get a working access token.

Code : 200 OK

Content example

{
    "refresh_token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d"
}

Error Response

Condition : Something get wrong with the request.

Code : 400 BAD REQUEST

Condition : If 'login' and 'password' combination is wrong.

Code : 401 UNAUTHORIZED


Token

Used to get an Access Token from a Refresh Token.

URL : /token

Method : POST

Auth required : No

Headers : Content-Type: application/x-www-form-urlencoded

Data constraints

grant_type=refresh_token&refresh_token=<YOUR REFRESH TOKEN>

Success Response

A token to access accounts endpoints.

Code : 200 OK

Content example

{
    "access_token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d"
}

Error Response

Condition : Something get wrong with the request.

Code : 400 BAD REQUEST

Condition : If your refresh token is wrong.

Code : 401 UNAUTHORIZED


Accounts

Get all user's accounts.

URL : /accounts

Method : GET

Auth required : Authorization header with Bearer token

Headers : Content-Type: application/json

Success Response

Code : 200 OK

Content example

{
    "account": [
        {
            "acc_number": "000000001",
            "amount": "3000",
            "currency": "EUR"
        }
    ],
    "link": null
}

Error Response

Condition : If access token is wrong.

Code : 401 UNAUTHORIZED


Transactions

Get an account's transactions, by account number

URL : /accounts/<acc_number>/transactions

Method : GET

Auth required : Bearer token

Headers : Content-Type: application/json

Success Response

Code : 200 OK

Content example

{
    "transactions": [
        {
            "id": 1,
            "label": "label 1",
            "sign": "DBT",
            "amount": "30",
            "currency": "EUR"
        }
    ],
    "link": null
}

Sign references

Sign label Meaning
DBT Debit transaction
CDT Credit transaction

Error Response

Condition : If access token is wrong.

Code : 401 UNAUTHORIZED

challenge-run-2022's People

Contributors

wbaridon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.