-
-
Notifications
You must be signed in to change notification settings - Fork 579
How To Use the RESTful API and Add new Endpoints
-
PHP class helps to retrieve the data from the API natively integrated to pH7CMS
-
If you need to use the API with Java, Swift, Objective-C, please have a look to the PHP class to know how it works and adapt it to another language.
-
For security reasons, to use the API for your website, you need an API key. It can be found in ~/_protected/app/configs/config.ini file (
[ph7cms.api]
private_key
) once you finished the installation of pH7CMS. -
More details about the needed parameters that the API needs to receive for retrieving the data
- You can add new endpoints by adding new methods into the User Controller of the "api" module.
- You can call a method easily like the following for retrieving the data of a specific user (user method)
GET http://YOUR-SITE.com/api/user/user/<ID_NUMBER>/
Replace "YOUR-SITE.com" by your URL and "<ID_NUMBER>
" by the ID of the User.
Finally, don't forget to send the following GET/POST API parameters
-
private_api_key
parameter with your api key as the value (you api key can be found in your ~/_protected/app/configs/config.ini file) -
url
parameter withph7cms.com
as the value
Depending of the API request called, it can be GET or POST