API Error - Documentation Needed
API Error - Documentation Needed
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.
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
- formasettigns.PNG (16.43 KiB) Viewed 3643 times
Re: API Error - Documentation Needed
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.
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
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 ?
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
---------------
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology
http://www.joint-tech.com
---------------
Re: API Error - Documentation Needed
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.
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 546 times
Re: API Error - Documentation Needed
Thanks
for sharing your work with the community !!
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
---------------
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology
http://www.joint-tech.com
---------------