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

Rate limit status


PurposeCheck you can connect correctly to the API service
Check remaining limit for API requests (i.e. not currently throttled)
Current API requests remaining are also returned in the response header to every call
NotesCalls to this API do not count towards your throttle limit
REST info Call/api/rate_limit_status
FormatsXML
Example/api/rate_limit_status.xml
VerbGET
Code

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. 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 
$channel_id = 0; 

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

// Print out the remaining hits 
print  'Remaining hits: '.$result->remaining_hits;
Remaining hits: 500

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
string lim = doc.GetElementsByTagName("remaining_hits")[0].innerText;
Console.WriteLine("Remaining hits: " + lim);
Remaining hits: 500

VB 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
Dim channelId As Integer = 0
  
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.ApiRateLimitStatus(channelId)
  
' Print out the remaining hits
Dim lim As String = doc.GetElementsByTagName("remaining_hits")(0).InnerText
Console.WriteLine("Remaining hits: " & lim)
Remaining hits: 500

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_hitsNumber of remaining hits before you are throttled
hourly_limitCurrent GET limit per hour

Sample XML Response

None here currently

More information

© 2003-2012 Travel UCD Limited. All rights reserved. TourCMS® is a registered trademark of Travel UCD Limited, United Kingdom. View Privacy policy.

Free 1 hour webinar - An introduction to TourCMS, 31st May @ 3pm GMT / 4pm BST (UK). Check in your timezone and register »