1

I am subscribing to platform events in apex trigger. In the trigger I am trying to post to user's chatter feed using Chatter Connect API. I am aware that in this case the context is "Automated Process". When executing Chatter Connect REST API, I am receving error: Insufficient Privileges: The Connect API is not enabled for this user type.

If I replace chatter REST API calls with insert on FeedItem, chatter post works successfully.

I need to work with chatter connect APIs as I have a complicated chatter post format, involving EntityLink, Rich Text, images etc..

Does anyone know how to use Chatter Connect REST APi for "Automated Process" user context ? I also tried running the code as "without sharing" but that didn't help either.

0

Looks like "Automated Process" user doesn't have access to Chatter REST APIs. So only option is to use DML on FeedItem

0

I guess you can insert a custom object with serialized chatter message as "Automated Process".

Then you can schedule a batch as Admin (e.g. running every hour) which will deserialize message and post it via Chatter Connect REST API.

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.