-
Notifications
You must be signed in to change notification settings - Fork 19
Ximdex CMS API: Description
The Ximdex API allows to perform some actions onto Ximdex CMS (like query for information on channels and nodetypes, create new documents, publish them, etc) without using the Ximdex CMS web user interface. Through Ximdex API you can efficiently create and manage a large amount of data, automating repetitive actions usually done using the Ximdex CMS UI.
The Ximdex API is queried using a terminal or the system console. Ximdex CMS usually runs on linux-like servers, so this applications are very usual on these kind of operative systems.
In the following sections, the word _my_server _refers to your web server's root directory and ximdex would be the name of your Ximdex CMS instance. Just change this two parameters for your convenience. For example:
http://my_server/ximdex/
could be, depending on your own configuration, this:
http://example.org/ximdex-3.5/
or
http://localhost/ximdex35/
All the requests that Ximdex API handles have a similar format:
curl -X HTTP_M REQUEST_URI
where:
- HTTP_M: They are the http methods: GET or POST. The actions provided by the Ximdex API can be requested using anyone of them. Right now it doesn’t matter if the request is made using GET or POST. You only must add the parameters in the correct way depending on the http method selected:
- if POST method:
curl -X POST --data "PARAMS" http://my_server/ximdex/api/action[/method]
- if GET method:
curl -X GET "http://my_server/ximdex/api/action[/method]?PARAMS"
- PARAMS: could be the specific values that the action needs to perform correctly the request. The order of the different parameters could be any.
- action: would be any action described in section 2.3. Optionally, an action could have one or more methods.
All the remaining parts of the request will be permanent.
The responses to requests to the Ximdex API are JSON strings. They contain whether an error occurred or not (field error) and the specific data returned for the requested action.
A response without errors would be:
{"error":0,"data": OBJECT}
where:
- error: 0, indicates that there hasn't been any error.
- data: Object (array, json or string) containing the response data of the requested action. The content of this field is specific on the requested action.
A response with an error would be:
{"error":1,"message":"Error message"}
where:
- error: 1, indicates that there has been an error.
- message: string, containing the error message.