Question

I have been testing BigCommerce API calls,

Firstly i tried orders.json call, and i did got proper reply.

But when i added date range parameters ie min_date_created and max_date_created, it gave me error.

I am testing it using PHP cURL, Following was the URL:

https://test.mybigcommerce.com/api/v2/orders.json?min_date_created=Thu, 16 May 2013 07:23:55 +0000&max_date_created=Sat, 18 May 2013 18:29:59 +0000

And following is the error i am getting:

[status] => 400
[message] => The field 'min_date_created' is invalid.
[details] => stdClass Object
(
[invalid_reason] => The provided value 'Thu,' is not a valid RFC-2822 date.
)

Can any one tell me where i went wrong?

Thanks,

Was it helpful?

Solution

Comment promoted to answer after it was correct:

You need to rawurlencode your parameters.

*edit*changed urlencode to rawurlencode, so that spaces are properly encoded to %20 as RFC, as opposed to +'s*

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top