Hello, i'm trying to use the api, for every request i get the same reponse.
This is one example of request
url: https://panel.cloudhotelier.com/api
Post with the json
{
"request" :
{
"app": "Appid",
"secret": "Token",
"log": 153139435922.59,
"task": "inventory_get",
"data": {}
}
}
I always get the same response
{
"request": null,
"response": "HRS Manager Api",
"errors": {
"errors": [],
"warnings": [],
"notices": []
}
}
What am i missing?
Thanks
Xavier Pallicer July 13, 2018
Please note the JSON must be sent in a post with a variable called "request", take a look:
https://github.com/cloudhotelier/api/blob/master/basics.md
Regards!
Gard July 17, 2018
Hello again
i'am using post and the json has a request.
POST /api/ HTTP/1.1
Host: panel.cloudhotelier.com/api/
Content-Type: application/json
{
"request" :
{
"app": "appid",
"secret": "appsecret",
"log": 153139435822.59,
"task": "inventory_get",
"data": {}
}
}
do you see anything wrong on the request?
Xavier Pallicer July 18, 2018
Please take a look at our docs:
The important part is this one:
`LOPT_POSTFIELDS, http_build_query(['request' => json_encode($request)]));``
request is a post field containing json encoded data. If you show us the rest of the code you'll get better help..