When I run the PHP-code below the response of the API is:
Xibo\OAuth2\Client\Exception\XiboApiException: {
“error”: {
“message”: “Malformed JSON body, rows and uniqueKeys are required”,
“code”: 422,
“data”: []
}
PHP-CODE
$provider = new \Xibo\OAuth2\Client\Provider\Xibo([
‘clientId’ => // The client ID assigned to you by the provider
’clientSecret’ => // The client password assigned to you by the provider
’redirectUri’ => ‘’,
‘baseUrl’ =>
]);
$xiboClient = new \Xibo\OAuth2\Client\Provider\XiboEntityProvider($provider);
$json = ‘{“uniqueKeys”:[“Col1”],“rows”:[{“Col1”: “value1”}]}’;
$jsonParam = json_decode ($json);
$result = $xiboClient->post(’/dataset/importjson/2’, $jsonParam);
The description of the post-function can be found on the following link (line 84):
As you can see the second parameter should be an array. For that i use json_decode ($json); but the API doesn’t accept this format (“Malformed JSON body, rows and uniqueKeys are required”).
Do you have an idea what’s going wrong? Thanks a lot!