Forum Discussion

ryanplant-au's avatar
9 years ago

Can I get multiple users from a single call?

I'm using the /users/email endpoint to search for users based on their email address. Sometimes, I have reason to search for 20, 50, 100 users this way at a time. Is there a way I can issue a single call that searches for multiple email addresses and returns multiple userprofiles?

1 Reply

  • Hi ryanplant-au,

     

    the REST call you're using returns only one object per request which makes sense, because an e-mail adress can only be used once within your community.

     

    To achieve your requirement you should think about using an endpoint to build a list of user profiles. Therefore you may implement a custom component where you store/create a list of e-mail adresses as your parameter. This parameter will be passed to your endpoint.

     

    The endpoint itself iterates through the list of e-mail adresses and requests the REST API. Finally, you could condense all responses (the user profiles) to a single object (e.g. JSON) and return this object to your custom component.

     

    Hopefully, this approach helps to fulfill your requirement.

     

    Best regards,

    Christian