-
Notifications
You must be signed in to change notification settings - Fork 19
Ximdex CMS API: Introduction
This part of the Ximdex's wiki is focused on describing the Ximdex API released with the new version 3.5 of Ximdex CMS. Reading this you will understand how this API works and how to interact with Ximdex CMS building your own API clients.
Some knowledge about Ximdex CMS and its terminology is required, therefore we recommend you to read the Ximdex CMS Interface Manual if you need additional information about it.
To query the Ximdex API you need a Ximdex CMS instance installed on an accessible server. You can download it from this repository here.
For the installation process a system console or terminal is required to follow the steps given in the XIMDEX_INSTALL.sh file.
Previously, you need to install and configure the PHP curl extension on your server. It comes by default since PHP 4.0.2, so the usually task is only to enable this extension in the php.ini configuration file of your server.
To provide additional security in the connection between your API client and Ximdex CMS, you need to configure three parameters on the database, more specifically, into the Config table.
These parameters (the database fields have the same name) are:
- TokenTTL: time in minutes that the session will last. By default is set to 30 minutes.
- ApiKey: string that identifies your API clients during your session. It's used to generate the API token (called ximtoken) needed to query the Ximdex API. By default it's empty.
- ApiIV: initialization vector returned by the AES algorithm. By default it's empty.
The ApiIV and ApiKey values are obtained executing an openssl command, so you should first install it if it's not already installed on your operative system.
The steps to generate both the ApiKey and ApiIV values are the following:
- First, execute this command into your system console:
openssl enc -aes-128-cbc -k "MY_SECRET_PHRASE" -P -md sha1
being MY_SECRET_PHRASE a string or sentence invented by you. Write down the iv and key values returned.
- Then, update this values into the proper database fields. You would need the user and password to access to the Ximdex CMS's database. Remember that you can find them into the install-params file inside the /conf folder.
UPDATE Config SET ConfigValue='key_value' where ConfigKey='ApiKey';
UPDATE Config SET ConfigValue='iv_value' where ConfigKey='ApiIV';
being key_value and iv_value the values annotated in the first step.
And that's all. The Ximdex API is now ready to be queried by any API client.