Skip to main content

Hello everyone!

 

I am using this endpoint: /learn/v1/lo/batch to batch import learning objects into courses. Is it possible to also update learning objects, either through that endpoint or another? When I try to update them via the endpoint mentioned above, I get this error:

Provided Training Material name {name} already exists in course with ID {id}

 

Any help is appreciated. Thank you!

@RobertJonez Hi, Robert … I don’t have any information about your specific question, but I wondered if you could tell me how the api knows where to find your update file. I assume that you have a scorm file or something?

… or does it have to exist in the Central Repository first?


@KMallette - that is one of the challenges he is facing. I see API endpoints to import or insert a LO object but not update.

 

@RobertJonez - I do not see any edits.


@dwilburn Yes, but the return message definitely implies that he’s telling it something …


Hello everyone, thanks for your replies!

 

When hitting this endpoint: /learn/v1/lo/batch

I am sending off a payload that looks like this:

{
"items": :
{
"course_code": {CODE},
"lo_name": {NAME}
"lo_type": "tincan",
"lo_url": {URL},
"lo_external_source_url": {EXTERNAL_URL},
"launch_mode": "new_window"
}
]
}

If there’s no learning object in a course, this works great and adds the LO correctly.

 

However, if I want to edit the url for instance, I get the error message I saw above. There are other batch import endpoints that allows me to update the content if it exists, and I was assuming this would have similar behavior 


@RobertJonez - code looks good, and the error implies that the object exists. This endpoint is for import, not update.

 

API Browser Quick Grabs: Browsing the Browser | Community (docebo.com)


Ah gotcha, so it looks like there’s no endpoint to update a learning object?


@RobertJonez - at least in that endpoint. Like @KMallette mentioned anything that involved updating would require defining that and uploading it. 

A post from @Bfarkas covers an overview of the browser and it more useful capabilities.

API Browser Quick Grabs: Browsing the Browser | Community (docebo.com)

I often start off with Googling and then end up wandering around trying to figure out what I can do.

 


Hello everyone, thanks for your replies!

 

When hitting this endpoint: /learn/v1/lo/batch

I am sending off a payload that looks like this:

{
"items": :
{
"course_code": {CODE},
"lo_name": {NAME}
"lo_type": "tincan",
"lo_url": {URL},
"lo_external_source_url": {EXTERNAL_URL},
"launch_mode": "new_window"
}
]
}

If there’s no learning object in a course, this works great and adds the LO correctly.

 

However, if I want to edit the url for instance, I get the error message I saw above. There are other batch import endpoints that allows me to update the content if it exists, and I was assuming this would have similar behavior 

@RobertJonez  One more small question… could you give me an example of the external_url that you’ve used? How does the API get authenticated to wherever that file is? Does it have to be local? What if it is in an S3 bucket, or on a corp network somewhere?

The whole idea of getting an API to grab information from somewhere has really stumped me and you’re question is the closest I’ve found to an example/answer.


  Thank you for sharing.


is it possible to use the api to make a folder structure inside a course for each course?

So use an empty created course and then through the api make folders inside the course for “structure modules”?

Any help is appreciated


Reply