Difference between revisions of "How To and Samples"

From SRP API Docs

(PHP)
(How To and Samples)
Line 1: Line 1:
 
== How To and Samples ==
 
== How To and Samples ==
 
 
=== Authentication ===
 
=== Authentication ===
 
==== PHP ====
 
==== PHP ====

Revision as of 12:44, 1 February 2012

How To and Samples

Authentication

PHP

To create HMAC-SHA1 signature you can use:

$strPrivateApiKey = 'Jx1qfZA1OLgj5s6A8wzHI7T9aHb2b1zHItPATXPPJNwHBx17HZjKhnoLGJFX7t75';
$strStringToSign = 'GET https://api.structuredretailproducts.com/v1/products?market=MK0012 257 e4693df9ec5136eec8af95c1dd029a06 1328092781';
$strRawSignature = hash_hmac( 'sha1', $strStringToSign, $strPrivateApiKey, true);
$strSignature = base64_encode( $strRawSignature );