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:
- Registering for a business or developer account
- Obtaining an API Key
- 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:
- Content User API
- Media User API
- Deals API
- 3rd Party Information Sources API
- Enhanced Navigation Services API
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:
- 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
- Access the Itinerary Planner APIs which empower your visitors to create their own Singapore itinerary. The Visit Singapore Account service is required for the Itinerary Planner service as a convenient and secure way for your customers to log into your application.
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.
- Organisation name and Nature of business
- Email address used to register for a TIH Business account
- 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.
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:
- 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:
- Content Provider API
- Media Provider API
- Recommendation Engine API
- Visit Singapore Account API
- Itinerary Planner 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.
- 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 API User Guide - Visit Singapore Account).
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.