Users extended by role(s) vs. Users by role(s) - returning different data

Hello all,

I am noticing I get different # of responses based on calling users extended by role(s) vs. users by role(s). Extended is giving me 2 more students than the standard users.

Here is my Core Roles output for Student - no other roles have a base_role_id of 14:

{
"id": 60473,
"base_role_id": 14,
"hidden": false,
"name": "Student"
}

https://api.sky.blackbaud.com/school/v1/users?roles=60473 returns 744 students

https://api.sky.blackbaud.com/school/v1/users/extended?base_role_ids=14 - returns 746 students (the correct number)

The 2 missing students do not appear to be any different than the rest of the students.

Any idea what could be going on here?

Thank you!

Andrew

Comments

  • Todd DeSchuiteneer
    Todd DeSchuiteneer Blackbaud Employee
    Tenth Anniversary Kudos 2 Name Dropper Participant

    @Andrew Teets definitely a curious situation. If you could report the issue to our support team with the details you provided above along with 2 student's information that seem to be missing from the users by role call, we'll be happy to look into it.

  • @Todd DeSchuiteneern Thank you - will do!

    :) Andrew

  • @Todd DeSchuiteneer I have a similar issue with how the API was designed. Support shared with me that API places data in the blocks based on the order of entry. I share with support this is not a good design. Example I am looking to map mobile phone numbers to a field and sometimes the mobile phone is in section block 1 or block 2 or block 3. I shared with support an API should always return the same position and field names. I am using the user extended by role.

  • Jared Harbour
    Jared Harbour Blackbaud Employee
    Eighth Anniversary Kudos 1 Name Dropper Participant

    @Natasha Rodriguez Unfortunately each user may have a different order for any records depending on when the records were added. In the case of phone numbers, some users may have multiple entries, while some users have one or even none. If an API were to be designed to allow for something like “Home phone = block 1” and “Mobile phone = block 2” that would require every user to have large amounts of empty records returned for them, which slows down transmission and makes it harder to use the API to get the actual data on the receiving end.

    It's because of this that most APIs supply a type parameter for many objects like phone number records. By looping through the list of phone numbers for a user and looking for the type you want to find, you will always get the data you want. The following is an example of what I mean:

    foreach(var user in userExtendedRecords)
    {
    //loop through the user phone records
    foreach(var phone in user.Phones)
    {
    if(phone.PhoneType == "Hone")
    {
    //we found a home phone!
    }
    if(phone.PhoneType == "Mobile")
    {
    //we found a mobile phone!
    }
    }
    }

    I hope this helps!

Categories