TIH Developer Portal enables you to create compelling solutions to deliver an enhanced experience for your visitor. This guide to the TIH Developer Portal will help you get started:
- Registering for a developer account
- Obtaining an API Key
- Obtaining an OAuth Authentication Token
1. REGISTERING FOR A DEVELOPER ACCOUNT
To gain access to TIH APIs, you can either register for a TIH Business account or a TIH Developer account. Should you be a technology/ software company or a developer representing a business, you are recommended to register for a TIH Business account.
2. OBTAINING AN API KEY
To retrieve your API Key, sign in to your account and navigate to “My Settings”. Check on “I would like to have an API Key” and click save. Should you be registered as Business account, you will need to be a Business Product Admin before seeking request.
The API Key grants access to the following TIH APIs:
Each API page provides description of each API and tips on the best ways to use each API. Experiment with the APIs in the “Try it out” section located within these API pages.
3. OBTAINING AN OAUTH AUTHENTICATION TOKEN
Besides the API Key, an OAuth Authentication Token is required to
- Contribute information via the Content Provider APIs and Media Provider APIs
- Access the Visit Singapore Account APIs, which enable a seamless log in for your customers
- Access the Recommendation Engine APIs which let you provide recommendation services to your customers
Once the request has been approved, a ClientId and ClientSecret will be emailed to your registered email address.
After receiving the ClientId and ClientSecret, you will need to encode the ClientId:ClientSecret combination in base64 to obtain an access token. You can use these tools available online.
Head to the respective OAuth accessToken API page below, and obtain the OAuth Authentication Token with the following header and request parameters:
- TIH OAuth accessToken API page (For Content Provider APIs, Media Provider APIs and Recommendation Engine APIs)
- Visit Singapore Account OAuth accessToken API page (For Visit Singapore Account APIs)
|Parameters||Format / Example|
|Authorization||Basic <base64 encoding of "clientId:clientSecret">
From the JSON response, you can get the access token from the “access_token” value, which expires in 1 hour. With this access token, you can use any of the following APIs:
To use the above APIs, you will need to pass the access token as part of the “Authorization” parameter in the request header.
If your access token has expired, you can obtain a new token using accessToken API or refreshToken API. To use refreshToken API, pass the token you received earlier as the “refresh_token” request parameter.
- TIH accessToken API or TIH refreshToken API (For more details, please refer to the OAuth Authentication Technical Integration Guide.)
- Visit Singapore Account accessToken API or Visit Singapore Account refreshToken API (For more details, please refer to the VS Account Technical Integration Guide.)
We hope that the above will help you get started on utilising our APIs to support your business initiatives and needs.
For assistance or enquiries, reach us via our Contact Info page.