Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

postMessage(pulseContext, message, attachmentIDs, isReply, c11nEnv)

Updated on July 20, 2021

Posts a message to the given context.

Returns

A Promise that resolves to an object.

Parameters

NameTypeDescriptionRequired
pulseContextstringThe name of the application context or case context for which the message must be posted.
messagestringThe message that needs to be posted.
attachmentIDsarrayThe metadata of the attachments that need to be posted along with the message.
isReplybooleanThe flag that determines if you want to post a message or a reply to a message.
Note:
  • The default value is false.
  • Set isReply to true if you want to post a reply to a message.
  • Set isReply to false if you want to post a message.
c11nEnvobjectThe name of the context where the API is being called.

Usage example

In this example, the API posts a message along with attachment to the given context.

PCore.getFeedUtils().postMessage('DATA-PORTAL','test message', [{"type":"File","category":"File","fileName":"attachment.png","ID":"459c"}], false, 'app/primary_1')
.then(() => {
  // success
}).catch(err => {
   // Error handling
});

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us