1

I have open API that external application use through site.com In this case, API logic runs as site guest user.

The problem is, Site guest user has no permission to post chatter. However, I need to post feed in API logic.

Is there any workaround? If I wrote trigger posting chatter feed, and invoke this trigger in API apex code, would it work?

Thanks in advance for your attention.

0

No, you cant access Chatter with Guest User Content. No matter what you do, if you are in Guest user content you will never be able to post to chatter

Fortunately there are 2 solutions for it on top of my head

1) Using Platform Event : Guest user can publish platform events. YAY. So you just have to Write a trigge on platform Event that will insert a FeedItem(Chatter)

2) Using Rest API: Store a system user's Username and password in CUstom Settings / Custom Metadata and then Use that to get Acces Token using username-password oauth flow. Once you got access token you can directly call chatter rest endpoint to post messages.

|improve this answer|||||
  • 1
    or -- use a ProcessBuilder as Platform Event subscriber ..could be faster to set up – cropredy Mar 1 '19 at 2:47
  • Thanks Pranay and cropredy. Currently, I cannot use user authentication way, so, looks like I need to approach with Platform Event. If guest user generate platform event, and trigger catch the event and create chatter post, this post is created by System not by Guest user? – YoungHoon Kim Mar 2 '19 at 12:39
  • I created trigger and post chatter feed in there. Guest user just modify another normal field for firing Platform Event. However, the same error occurs. 'Guest users are not permitted to perform this operation.' – YoungHoon Kim Mar 2 '19 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.