Website logo
⌘K
Triple Basics
Triple Overview
Getting Started With Triple's API
Introduction to Triple API Endpoints and Webhooks
Getting Started Overview
Triple API and Webhooks
Affiliate Links
Webhooks
Card Accounts
Offer Display
Offer Activation
Card Programs
Tools
Offer Providers
Offer Filters
Portfolio Management
Rewards
Transactions
User Events
Triple White Label UI
Platform Status
Docs powered by Archbee
Getting Started With Triple's ...
Getting Started Overview

Step 1: Perform Authentication

2min

You will need to obtain an authentication token before you use the Triple API endpoints. The Triple API uses OAuth2 with a Client ID and Client Secret to authenticate.

To authenticate, use these steps.

  1. After you've signed with Triple, you will receive a Client ID and Client Secret that you'll use to send a request for a token.
  2. Place a colon in-between your Client ID and Client Secret, then apply Base64 encoding.

Here is an example:

Python
grant_type = "client_credentials"

# authorization key must be base64 encoded and concatenate triple_id:triple_secret

byte_key = "abcdefg" + ":" + "012345"
byte_key = byte_key.encode("ascii")
triple_authorization_key = base64.b64encode(byte_key)
triple_authorization_key = triple_authorization_key.decode("ascii")

def token_request():
    r = requests.post(
        MY_AUTH_URL,
        data={"grant_type": grant_type},
        headers={"Authorization": "Basic " + triple_authorization_key,
                 "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"}
    )

    response = r.json()
    print(response["access_token"])
    return response["access_token"]

my_auth_token = token_request()


Note the content-typevalue. It is set to application/x-www-form-urlencoded

3. Send the encoded token to the following URL to get an OAuth2 token:  https://auth.tripleup.dev/oauth2/token.

Curl
Curl
curl --location 'https://auth.tripleup.dev/oauth2/token' \--header 'Authorization: Basic YMJjZZGVmZzowMTIzNDU=' \--header 'Content-Type: application/x-www-form-urlencoded' \--data-urlencode 'grant_type=client_credentials'


4. You'll then receive a bearer token that you can use for the API. This server-side token lasts for 60 minutes.

Once you have been authenticated, go to Step 2: Register Card Programs.

Updated 12 Jul 2023
Did this page help you?
PREVIOUS
Getting Started Overview
NEXT
Step 2: Register Card Programs
Docs powered by Archbee
Docs powered by Archbee