Enroll student into a section via Valance API

Answers
-
Hi @Haseeb Ahmad ,
One quick thing that you could try would be to stringify the JSON before you send it. I know there are other routes in Valence that need the JSON to be a string, and not the tangible object.
Let me know if this doesn't work!
-
Hi @Justin Schlumkoski
Thanks for your reply.
I tried to do that and it didn't work, I sent the following:
{\"UserId\":1234}
instead of
{"UserId":1234}
I still get the same Error.
-
Hi @Haseeb Ahmad,
That doesn't look fully stringified. If you're using JavaScript, it would be JSON.stringify({"UserId": 1234}). If you want to do it without a function, try sending this:
"{\"UserId\":1234}".
-
Hi @Justin Schlumkoski ,
Tried with "{\"UserId\":4590}" got the same result. Also I am in c# asp.net environment.
-
Hi there,
I foudn the cause of this issue, I was reading here https://community.brightspace.com/s/article/Recommended-Sequence-for-Creating-Users-and-Enrolling-them-into-Sections and found out for API's we have to enroll them into the offering before enrolling them into the section, once I did that it was able to enroll them with the first method.
Thanks for all your help!
Categories
- All Categories
- 6 Thought Leadership
- 7 Known and Fixed Issues
- 6 Product Roadmap
- 553 Archived
- 10 Accessibility
- 28 Community Corner
- 2 Welcome
- Updates
- Member Spotlights
- 4 Events
- 242 Development
- 746 Customer Enablement
- Evaluate - Assess Student Learning
- Get Comfortable with Brightspace
- Communicate - Engage with Your Students
- 1 Create - Set up your Brightspace course
- Action - Add or create student activities
- 26 Partners
- 8 Product News
- 2022
- 2022 Release Notes
- 2021 Release Notes
- 4 Training
- andycat