question

carl_mars avatar image
0 Likes"
carl_mars asked ·

Bad Request using python to call REST API

Anybody may help that whey below python code always lead to Bad Request?

The Token has been verified by running same API on ebay, but for security reason replaced by "xxxxxx".

Thanks a lot!


Token = "xxxxxx"

headers ={"Authorization": "Bearer "+Token,

"X-EBAY-C-MARKETPLACE-ID": 'EBAY_US',

}

EndPoint = "https://api.ebay.com/sell/fulfillment/v1/order?filter=creationdate:%5B2020-12-20}T08:25:43.511Z..%5D";

response = requests.get(EndPoint, headers = headers)


pythonrest api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
carl_mars avatar image
0 Likes"
carl_mars answered ·

Don't know how to delete my post. The answer was simple - response.text expalined the date format was wrong. The removing extra '}' solved the problem.


EndPoint = "https://api.ebay.com/sell/fulfillment/v1/order?filter=creationdate:%5B2020-12-20}T08:25:43.511Z..%5D";

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.