I'm working on a project where we plan to send some data back to Desire2Learn. I've gotten pretty far, I can query the user list, I can get their profile id, get their profile, and then update said profile.
I noticed when looking through the documentation, that I if I call /d2l/api/lp/1.3/users/?OrgDefinedId=123456789
it returns just that one user as seen below.
[
{
"OrgId": "{{ORG_ID}}",
"UserId": 12345,
"FirstName": "Christopher",
"MiddleName": null,
"LastName": "Sterling",
"UserName": "csterli1",
"ExternalEmail": "{MY_EMAIL}",
"OrgDefinedId": "123456789",
"UniqueIdentifier": "{{UID}}",
"Activation": {
"IsActive": true
},
"DisplayName": "Chris Sterling"
}
]
The problem, I believe, that I've ran into is that in order for me to get the Profile ID, I can't call the url above, but instead, I have to call /d2l/api/lp/1.3/enrollments/orgUnits/{{ORG_ID}}/users/
. That call there returns the Profile ID, but it also returns all users, in increments of 100.
What I am wondering is if there is a way that I can pass the ?OrgDefinedId to the enrollments method and have it return the user object?
If that isn't the case, I'm wondering, is there a better way to do what I am trying to do. It currently seems like I am going to be making a large number of calls to get all our users so we can get their profile id for a given user.
Thanks!
There is not currently a better filter on the enrollments calls, nor does the profile identifier appear in the administrative user data record returned from the .../users/
calls.
The GET classlist for orgunit call also returns data containing user profile identifiers, and it returns data in a JSON array rather than a paged set. The Enrollment.ClasstlistUser structure contains the LMS UserId (Identifier
) and user profile ID (ProfileIdentifier
) data and can also contain the OrgDefinedId
property. In order to get back that last data, though, your LMS must be configured to provide org-defined IDs in the Classlist tool. If it's not, then to make the union between profile identifiers and org-defined identifiers, you'll need to use the LMS UserId as the common value, and make a series of calls to get back two data sets you can join together.