Make your first API call to Banqup
This guide will walk you through making your first successful API call to Banqup. By the end, you'll have authenticated and retrieved your user's spaces.
This guide focuses on Client Credentials Grant. If you need the Authorization Code Grant, see the OAuth Implementation Recipe.
Step 1: Get your access token
Now you'll use the Client Credentials Grant to get an access token.
Note that the OAuth flow is also an authentication option.
Before this works, your business owner (legal representative) must whitelist your application ID. Without whitelisting, you'll see no available spaces.
Request an access token
curl -X POST https://{{serverHostname}}/oauth2/client_credential/gettoken \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Depending on your geographic location, the server hostname is either
- api.uat.btx.fr.banqup.com (France)
- api.uat.btx.eu.banqup.com (Other regions)
Replace:
YOUR_CLIENT_ID- The Client ID from Developer PortalYOUR_CLIENT_SECRET- The Client Secret (shown only once when created)
Don't have a Client ID and Secret yet? Here's how to create your client credentials
Expected response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
...
}
- Access tokens expire after 5 minutes
- Store tokens securely in memory or encrypted storage
- Never commit tokens to version control
- Refresh tokens when you receive a 401 Unauthorized response
Step 2: Make your first API call
Retrieve spaces
Let's retrieve your user's spaces to verify everything works.
curl -X GET https://{{serverHostname}}/entitystore/v1/spaces \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/json"
Replace:
YOUR_ACCESS_TOKEN- The access token you received in Step 1
Expected response
{
"spaces": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"type": "BUSINESS",
"segment": "CONSUMER",
"region": "eu",
"entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}