Forum Discussion

raguv12ps's avatar
4 years ago

Automate Endpoint

I'm trying to run an endpoint automatically to assign roles to users in community by communicating with salesforce through Rest API. It uses the users community email to fetch appropriate roles from salesforce for assignment.

I had a few questions

1)Can we automate endpoint on server end (Fetches all users through lithium api and update user role in  batches).
2)I recently came across sign in event in community, I thought to add all calls to salesforce on Page Init script for assigning roles (Individual user data update on event trigger). But I was worried that the user can check "Keep me signed in" which bypass the sign in event.

Please let me know if there is any way I can achieve this functionality.

5 Replies

  • I believe there is a cron style "batcher" available to Khoros Professional Services or maybe Support if you're lucky 🙂 which you can kindly request your endpoint to be hit every 5 minutes or whatever period you choose.

    The event subscription model would be a better approach but I think you are correct in that "keep me signed in" bypasses UserSignOn events. but I could be mistaken.. 

  • cblown Thanks for the response. 
    I think I'm going to create an external Trigger in salesforce to hit the community endpoint through Rest Services.

    The endpoint function is to retrieve all users and assign roles, The count is 308678 users and I'm not sure if there would be a timeout on endpoint before the operation completes. 

  • You’ll definitely have to batch / throttle those calls and also best confirm if there is any associated costs / limit / cap on Api / endpoint calls. (License wise) 

  • cblown I decided to run this on each user login, so we can remove the batch process which has some serious limitations.

    Instead of adding the logic in Page init script which can slow performance on each page load, I added a custom component inside the main header (Added on all pages) and triggered an ajax request to hit the endpoint in background. This way the sync happens if the user views any page or even refresh.

    I also added a timer to 1 hour and the endpoint gets triggered only if it crosses 1 hour limit. The performance was better when tested.