Dario Filidei
Dario Filidei

Reputation: 15

Amazon MWS API parsing URL error "the value of a query string parameter may not contain a '=' delimiter"

Hy everybody I'm trying to work with Amazon MWS APIs and followed the guides the better I can with a result of this code:

$AWSAccessKeyId = "XXXXXXXX";
$SellerID = "XXXXXXXXXX";
$MarketplaceId_IT = "APJ6JRA9NG5V4";
$MarketplaceId_UK = "A1F83G8C2ARO7P";
$MarketplaceId_DE = "A1PA6795UKMFR9";
$MarketplaceId_FR = "A13V1IB3VIYZZH";
$MarketplaceId_ES = "A1RKKUPIHCS9HS";
$MWSAuthToken = "XXXXXXXXXXXX";
$SecretKey = "XXXXXXXXXXXXXXXXXXXXX";

$date = date(DATE_ISO8601);

$https_request_url = "https://mws-eu.amazonservices.com/Orders/2013-09-01?AWSAccessKeyId=".$AWSAccessKeyId."&Action=ListOrders&CreatedAfter=".$date."&MWSAuthToken=".$MWSAuthToken."&MarketplaceId.Id.1=".$MarketplaceId_IT."&MarketplaceId.Id.2=".$MarketplaceId_UK."&MarketplaceId.Id.3=".$MarketplaceId_DE."&MarketplaceId.Id.4=".$MarketplaceId_FR."&MarketplaceId.Id.5=".$MarketplaceId_ES."&FulfillmentChannel.Channel.1=MFN&SellerId=".$SellerID."&SignatureVersion=2&SignatureMethod=HmacSHA256&LastUpdatedAfter=".$date."&Timestamp=".$date."&Version=2013-09-01";

$Signature = base64_encode(hash_hmac('sha256', $https_request_url, $SecretKey, true));

echo '<a href="'.$https_request_url.'&Signature='.$Signature.'HTTP/1.1Host:mws-eu.amazonservices.comx-amazon-user-agent:Algolapi/1.0(Language=Php)Content-Type:text/xml" >LINK</a>';

When I click on my test link I get this error:

<ErrorResponse><Error><Type>Sender</Type><Code>InvalidParameterValue</Code><Message>Invalid query string provided - XXXXCODEXXXX - is not valid; the value of a query string parameter may not contain a '=' delimiter</Message></Error><RequestID>54e589e5-b702-4e5e-a1f7-e8f6c0362129</RequestID></ErrorResponse>

I've seen googling around that is not a rare error but can't understand the solutions provided... I'm stuck please help. Thanks in advance

Upvotes: 0

Views: 688

Answers (2)

Fabien Thetis
Fabien Thetis

Reputation: 1734

You need to convert the character "=" to %3D

Upvotes: 0

Jfed
Jfed

Reputation: 187

Your signature might have a "=" at the end. Try adding

$Signature = urlencode($Signature);

before making your call.

Upvotes: 1

Related Questions