Skip to content

getUserList

The getUserList interface is used exclusively with the server-side call logging feature to assist in mapping RingCentral user identities to their corresponding identity within the connected CRM or application. This ensures that the notes created by the server-side call logging framework are assigned to the correct owner in the CRM so that attribution is accurate and that user can also edit the notes created on their behalf.

App Connect will call this endpoint when server-side call logging is enabled, and periodically after that to keep systems in sync. It will then systematically call the getUserInfo interface to attempt to map it to a RingCentral user via their email address.

Any identity that is not successfully mapped using this method can be mapped manually by admins using the user mapping feature.

Request parameters

None.

Return value(s)

This interface returns an array of users in the connected CRM or application. Each user record should contain the user's ID, name and email address.

Example

[
  { 
     'id': '123',
     'name': 'Luke Skywalker',
     'email': 'luke@jedicouncil.org'
  },
  { 
     'id': '456',
     'name': 'Han Solo',
     'email': 'han@rebelalliance.gov'
  }
]

Reference

async function getUserList({ user }) {
    const queryWhere = 'isDeleted=false';
    const searchParams = new URLSearchParams({
        fields: 'id,firstName,lastName,email',
        where: queryWhere
    });
    let start = 0;
    let userInfoResponse;
    const userList = [];
    // use max loop counter just in case while loop goes forever
    const maxLoop = 500;
    let loopCounter = 0;
    do {
        loopCounter++;
        userInfoResponse = await axios.get(
            `${user.platformAdditionalInfo.restUrl}query/CorporateUser?start=${start}&${searchParams.toString()}`,
            {
                headers: {
                    BhRestToken: user.platformAdditionalInfo.bhRestToken
                }
            }
        );
        start = userInfoResponse?.data?.start + userInfoResponse?.data?.count;
        if (userInfoResponse?.data?.data?.length > 0) {
            for (const user of userInfoResponse.data.data) {
                userList.push({