Skip to content

Making requests

Here are the flow to set up your first request.

Get API account

Before building you will require a client-account and API gateway key(API access key). Please contact Travlinq support team and get a client account and API gateway key.

API Access Key

You'll need to include an API access key(X-API-KEY) in every request that you make to the API. The access token can be taken from Travlinq support team.

Authentication

You'll need to include an access token(sessionId) in every request that you make to the API. The access token can be generated from Auth service by using client account. The accesses token will be valid only for 6 hour(Duration is configurable). After token is expired user has to regenerate and use new token for following API calls. When token is expired user will get VAL-002 error code.

To create an access token, go with Auth service flow.

MIME types

All responses from the API are in JSON format with UTF-8 encoding. An Accept header is required with every request:

"Accept": application/json
All request bodies sent to the API should be in JSON format. A Content-Type header is required whenever you're sending a request body (i.e. for POST and PUT requests):
"Content-Type": application/json

Compression

We recommend enabling compression for responses returned by the API, since might be large. To enable compression, send an Accept-Encoding header:

"Accept-Encoding": gzip
You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.

Tracking transaction flow

You should set a common UUID for conversationId header. So you have to maintain single id for search to book. By providing proper conversationId, issue tracking will be lot easier and it'll be helpful for stats collection purpose as well.

"conversationId": "ba9feb1f-5c5b-4839-8885-82b3c3a17a90"

Then you will have to provide below parameters with request headers with all request to API

Header Name Value
sessionId take from login call
conversationId common UUID for entire flow
X-API-KEY API access key which is unique for each client
Content-Type application/json
Accept-Encoding gzip

The http header should include your API Client Key(sessionId) with below parameters to allow access to the API. In your HTTP connector pass these headers, for example:

  request.Method = "POST";
  request.ContentType = "application/json";
  request.Headers.Add("sessionId", sessionId);     
  request.Headers.Add("conversationId", conversationId);   
  request.Headers.Add("X-API-KEY", x_api_key);   
  request.Headers.Add("Accept-Encoding", "gzip,deflate");
  request.KeepAlive = false;