Hello,
I’m trying to pull a list of users (https://developers.ringcentral.com/api-reference/SCIM/scimSearchViaGet2) with their phone numbers, however when the list contains multiple users, the phoneNumbers array is omitted. I found this post from a few years ago with a similar question
but it looks like Phong only tested it with a filter on a single user.
Python code for pulling a single user (same result when using the filter param):
queryParams = {
'startIndex': 2,
'count': 1
}
rcsdk = SDK(CLIENT_ID, CLIENT_SECRET, SERVER_URL)
platform = rcsdk.platform()
try:
platform.login( jwt= JWT_TOKEN )
except Exception as e:
sys.exit("Unable to authenticate to platform: " + str(e))
response = platform.get('/scim/v2/Users', queryParams)
print(response.text())
Here is the response for a single user (with info removed):
"Resources" : u {
"schemas" : h "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ],
"id" : "idnumber1",
"meta" : {
"resourceType" : "User",
"created" : "2023-04-18T23:46:41.000Z",
"lastModified" : "2023-04-18T23:46:41.000Z",
"location" : "https://platform.ringcentral.com/scim/v2/Users/idnumber1"
},
"userName" : "user.name1@company.com",
"name" : {
"formatted" : "user name",
"familyName" : "name1",
"givenName" : "user"
},
"title" : "user1 title",
"active" : true,
"emails" : m {
"value" : "user.name1@company.com",
"type" : "work"
} ],
"phoneNumbers" : m {
"value" : "+15555555555",
"type" : "work"
}, {
"value" : "+15555555556",
"type" : "mobile"
}, {
"value" : "5555",
"type" : "other"
} ],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" : {
"department" : "department"
}
} ]
versus when I’m pulling multiple (2+):
queryParams = {
'startIndex': 2,
'count': 2
}
rcsdk = SDK(CLIENT_ID, CLIENT_SECRET, SERVER_URL)
platform = rcsdk.platform()
try:
platform.login( jwt= JWT_TOKEN )
except Exception as e:
sys.exit("Unable to authenticate to platform: " + str(e))
response = platform.get('/scim/v2/Users', queryParams)
print(response.text())
and the corresponding response:
"Resources" : R {
"schemas" : "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ],
"id" : "idnumber1",
"meta" : {
"resourceType" : "User",
"created" : "2023-04-18T23:46:41.000Z",
"lastModified" : "2023-04-18T23:46:41.000Z",
"location" : "https://platform.ringcentral.com/scim/v2/Users/idnumber1"
},
"userName" : "user.name1@company.com",
"name" : {
"formatted" : "user name1",
"familyName" : "name1",
"givenName" : "user"
},
"title" : "user1 title",
"active" : true,
"emails" : {
"value" : "user.name1@company.com",
"type" : "work"
} ],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" : {
"department" : "department"
}
}, {
"schemas" : "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ],
"id" : "idnumber2",
"meta" : {
"resourceType" : "User",
"created" : "2023-04-18T23:46:42.000Z",
"lastModified" : "2023-04-18T23:46:42.000Z",
"location" : "https://platform.ringcentral.com/scim/v2/Users/idnumber2"
},
"userName" : "user.name2@company.com",
"name" : {
"formatted" : "user name2",
"familyName" : "name2",
"givenName" : "user"
},
"title" : "user2 title",
"active" : true,
"emails" : {
"value" : "user.name2@company.com",
"type" : "work"
} ],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" : {
"department" : "department"
}
} ]
Is this intended behavior, or am I doing something wrong? The API reference page’s GET response example for startIndex=1&count=3 shows multiple users along with their phoneNumbers.
Thanks