Use Basic Auth for secure connection
Closed Release
This feature is a Closed Release, available for a limited number of users and specific use cases only.
Although we still support Basic Authentication (Auth), we strongly encourage you to use OAuth 2.0 with Tango API. Basic Auth uses authentication. It identifies you as the correct person with the online account credentials. Basic Auth requires your credentials to gain access to your platform.
Note:
To enable Tango API keys for your Tango platform, contact your Customer Success Manager (CSM) or [email protected] . You need the Tango portal integration rights. See how to Sign in to the Tango portal . If you don't have an account with Tango, see how to set up an account .
Best practices:
- For your security, Tango API key is masked in the Tango portal. Treat your API keys like passwords and do not share them with unauthorized parties or over unsecured communication channels.
- You can have up to two active API keys at the same time. However, we recommend you to keep only one active API key unless when youβre rotating your keys.
- Rotate API keys at least once every six months AND whenever someone who's had access to the key leaves the company. To avoid disruption when you rotate the keys, keep two API keys active until your integration is updated successfully. Deactivation cannot be undone.
How to use Basic Auth to secure your connection?
Follow the instructions below:
Step 1: Get the platform name and API key
You must have Tango API keys Manage permissions enabled for your user under the Integrations permission section. With the right permissions, you can access API keys for the Basic Auth in the Tango portal. Be mindful of production vs. sandbox environment. Tango allows API developers to test using a sandbox environment before going live. See Set up work environment for Tango API.
To get the platform name and API key in Tango portal:
- Log in to the Tango portal. See how to Sign in to Tango portal.
- Go to Team settings > Integrations on the left menu.
- Go to API keys and click Create Credentials to generate a new key, or open an existing API Key.
- Click copy next to Platform name and API key and keep it safe.
- (Optional) Enter a unique name for the display and click Save display name. A new key is generated and immediately accessible for use. You can have up to two active keys at any time.
Step 2: Test your integration
With your platform name and API key at hand, test your integration in Tango API test console to make sure the integration is working:
-
Go to the Tango API test console.
-
Navigate to the API function you want to test, such as Get a list of all customers.
-
Change credentials to Basic.
-
Enter your username (Platform name) and password (API key) you've got from the Tango portal.
-
Click Try it and check the response.
Step 3: Call the Tango API
Once you test and make sure the integration is working, use your Platform name and API key to generate an authorization header and call the API as in the example below:
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://integration-api.tangocard.com/raas/v2/customers")
.get()
.addHeader("accept", "application/json")
.addHeader("authorization", "Basic Authorization header")
.build();
Response response = client.newCall(request).execute();
```
Updated 4 days ago