Unable to get access_token: missing grant_type (400)

I know there are a few posts on this topic, already. The fact is that most of them have been left unsolved or they didn’t help, anyway (maybe due to my English).
I’m trying to integrate a custom web app with Xibo, using the APIs.
My first attempt is with curl:
curl -d @data.json -H "Content-Type: application/json" -X POST

The content of data.json is:
{ "client_id": "<clientId>", "client_secret": "<clientSecret>", "grant_type": "client_credentials" }

The response I get is:
{ "error": { "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"grant_type\" parameter.", "code": 400, "data": [] } }

In the CMS->Logs I can read the message

Request for access token using grant_type:

as if the grant_type field was empty.
Then I’ve tried to add a header with Content-Length, or all the headers used by Postman, but the answer is always the same. I’ve tried connecting through a php file, using get_file_contents, or curl, but the answer is always the same.
I don’t know what else I can do and where am I wrong.
Here is my environment:
Xibo CMS 2.3.7 in Docker, fresh install on Ubuntu server 18.04. The CMS listens on port 881, in order to keep it completely separated from the web server on the same machine. This way, I could comment out the CMS_ALIAS=/xibo in config.env. Actually I had to make this change, in order to get an access_token using Postman, which otherwise got the same result, or got the html 404 page (not even a json).

Thank you in advanced for your help.

I can’t understand. Today I have tried to send data as application/x-www-form-urlencoded and the server sent me back the access_token!
I’m almost sure I already tried this without success. But I’ve tried so many times and versions (even changing the order of parameters in the data file), that I cannot be sure of anything.
So, isn’t it possible to pass parameters in json? Or is there anything else I am missing?


The Xibo Community site uses cookies. What are cookies?