webservices api latest - chamilo/chamilo-lms GitHub Wiki
Introduction
In Chamilo 2.0, we are using API platform as an underlying layer to help us maintain webservices in better order than in previous versions.
Regarding previous versions of webservices
To be added
Endpoint
The endpoint now is very easy to get to: simply use your Chamilo portal's URL and add "/api" to the end of the root URL. For example: https://2.chamilo.org/api If the technical documentation provided on the endpoint (through a web browser) is not enough, at the bottom of that page, you will find links to other formats of documentation or practice links.
Authentication
First you need to get an authentification token using your username and password like this :
curl -X POST --location "https://YOURCHAMILOPLATFORM/api/authentication_token"
-H "Content-Type: application/json"
-d "{ \"username\": \"YOURUSER\", \"password\": \"YOURPASSWORD\" }"
You will get the token in the answer like this :
{"token":"eyJ0eXAiOiJKV1QiLCJ[...]h7MfgKhuAyBUgPLzsoCDMeWNtDyNknM5Hj1_j6gbDqQtfY0AdJJ7FhKzUwdornFGRTfgj_jyoP6MbEU8aBHELe3DjT9NA"}
Then you will be able to call the webservice needed using this token like this : curl -X 'POST' 'https://YOURCHAMILOPLATFORM/api/advanced/create-user-on-access-url' -H 'accept: application/ld+json' -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJ[...]h7MfgKhuAyBUgPLzsoCDMeWNtDyNknM5Hj1_j6gbDqQtfY0AdJJ7FhKzUwdornFGRTfgj_jyoP6MbEU8aBHELe3DjT9NA' -H 'Content-Type: application/ld+json' -d '{ "username": "ana.luna", "firstname": "Ana", "lastname": "Luna", "email": "[email protected]", "password": "securepass456", "accessUrlId": 1, "locale": "fr", "timezone": "Europe/Paris", "status": 3 }'
Changelog
This changelog starts pre-alpha for v2.0, on 2024-01-18. Any change that affect the API are reported here.
Note: version 3.0.0 of the web services will only be coined on the date of the Chamilo v2.0 stable release, which has not happened yet.
| Date | API version | Description | Commit |
|---|---|---|---|
| 2024-01-18 | v1.0.0 | Starting point | 173e359b |