Endpoints - WLSF/bank GitHub Wiki

Currently the project contains 3 fully working endpoints, including:

  1. /api/accounts {POST}
  2. /api/login {POST}
  3. /api/indications {GET} - Must be authenticated

Accounts creation

This endpoint stands at /api/accounts with POST method, and it receives the following parameters:

{
  "account": {
    "cpf": "059.941.023-02",
    "birth_date": "1990-01-20",
    "email": "[email protected]",
    "name": "Marcus",
    "city": "Your City",
    "state": "Your State",
    "country": "Your Country",
    "gender": "male"
  }
}

The example above already contains the mask demo for specific fields like CPF, birth_date and email. Your CPF must be: xxx.xxx.xxx-xx Your birthdate must be: yyyy-mm-dd Your email must be: [email protected]

OBS: The referral_code shouldn't be on your request unless you have a referral code from a friend of yours.

  • You don't need to be authenticated to execute this function.
  • Using a CPF that's already registered will execute an update of the data on the existent account.
  • Your account must be complete to receive a referral_code that you can share with your friends. (complete: have all fields filled as shown above)
  • If you have a referral_code from a friend, just insert into the body request among the other arguments (ex- "referral_code": 99945711)

Sign in

This endpoint stands at /api/login with POST method, it receives the following body parameters:

{
  "email": "[email protected]",
  "cpf": "xxx.xxx.xxx-xx"
}

If your data is set correctly the endpoint will answer with a 200 (:ok) and a JWT token that you can use to execute the indications request.

Indications

This endpoints stands at /api/indications with GET method.

For this endpoint you need:

  1. Be authenticated into our system, with a JWT token of your account.
  2. Own a complete account status, with all the fields filled