Simple API call getting "400 Bad Request"
I'm not sure why a GET: https://mytest.brightspace.com/d2l/api/lp/1.42/users/myuser returns a 400 Bad Request (Missing or invalid parameters)
I'm following this format:
any ideas?
jji
Answers
-
There is no such API call, as
myuser
is not a valid D2LID for a user (the API call you’re using expects to identify the user with a D2LID identifier: a number for the user’s D2L identifier).
You’re getting a 400 most likely because Brightspace is attempting to bind themyuser
part of the API call as a D2L identifier and, as it’s not a number, you’re not simply getting a “404”. The API route does exist; however, you’re providing a bad input parameter (theuserId
) and this results in the error you’re seeing. -
Thanks, now I see that I have to use a result control parameter like this:
/lp/1.42/users/?UserName=myuser