Skip to main content
Best Answer

API: Add Course to Learning Plan - what is "assignment" parameter?

  • April 9, 2025
  • 3 replies
  • 51 views

markbrumley
Novice III

Hi!

Using the API endpoint post   /course/v1/courses/{course_id}/lp  to add a learning plan to a course. Yes, that seems backwards. I am asked for the assignments parameter. I thought that was the course ID but that doesn’t work. Can someone help?
 


Thank you!

Mark

Best answer by rterakedis

@markbrumley - Not exactly familiar with this particular API, but looking at API browser I do see that the assignments are specified to be part of the body, and should be part of an array.  So, you need to remove that query param in Postman, and instead add the following JSON under the “body” tab (select the “raw” format):

{
  "assignments": [
    12
  ]
}

 

Hopefully that helps!

 

3 replies

  • Helper I
  • Answer
  • April 10, 2025

@markbrumley - Not exactly familiar with this particular API, but looking at API browser I do see that the assignments are specified to be part of the body, and should be part of an array.  So, you need to remove that query param in Postman, and instead add the following JSON under the “body” tab (select the “raw” format):

{
  "assignments": [
    12
  ]
}

 

Hopefully that helps!

 


Forum|alt.badge.img+1
  • April 10, 2025

Hi Mark,

The assignment ID is the learning plan ID you want to add the course to. ​@rterakedis is correct that this needs to be included in the body, unlike the course_id which is included as a URL param. The assignments array in the body is required for this call.

 

 


markbrumley
Novice III
  • Author
  • Novice III
  • April 10, 2025

Thank you @rterakedis and @mstrom! Worked like a charm!