Skip to main content

We are trying to create a url that a user can select to view a course. The user should not need to be enrolled in the course in order to view the course. We are currently using the Docebo deeplink from the course to create the url,

example url - 'https://xxxx.docebosaas.com/learn/course/568/Week Two - Rep Onboarding?hash=abc12345'. This works for Superadmins regardless of whether or not they are enrolled in the course. For non Superadmins, you need to be enrolled in the course in order for the link to work. Non Superadmins receive a 403 error when selecting the link. We have noticed that if you generate a sharable link from Docebo a non Superadmin can successfully view the course.

A Docebo sharable link has this format 'https://xxxx.docebosaas.com/learn/course/568/Week Two - Rep Onboarding?generated_by=12345&hash=xyz98765'. We need to be able to generate the Docebo sharable link programmatically.

I discovered the Docebo api '/learn/v1/courses/{course_id}/deeplink', it looks like this may work. Has anyone had experience using this api call? Does anyone have other suggestions/ideas?

 

Thank you,

Alan O’Dannel

Hi @alan.odannel this may help

 


Hey @alan.odannel,

Our Product Team, more specifically the Voice of the Customer team, is in development building a feature that will help you to collect this information in a single report. More details on the idea here. It looks like we are targeting Aug/Sept. for the Sandbox release with an Oct. ETA for our general audience.

The API you have called out is one to validate a deeplink. Once a course has the enrollment link option turned on you would send the hash and user ID that you see there in the activation step (from the course properties side).

If successful (200), the response that comes back mainly has the course redirect URL itself.
Something like this...

 


Thank you all for the quick responses. I’ll look into the link that John sent.

Regards,

Alan


Hi @alan.odannel 

I had a similar issue a few weeks ago before I realized that I had not gone into Properties>Advanced Settings>Course Self-Enrollment to ensure that ‘Self-enrollments are available’ was selected. So I suggest that you check this.


Thank you @NateC  for the suggestion. We had checked that setting to confirm that it was set correctly. Based on the feedback from all who responded to my post, we have an idea and we are in the process of testing. I’ll respond with the test results once our tests are complete.


I wanted to bump this because – notwithstanding the fact that enrollment links are largely a workaround for a problem that the New Course Player solves – the original question had been bugging me too.

I think I found a solution, though:

If you make this PUT request to the /learn/v1/courses/{id} endpoint:

{
"deep_link": 1
}

That is enough to ensure that the enrollment link is enabled.

Then, you can find the hash when querying the same endpoint with a GET request (this is an excerpt from the response):

{ 
"deeplink": "xyz98765"
}

(No typos here, by the way: one payload uses “deep_link”, the other uses “deeplink”. ¯\_(ツ)_/¯ )

But that’s only half the solution, right? You also need the generated_by parameter for your enrollment link to work.

So, this doesn’t seem to be documented anywhere, at least as far as I can see, but in my testing, if two different admins make the same GET request from this endpoint, they’ll get two different hash values for the deeplink field. It doesn’t matter who originally enabled the enrollment link.

You should therefore be able to insert the user ID for whichever superadmin’s authorization is being used with the API (let’s follow your example and say that it’s 12345). If you somehow need to fetch this information on the fly, I believe a GET request to the /manage/v1/user/session endpoint should work (again, this is an excerpt from the response):

{
"id": 12345
}

If you want, you can also validate this using the API endpoint that you originally asked about, with a POST request to /learn/course/{id}/deeplink:

{
"hash": "xyz98765",
"generated_by": 12345
}

(Although I have to admit, I’m not entirely sure why this step is ever actually needed/why the validation endpoint exists in the first place.)

Hope this helps someone.


Reply