Hi there,
I’m having trouble creating an expense via API. Getting an error when
running this httpie request:
http POST "https://api.freeagent.com/v2/expenses" "Authorization:
Bearer $access_token" user="https://api.freeagent.com/v2/users/11111"
dated_on="2019-01-24" description="Test" gross_value="10.00"
category="https://api.freeagent.com/v2/categories/285"
HTTP/1.1 422 Unprocessable Entity
{
“errors”: [
{
“message”: “category can’t be blank”
}
]
}
I’ve also tried as specified by the documentation to send a root
object expense, but whe I do that I get a different error:
http --form POST "https://api.freeagent.com/v2/expenses"
"Authorization: Bearer $access_token"
{"expense": {"user":"https://api.freeagent.com/v2/users/11111","category":"https://api.freeagent.com/v2/categories/365",gross_value="10.00","dated_on":"2019-01-24","description":"Test"}}
HTTP/1.1 400 Bad Request
{
“errors”: {
“error”: {
“message”: “Expense or expenses data required”
}
}
}
Any help would be appreciated!