It's not possible to change the defaultlayout of a display via the API

I tried to change the defaultlayout of a layout via the API.
But problem is that it sends me an exception: error
Fatal error: Uncaught Xibo\OAuth2\Client\Exception\XiboApiException: { “error”: { “message”: “Page not found”, “code”: 404, “data”: [] } }
however, I sent my message to the correct URL. In this case to / display / default / {displayId}

I need this function and I need help to :wink: please

Could you show me the call you’re using please?

It should be something like that:

image

?envelope=1 is optional, 2 is the displayId, 11 is the layoutId

if this is how you have it in the url, then it would explain the 404, the defaultlayout is one word there.


Sorry, I’m deceiving a screenshot.
Here is the good catch and always sends me a 404

Which CMS version are you using please?
Also could you confirm that displayId 6 exists in your CMS?

CMS version = 1.8.2
I just checked it and displayId 6 exists.
I don’t understand, it’s as if this route didn’t exist

Indeed, it was added in the later CMS version, you’d need to update your CMS version, preferably to the current one ie 1.8.11.

The route was added in March this year, 1.8.2 is from June last year.

1.8.2 is not the current version? it’s the beta so
can’t work with 1.8.2?

so, I downgraded to version 1.8.11 for the XIBO CMS and restart the request but still 404

Hi,

I have the same issue. Currently using 2.0.4 and getting 404.

POST to {{url}}/api/displaygroup/190/action/changeLayout works just fine for the same layoutId/displayId

According to the API description, the defaultlayout call uses PUT instead of POST:
https://xibo.org.uk/manual/api/#/display/displayDefaultLayout

Thank you for the tip, but unfortunately still resulted in a 404.

Perhaps the displayId is incorrect. 404 indicates that the resource requested doesn’t exist. You obviously have successfully acquired access_token from the API, so the API should be working. Most likely the problem lies somewhere with the resource itself. Otherwise I would double-check the url-variable. LayoutId probably isn’t the problem because I believe the error would be different if that were the case, but you should double-check that also.