The following list of available HTTP response status codes gives an overview of the meaning of each code. For code details per resource, see the REST API reference.
||OK||The resource has been found.|
||Created||The request to create a new item has succeeded. The response
||No Content||The request has succeeded and there is no additional information in the response header or body (for example when publishing or deleting).|
||Moved Permanently||The resource shouldn't be accessed this way. The response
||Temporary Redirect||The resource is available at another URL considered as its main. The response
||Bad Request||The input (payload) doesn't have the proper schema for the resource.|
||Unauthorized||The user doesn't have the permission to make this request.|
||Forbidden||The user has the permission but action can't be performed because of Repository logic (for example, when trying to create an item with an already existing ID or identifier, when attempting to update a version in another state than draft).|
||Not Found||The requested object (or a request data like the parent of a new item) hasn't been found.|
||Method Not Allowed||The requested resource doesn't support the HTTP verb that was used.|
||Not Acceptable||The request's
||Conflict||The request is in conflict with another part of the repository (for example, trying to create a new item with an identifier already used).|
||Unsupported Media Type||The request payload media type doesn't match the media type specified in the request header.|
||Internal Server Error||The server encountered an unexpected condition, usually an exception, which prevents it from fulfilling the request, like database down, permissions or configuration error.|
||Not Implemented||Returned when the requested method hasn't yet been implemented. For Ibexa DXP, most of Users, User groups, Content items, Locations and Content Types have been implemented. Some of their methods, as well as other features, may return a 501.|
A resource's response may contain metadata in its HTTP headers.
For information about the
Allow response header, see the
When a response contains an actual HTTP body, the
Content-Type header specifies what the body contains.
Content-Type header's value is a media type, like with the request
For example, the first following request without an
Accept header returns a default format indicated in the response
Content-Type header, while the second request shows that the response is in the requested format.
When available, the
Accept-Patch tells how the received item could be modified with
The following examples also shows that the format (XML or JSON) is adapted:
1 2 3
1 2 3
Accept-Path headers above indicate that the content could be modified by sending a ContentUpdateStruct in XML or JSON.
Those particular headers generally match a specific list of HTTP response codes.
Location is mainly sent alongside
301 Moved permanently,
307 Temporary redirect responses.
In the following example, the Content item's remote ID 34720ff636e1d4ce512f762dc638e4ac corresponds to the ID 52:
In the following example, an erroneous slash has been added to demonstrate the 301 case:
cURL can follow those redirections. On CLI, there is the
--location option (or its shorthand
In PHP, you can achieve the same effect with
The following command-line example follows the two redirections above and the
Accept header is propagated:
Cross-Origin Resource Sharing (CORS) can allow the REST API to be reached from a page on another domain.
Using CORS isn't limited to REST API resources and can be used for any resource of the platform.
The CORS bundle adds an
Access-Control-Allow-Origin header to the response.
To enable CORS, add regular expression for an allowed domain using the
For example, to allow the JS test above to be executed alongside this page, you could add the following to an
.env file (like the
To add several domains, filter on URIs, or change the default (like not allowing all the methods),
refer to NelmioCorsBundle Configuration Documentation
to learn how to edit
The Response body is often a serialization in XML or JSON of an object as it could be retrieved using the Public PHP API.
For example, the resource
/content/objects/52 with the
Accept: application/vnd.ibexa.api.ContentInfo+xml header returns a serialized version of a ContentInfo object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
The response body XML can contain two types of nodes:
- Final nodes that fully give an information as a scalar value
- Reference nodes which link to
hrefwhere a new resource of a given
media-typecan be explored if you need to know more