TIH Developer Portal enables you to create compelling solutions to deliver an enhanced experience for your visitors. This TIH Developer Portal guide will help you get started with:

  1. Registering for a business or developer account
  2. Obtaining an API Key
  3. Obtaining an OAuth Key (To perform specific operations)

 

1. REGISTERING FOR A BUSINESS OR 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

The TIH APIs are built on a RESTful HTTP architecture where the client (your application) makes HTTP requests to access content and services from TIH. The API requests are authenticated with an API Key, which is verified by the TIH API server before allowing any operations. Currently, the API request and response only supports the JSON format.

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".

The API Key grants access to most of the TIH APIs such as:

With these APIs, your application can retrieve rich content and images of points-of-interest in Singapore across the 12 content categories (accommodation, attractions, bars and clubs, cruises, deals, events, food and beverages, precincts, malls and shops, tours, venues, and walking trails).

Visit the API pages above for more information about each API, such as the description of the different APIs, tips on the best way to use the API, and a "Try it out" section to experiment with the different APIs. With your API Key, you and your company can get started on using these APIs in your application.

 

3. OBTAINING AN OAUTH KEY (TO PERFORM SPECIFIC OPERATIONS)

An OAuth Key, which acts as a secret key associated to your API Key, is needed for your company to access the following additional features and to perform specific operations:

Companies who are interested to use the above additional features and specific operations in your applications, are required to submit this online application form and provide the following information. All applications will be reviewed and may take up to 7 working days for processing.

  1. Organisation name and Nature of business
  2. Email address used to register for a TIH Business account
  3. Intended use of the specific operations APIs

Once the request has been approved, a ClientId (also known as API Key) and ClientSecret (also known as OAuth Key) will be emailed to your company's registered email address provided in the form. The OAuth Key will be tied to your company and registered email address.

 

Request for an OAuth Authentication Token to perform the specific operations

The TIH APIs leverage on the OAuth 2.0 industry-standard protocol for authorisation and authentication. An OAuth Authentication Token is required for applications to access the above resources and perform specific operations and this can be obtained by invoking the respective OAuth accessToken APIs.

After receiving the ClientId and ClientSecret, you will need to encode the ClientId:ClientSecret combination (separated by colon) in base64 to obtain an access token. You can use these tools available online for encoding to base64.

For example:

ClientId (API Key) is "abcdefg"

ClientSecret (OAuth Key) is "hijklmn"

ClientId:ClientSecret combination (separated by colon) will be "abcdefg:hijklmn" and needs to be encoded in base64 format

 

Next, head to the respective OAuth accessToken API page below, and obtain the OAuth Authentication Token with the following header and request parameters:

HEADER
Parameters Format / Example
Authorization Basic <base64 encoding of "clientId:clientSecret">
For example:
Basic UkV5dVA3SFIThHNG01eENISWZQaHNoTEczOHc6dXkxaUwIyM0RoTQ==
ContentType application/x-www-form-urlencoded
REQUEST
Parameters grant_type
Description Grant Type
Mandatory Yes
Example client_credentials

 

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 of your API call.

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.

 

Important note when using the APIs:

  • Please note that the date time information in the API response body is in UTC+8 (SGT).

 

We hope that the above will help you and your company get started on utilising our APIs to support your business initiatives and needs. 

For assistance or enquiries, reach us via our Contact Info page. Check out the latest TIH API enhancements via our Announcements page.