What I do
I'm really confused about the following.
- I'm logged in via Exact Online oAuth2 (works)
- I'm redirected to the set redirect url (works)
- Now, I'm doing a POST request for creating an CRM Account to
https://start.exactonline.com/api/v1/1645882/crm/Accounts
with headers:
- Authorization: Bearer MY_TOKEN
- Content-Type: application/json
with json data:
{
"Name": "James Fellows",
"Code": "JF"
}
Code (simplified)
$this->client->request('POST', 'https://start.exactonline.com/api/v1/1645882/crm/Accounts', ['headers' => ['Authorization' => 'Bearer MY_TOKEN']], ['json' => json_encode(['Name' => 'James Fellows', 'Code' => 'JF'])]);
Problem
And now the problem. I always get this error:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">\r\n
<code></code>
<message xml:lang="">Error processing request stream. JSON text specified is not valid.
</message>
</error>
Documentation
I used the following api documentation: