Hi,
I am trying to set up a call to an api that requires a signature but I think I am failing with the timing issue.
What the guide says about configure is as follows:
<?php
// Pay no attention to this statement.
// It's only needed if timezone in php.ini is not set correctly.
date_default_timezone_set("UTC");
// The current time. Needed to create the Timestamp parameter below.
$now = new DateTime();
// The parameters for our GET request. These will get signed.
$parameters = array(
// The user ID for which we are making the call.
'UserID' => 'look@me.com',
// The API version. Currently must be 1.0
'Version' => '1.0',
// The API method to call.
'Action' => 'FeedList',
// The format of the result.
'Format' => 'XML',
// The current time formatted as ISO8601
'Timestamp' => $now->format(DateTime::ISO8601)
);
// Sort parameters by name.
ksort($parameters);
// URL encode the parameters.
$encoded = array();
foreach ($parameters as $name => $value) {
$encoded[] = rawurlencode($name) . '=' . rawurlencode($value);
}
// Concatenate the sorted and URL encoded parameters into a string.
$concatenated = implode('&', $encoded);
// The API key for the user as generated in the Seller Center GUI.
// Must be an API key associated with the UserID parameter.
$api_key = 'b1bdb357ced10fe4e9a69840cdd4f0e9c03d77fe';
// Compute signature and add it to the parameters.
$parameters['Signature'] =
rawurlencode(hash_hmac('sha256', $concatenated, $api_key, false));
and
'Timestamp' => '2015-07-01T11:11:11+00:00'
So, I setup like this,
any idea how to make it work?
Best regards,