TourCMS, a leading online booking and channel management solution is operated by Palisis.

Contact Info

Palisis AG
Florastrasse 18A
8610 Uster
support@palisis.com
+41 44 533 40 40

Follow Us

home > support > API > Marketplace API > API: rate limit status

API Rate limit status

Check hit limits for GET/POST current API requests (i.e. not currently throttled). Remaining hits are also returned in the response header to every call.

Also useful for check if you can connect correctly to the API.

Calls to this API do not count towards your throttle limit.

REST info

Endpoint/api/rate_limit_status
FormatsXML
Example/api/rate_limit_status.xml
VerbGET

Code samples

PHP examples use the PHP Client Library with the return type set to SimpleXML

Description

object api_rate_limit_status ( [ int $channel = 0 ] )


Parameters

$channel
Suppliers use your Channel ID.
Agents leave blank / zero or pass a specific channel to check your remaining limit for that channel.


Example

// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this will be 0
$channel_id = 0;

// Query the TourCMS API
$result = $tc->api_rate_limit_status($channel_id);

// Print out the remaining hits for GET and POST requests
print  'GET remaining hits: ' . $result->remaining_hits;
print  'POST remaining hits: ' . $result->remaining_hits_post;
GET remaining hits: 500 
POST remaining hits: 1900

C# examples use the .Net Client Library

Overload list

XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (int channelId)


Parameters

channelId
Suppliers use your Channel ID. Partners leave blank / zero

Example

// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this will be 0
int channelId = 0;

// Query the TourCMS API
XmlDocument doc = myTourCMS.ApiRateLimitStatus(channelId);

// Print out the remaining hits for GET and POST requests
string limGET = doc.GetElementsByTagName("remaining_hits")[0].innerText;
string limPOST = doc.GetElementsByTagName("remaining_hits_post")[0].innerText;
Console.WriteLine("GET remaining hits: " + limGET);
Console.WriteLine("POST remaining hits: " + limPOST);
GET remaining hits: 500 
POST remaining hits: 1900

VB examples use the .Net Client Library

Overload list

XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (Integer ChannelId)


Parameters

channelId
Operators use your Channel ID. Agents leave blank / zero

Example

' Set the Channel ID
' For Suppliers this can be found in the API settings page
' For Partners this will be 0
Dim channelId As Integer = 0

' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.ApiRateLimitStatus(channelId)

' Print out the remaining hits for GET requests
Dim limGET As String = doc.GetElementsByTagName("remaining_hits")(0).InnerText
Dim limPOST As String = doc.GetElementsByTagName("remaining_hits_post")(0).InnerText
Console.WriteLine("GET remaining hits: " & limGET)
Console.WriteLine("POST remaining hits: " & limPOST)
GET remaining hits: 500 
POST remaining hits: 1900

NodeJS examples use the NodeJS Wrapper


Example

// Set the Channel ID

// For Operators this can be found in the API settings page

// For Marketplace Agents this can be 0 for general API calls
// or set to a ChannelID to see how many calls remain on that Channel

var channelId = 0;

// Query the TourCMS API
TourCMS.apiRateLimitStatus({
	channelId: channelId,
	callback: function(response) {
		console.log("GET remaining hits: " + response.remaining_hits);
		console.log("POST remaining hits: " + response.remaining_hits_post);
	}
})
GET remaining hits: 500 
POST remaining hits: 1900

Looking for sample code in a different language? TourCMS and community provided API libraries

Implementing yourself? Check the REST info for this endpoint.

Try it

Enter your TourCMS API credentials below to call the API Rate limit status endpoint.


            
            

Querystring parameters

There are no querystring parameters supported by this method.

Response fields

Response fields
XML NodeNotes
request Confirmation of the request that you sent
error Any error message returned, if there is no error this will just contain the text OK
remaining_hits Number of GET remaining hits before you are throttled
hourly_limit Current GET requests limit per hour
remaining_hits_post Number of remaining POST hits before you are throttled
hourly_limit_post Current POST requests limit per hour

Example response

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <request>GET /api/rate_limit_status.xml</request>
  <error>OK</error>
  <remaining_hits>2999</remaining_hits>
  <hourly_limit>3000</hourly_limit>
  <remaining_hits_post>2999</remaining_hits_post>
  <hourly_limit_post>3000</hourly_limit_post>
</response>


More information