I’m trying to create a job from a Python app and I’m getting a 500 but the same request in Postman is working. The URL I’m using is https://api.sandbox.stuart.com/v2/jobs/ and he payload is:
After reviewing your case we have found out that you submitted just part of your job from the Python app, the following JSON I am able to see in our logs from your side with this server error (500):
{
"job": "dropoffs"
}
Please make sure you put the entire job when you submit from your Python app.
Let me know in case you face another such example.
Thank you very much for the quick response. It was actually a mistake on my end as I was using the aiohttp library and using the data arg instead of json.
I’m facing a similar issue with the cancel order endpoint. Basically I am:
Creating an order (in postman) OK
Getting the order details to confirm status is “searching” (in postman) OK
Cancel job via Python app and I’m getting a 500 ERROR
Getting the order details again and the status has been updated to “cancelled” (in postman) OK
I am a bit confused by the fact that the call is returning an error but it seems to be working as the status gets updated? Any help would be very much appreciated.
I have reviewed the cancellation requests from your side and I confirm that you have successfully canceled the Jobs - where you received 204 No Content - this number code reflects a successful response.
At that stage, I can not find any logs which we are getting “500 error” from your side.
All looks good for now on your Sandbox account with canceling the Jobs.
Thank you again for your quick and helpful response. Apparently the issue happened when I was trying to decode the response into json, but aiohttp was failing to do so because there’s no content-type: application/json header in the response. Is there any reason for that?
Sorry I didn’t get that you were talking about the cancellation endpoint.
For this one, that’s totally normal, as the response does not contain any json, because of the 204 No Content response code.
You can find the list of headers in our documentation if you have a doubt.