0

From an external app I would like to change the presence status of a user via an API. I was not able to figure out if there is a public API but found this js code that supposedly works in an apex vf page:

sforce.console.presence.setServicePresenceStatus(statusId, function(result) { ... });

I guess as it is running in the page it will switch the status of the logged in user. Now I need to do this from an external service. I have a very limited knowledge of Salesforce and just figuring out what is what, but so far I am thinking on this:

Somehow I would send in a platform event from my Python app (unsure yet how). I would create an apex vf page that subscribes to the platform event and runs the above code for that user.

Would this work? Can an apex page subscribe to a platform event that is coming in from an external app using some API?

Any help or pointers would be highly appreciated.

1 Answer 1

0

You could use platform events, here is an article of how external systems can create platform events in salesforce . Check the section Publish Event Messages Using Salesforce APIs

You can then create an apex trigger to set the presence status using apex if possible.

OR., the easiest way might be to just call the API to set status directly from the external app https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_setservicepresencestatus.htm

1
  • Thanks I will definitely try those platform events. And yes that is the link I found with that API. But that looks to me only callable in an apex page because there is no parameter to specify which user's presence I want to change. So I believe it is intended to call only on the SF fronted so it already knows from the session which agent is logged in. That is why I am thinking to send in an event and subscribe to it in an apex page and run that status change code based on the incoming event.
    – Z T
    Commented Jul 20 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .