Getting StartedAuthenticating on the API

Authenticating on the API

Authenticate Apara API requests by creating a Basic Authentication header from your API credentials.

Step 1: Get API Credentials (From Apara Portal)

  1. Sign in to the Apara Portal.

  2. Copy your USERNAME.

  3. Copy your PASSWORD.

These credentials are required for every authenticated API request.

Step 2: Authenticate a request

  1. Combine your credentials in the format USERNAME:PASSWORD.

    Example:

    
    aparaUser:aparaPass
    
    
  2. Encode the combined string in Base64.

    Using:

    //javascript
    const credentials = "aparaUser:aparaPass";
    const encoded = Buffer.from(credentials).toString("base64");
    
    console.log(encoded);
    
    
    //python
    import base64
    
    credentials = "aparaUser:aparaPass"
    encoded = base64.b64encode(credentials.encode()).decode()
    
    print(encoded)
    
    

    Expected output: YXBhcmFVc2VyOmFwYXJhUGFzcw==

  1. Add the encoded value to the Authorization header with the Basic prefix.

    
    Authorization: Basic YXBhcmFVc2VyOmFwYXJhUGFzcw==
    
    
  2. Send your API request with the Authorization header.

    Example:

    
    curl --location 'https://sandbox-api.aparatech.io/v3/config/supported-currencies?direction=deposit&userType=individual&limit=100&page=1' \
    --header 'accept: application/json' \
    --header 'mid: {{mid}}' \
    --header 'Authorization: Basic {{token}}'
    
    

The response depends on the endpoint you call, but every authenticated request must include the same Basic Authentication header format.