Forum Discussion

benjamingray's avatar
benjamingray
Contributor
12 years ago

How should I combine multiple REST calls that each set a value on a user's profile?

I have no problem making a call to set a single value of a user profile. I'm wondering though, if I can combine all those set calls -5 to 16 of them- and what the best method for setting multiple values would be. (The community I'm developing for has a series of custom profile fields.)

  • Hi benjamingray,

     

    It sounds like an endpoint might be a good fit for what you'd like to do. You could create an endpoint that would consume the parameters and values that you want to set, and then make the necessary REST API calls within the endpoint. That way you'd only have to make a single request to the endpoint.

     

    I'd definitely urge you to be cautious in how you implement the endpoint though. You'll want to take steps to secure it from improper use, to ensure that others aren't mailiciously changing user profile values. For example, check that the user attemtping to access the endpoint is an Administrator, or at least the same user whose settings you're trying to change if you're going to be making the request as the users themselves..

     

    You can learn more about endpoints here:

    http://lithosphere.lithium.com/t5/developers-knowledge-base/Working-with-Lithium-Studio-Endpoints/ta-p/60240

     

    If your community doesn't already have endpoints enabled, you can file a case and our Support team will help you with the next steps of getting it enabled..

     

    I hope this helps!

     

    -Adam

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi benjamingray,

     

    It sounds like an endpoint might be a good fit for what you'd like to do. You could create an endpoint that would consume the parameters and values that you want to set, and then make the necessary REST API calls within the endpoint. That way you'd only have to make a single request to the endpoint.

     

    I'd definitely urge you to be cautious in how you implement the endpoint though. You'll want to take steps to secure it from improper use, to ensure that others aren't mailiciously changing user profile values. For example, check that the user attemtping to access the endpoint is an Administrator, or at least the same user whose settings you're trying to change if you're going to be making the request as the users themselves..

     

    You can learn more about endpoints here:

    http://lithosphere.lithium.com/t5/developers-knowledge-base/Working-with-Lithium-Studio-Endpoints/ta-p/60240

     

    If your community doesn't already have endpoints enabled, you can file a case and our Support team will help you with the next steps of getting it enabled..

     

    I hope this helps!

     

    -Adam