Skip to content
Yannick Warnier edited this page Jan 25, 2024 · 9 revisions

There are different types of web services in Chamilo 1.11 (and 2.0), and they are not necessarily all well documented or very logically distributed, so here is an attempt at documenting them as well as possible.

By default, web services available for 1.11.x versions and earlier should also work in version 2.0 and later, but their distribution might change a little.

First, let's have a small type of FAQ to get you in the right direction...

FAQ

Where to find them?

Chamilo web services can be found in the main/webservices/ directory.

What type of web services do you support?

Because of our long history and variety of integrations, we support a few XML-RPC services (and let's not talk about these if you don't need them, as they are written in Python), but most are either SOAP or REST.

What authentication mechanism(s) do you use?

This depends on the type of web service:

SOAP authentication

SOAP web services use a weird type of shared secret key + IP address in a hash. Typically, from the client side, you would take the $_configuration['security_key'] parameter from your configuration.php file, then call https://chamilo-host/main/webservices/testip.php to get your IP as the server sees it ($ip), and then build the final "secret_key" parameter as this formula: $secretKey = sha1($ip.$_configuration['security_key']). The server will then check that this matches the IP and security key it has. If not, the web service call will fail.

REST authentication

For the REST web services, the authentication is a bit more streamlined. You send a parameter (in POST, GET, or COOKIE) called "hash". This hash usually contain an array of the following elements:

  • action
  • username
  • api_key
  • course (optional)
  • session (optional)

If you don't have an API key (which is specific to the username), don't worry, you can also use the user's password to call the "authenticate" web service, that will return an API key for you to use in subsequent web service calls (as "api_key" parameter).

Where can I find a list of web services and their responses ?

Clone this wiki locally