Skip to main content
Question

Learning Object APIs


msantos
Helper II
Forum|alt.badge.img+2

Hello All.  We are development  a tool to upload a courses historic (process migration). We have a problem to update a Learning Object historic. 

I verified in the API documentation, “lo_completion_date” is the API to update a Learning object completion date,  and “score” is the API to update a Learning object score.

When I processed, the API lo_completion_date was not found. I changed to “completion_date”, the tool run, but update the learning object completion date with the processed date, not a date to informed.

And the score was not updated.

So, I want to know, witch API I have to use to update Learning object completion date and Learning object score.

Thanks.

 

 

10 replies

Bfarkas
Hero III
Forum|alt.badge.img+5
  • Hero III
  • 3582 replies
  • April 26, 2022

Can you post the actual url and any body information you were trying that wasn’t working? Makes it easier to look for issue over starting from scratch. 


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • April 26, 2022

Hi, I used the API

Batch insert of Tracking for Learning Objects

 

/learn/v1/lo/tracks/batch

{
  "items": [
    {
      "username": "string",
      "course_code": "string",
      "lo_name": "string",
      "lo_code": "string",
      "lo_user_status": "string",
      "lo_type": "scorm",
      "lo_completion_date": "2022-04-25",
      "lo_score": 0,
      "lo_filename": "string",
      "timezone": "string"
    }
  ],
  "options": {
    "timezone": "string"
  }
}

Jason syntax:

 

[{"username":"jorge.amado@kolabori.com","course_code":"LW_194_Conteudo","lo_name":"Portal do RH - Colaborador","lo_user_status":"completed","lo_type":"Scorm","lo_completion_date":"2022-03-25","lo_score":"100","timezone":"America\/Sao_Paulo"},{"username":"zelia.gatai@kolabori.com","course_code":"LW_194_Conteudo","lo_name":"Portal do RH - Colaborador","lo_user_status":"completed","lo_type":"Scorm","lo_completion_date":"2022-03-02","lo_score":"100","timezone":"America\/Sao_Paulo"},{"username":"machado.assis@kolabori.com","course_code":"LW_194_Conteudo","lo_name":"Portal do RH - Colaborador","lo_user_status":"completed","lo_type":"Scorm","lo_completion_date":"2022-03-02","lo_score":"100","timezone":"America\/Sao_Paulo"},{"username":null,"course_code":null,"lo_name":null,"lo_user_status":null,"lo_type":null,"lo_completion_date":null,"lo_score":null,"timezone":null}]

 

After the jason process:

invalid parameters: lo_completion_date 

{"data":[{"row_index":0,"success":false,"message":"Parâmetro inválido: lo_completion_date"},{"row_index":1,"success":false,"message":"Parâmetro inválido: lo_completion_date"},{"row_index":2,"success":false,"message":"Parâmetro inválido: lo_completion_date"},{"row_index":3,"success":false,"message":"Parâmetro inválido: lo_name, lo_code, username, course_code, lo_user_status, lo_type"}],"version":"1.0.0","_links":[]}

 

 


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • April 26, 2022

So, I do not know why the system informed “ Invalid parameter” if I put the correct information “ lo_completion_date.

 

Any idea?

 


Bfarkas
Hero III
Forum|alt.badge.img+5
  • Hero III
  • 3582 replies
  • April 26, 2022

Hmm, when I try it here I get incorrect timezone, the date goes fine. I wonder, is your system set to a different date format for that?


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • April 26, 2022

Thank you. Let me verify, and I inform you.


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • April 26, 2022

Hello, I found the problem. I set in the LMS - advanced settings → date & time the date format YYY-MM-DD HH:MM:SS.

I run the job with success.

BUT, the completion date was updated with TODAY date, not a date informed in the json syntax.

 

Can you help me with this second problem?

 

 


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • April 27, 2022

Hello, After many tests and Docebo´s support personal I understand the problem:

First, the API documentation is not up to date.

course_code": "string",
      "lo_name": "string",
      "lo_code": "string",
      "lo_user_status": "string",
      "lo_type": "scorm",
      "lo_completion_date": "2022-04-25",
     

 
In the LMS we do not have a Learning object  code. It will be better to have it, instead of learning object names.
The date format is YYYY-MM-DD HH:MM:SS -> 2022-04-25  04:00:00
 
“During the API call, we are only setting the completion date for the Learning Object and not the Course. The Course completion date would need to be updated separately from the Learning Object Completion date.
My suggestion would be to update the Course Completion date for the Users in question and then run the API call to update the Learning Object Completion date. Since the Course has already been marked complete and has a date associated with it, it would not default to today's date and would keep the same value as was previously entered.” Docebo´s Support.

Bfarkas
Hero III
Forum|alt.badge.img+5
  • Hero III
  • 3582 replies
  • April 28, 2022

AH, you were talking about course completion date, thought it was just the LO.

Good note for most though, the direct support folks are pretty good at sorting out API issues when trying them and finding incorrect documentation or recommend proper endpoints, almost always start there when I think I’m crazy for something not working.


elamast
Hero I
Forum|alt.badge.img+5
  • Hero I
  • 245 replies
  • May 11, 2022

This same endpoint (/learn/v1/lo/tracks/batch)  has been giving us fits lately.  This error comes up when we update a “test” type of LO (as opposed to your SCORM example):  Error defined as: "0 Training Materials found with provided data". 

We have an open ticket if you need to reference: https://help.docebo.com/hc/en-us/requests/214352


msantos
Helper II
Forum|alt.badge.img+2
  • Author
  • Helper II
  • 105 replies
  • May 11, 2022

I have found that there is a batch limitation of around 300 records on this endpoint. If you need to process more records, you need to split it.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings