API Error - Documentation Needed

Install and configure FormaLMS and DoceboCE
Post Reply
xenothan
Newbie
Posts: 10
Joined: Sun Jan 20, 2013 3:27 am

API Error - Documentation Needed

Post 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.
Attachments
Forma settings
Forma settings
formasettigns.PNG (16.43 KiB) Viewed 616 times
Xenothan Hojem
Jetweb (Pty) Ltd
http://www.jetweb.co.za/

xenothan
Newbie
Posts: 10
Joined: Sun Jan 20, 2013 3:27 am

Re: API Error - Documentation Needed

Post 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.
Xenothan Hojem
Jetweb (Pty) Ltd
http://www.jetweb.co.za/

User avatar
canelli
FormaLms Guru
Posts: 490
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: API Error - Documentation Needed

Post 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 ?
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------

xenothan
Newbie
Posts: 10
Joined: Sun Jan 20, 2013 3:27 am

Re: API Error - Documentation Needed

Post 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.
Attachments
Docebo REST API Documentation.pdf
REST API Documentation
(40.41 KiB) Downloaded 71 times
Xenothan Hojem
Jetweb (Pty) Ltd
http://www.jetweb.co.za/

User avatar
canelli
FormaLms Guru
Posts: 490
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: API Error - Documentation Needed

Post by canelli »

Thanks
for sharing your work with the community !!
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------

Post Reply