Page 1 of 1

API Error - Documentation Needed

Posted: Tue Oct 13, 2015 4:52 am
by xenothan
Hi guys!

On Docebo 4.05 the below CURL request works, however on Forma LMS I am getting an "Error: Invalid request."

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lmslocation.com/api/rest.php ... bscription");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array("auth"=>'123@!', "idst"=>$user, "user_level"=>"student","course_id"=>$idCourse));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);

Does anyone know the correct way to approach this or perhaps have an updated API reference manual?

Attached is also a screenshot of the config.

Re: API Error - Documentation Needed

Posted: Tue Oct 13, 2015 5:11 am
by xenothan
I solved the below error.

The correct Call should be:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lmslocation.com/api/rest.php ... bscription");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array("auth"=>'123@!', "idst"=>$user, "user_level"=>"student","course_id"=>$idCourse));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);

Needed to call "q=/api/course/addusersubscription" instead of "q=/restAPI/course/addusersubscription"

A proper API manual would however be awesome.

Re: API Error - Documentation Needed

Posted: Tue Oct 13, 2015 8:02 am
by canelli
Very happy you solved your issue .

next time please insert in post also detail about the error ( in your case "NOT found" ) so all can speed up the help process.

API manual
there are nothing released . why you or anyone in the community does not wrote one ?

Re: API Error - Documentation Needed

Posted: Wed Oct 14, 2015 5:26 am
by xenothan
Thanks Claudio!

I have attached the API reference we created for Docebo 4.05 for anyone that needs it.

But we are writing proper API documentation using http://www.turnapi.com and will also include some code snippets/samples.

I will share once complete.

Re: API Error - Documentation Needed

Posted: Wed Oct 14, 2015 2:49 pm
by canelli
Thanks
for sharing your work with the community !!