Getting Started....
Once you obtain a Ticket Utils account, you will need to generate your access keys. To generate the keys, click on the "Configuration" link of the "Trading API" product within your account. Next, click on the generate button to create an API Token and enter a Secret passcode.
All the requests are to be Signed for an additional level of security. Signing requests will prohibit somebody from accessing the Token and using the APIs on your behalf.
You'll need to hash the Path and Query part of the Url using SHA256 and the secret to generate the Signature.
For example, in order to return the events using following endpoint
https://api.ticketutils.com/POS/EventData/Categories/Search
The part used for Generating the Signature is
/POS/EventData/Categories/Search
A typical HTTP Request will look like as follows:
GET https://api.ticketutils.com/POS/EventData/Categories/Search HTTP/1.1 X-Signature: [Signature] X-Token: [AuthToken] Host: https://api.ticketutils.com/
Following is the sample routine in C# which can be used for Signing.
public string GenerateSignature(string Secret,string PathAndQuery) { using (System.Security.Cryptography.HMACSHA256 Sha = new System.Security.Cryptography.HMACSHA256(System.Text.Encoding.UTF8.GetBytes(Secret))) { return Convert.ToBase64String( Sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(Uri.UnescapeDataString(PathAndQuery))) ); } }
Following is the sample routine in PHP which can be used for Signing.
function GenerateSignature($Secret,$PathAndQuery) { return base64_encode(\Zend_Crypt_Hmac::compute($Secret, 'sha256', $PathAndQuery, \Zend_Crypt_Hmac::BINARY)); }
Doing the signing
Now comes the fun part: integrating with Ticket Utils API. Using the APIs you can automate tasks related to your Point of Sale inventory management, build a white label ticketing e-commerce site or integrate with our JavaScript powered interactive seating charts.