Skip to content

getUserList

Optional interface

If this interface is implemented, "User mapping" feature would be provided on Server-side call logging page.

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

Key Value
user An object describing the Chrome extension user associated with the action that triggered this interface.
authHeader The HTTP Authorization header to be transmitted with the API request to the target CRM.

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

  // Used to get user list for server-side call logging user mapping
  async function getUserList({ user, authHeader }) {
      //--------------------------------------
      //--- TODO: Add CRM API call here ------
      //--------------------------------------
      // const userListResponse = await axios.get('https://api.crm.com/users', {
      //     headers: {
          //         'Authorization': authHeader
          //     }
          // });
          const mockUserListResponse = {
              data: [
                  {
                      id: 'testUserId',
                      name: 'Test User',
                      email: 'test@example.com'
                  },
                  {
                      id: 'testUserId2',
                      name: 'Test User 2',
                      email: 'test2@example.com'
                  },
                  {
                      id: 'testUserId3',
                      name: 'Test User 3',
                      email: 'test3@example.com'
                  }
              ]
          }
      return mockUserListResponse.data.map(user => ({
          id: user.id,
          name: user.name,
          email: user.email
      }));
  }

  module.exports = getUserList;
            }
        };

    }
    catch (e) {
        return {
            successful: false,
            returnMessage: {
                messageType: 'warning',
                message: 'Could not load user information',
                details: [
                    {
                        title: 'Details',