Hi,
I’m testing some JSON expenses uploads on the sandbox using curl (and the
Oauth Palyground) but I keep getting HTTP 500 errors.
Here’s the curl script I’m using and the response I’m getting:
$ curl https://api.sandbox.freeagent.com/v2/expenses \
-H “Authorization: Bearer TOKEN-GENERATED-FROM-OAUTH-PLAYGROUND”
-H “Accept: application/json”
-H “Content-Type: application/json”
-X POST
-d ‘{“expense”: {“category”:
“https://api.sandbox.freeagent.com/v2/categories/XXXXX”, “dated_on”:
“2013-07-15”, “user”: “https://api.sandbox.freeagent.com/v2/users/XXX”,
“gross_value”: 108.99, “description”: “Overnight Subsistence”}}’
500 Internal Server Error
If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.I checked the JSON at jsonlint.com and it validates fine. I’ve also double
checked the categories and users (removed here).
The token is fine too because I can successfully get the company data…
$ curl https://api.sandbox.freeagent.com/v2/company -H “Authorization:
Bearer TOKEN-GENERATED-FROM-OAUTH-PLAYGROUND” -H “Accept: application/json”
-H “Content-Type: application/json” -X GET
{“company”:{“url”:“https://api.sandbox.freeagent.com/v2/company",“name”:“SomeTestCo”,“subdomain”:“SomeSubDomain”,“type”:“UniversalCompany”,“currency”:“EUR”,“mileage_units”:“km”,“company_start_date”:“2013-01-01”,“freeagent_start_date”:“2013-01-01”,“first_accounting_year_end”:“2013-12-31”,“sales_tax_registration_status”:“Registered”,“sales_tax_name”:“VAT”,“sales_tax_registration_number”:“1234567”,“sales_tax_rates”:[“23.0”,“13.5”,“0.0”],“sales_tax_is_value_added”:true,"supports_auto_sales_tax_on_purchases”:false}}
Has anyone got suggestions as to what could be triggering the 500 error.
Even running curl in verbose mode doesn’t offer much more information
except that the data is being uploaded successfully.
Thanks,
Patrick