Legacy Dev Forum Posts

 View Only

Sign Up

Cannot get webmessaging/messages as an agent (403)

  • 1.  Cannot get webmessaging/messages as an agent (403)

    Posted 06-05-2025 18:36

    Michael_Kork | 2023-03-06 16:47:51 UTC | #1

    I am using the JavaScript SDK (platform client) and calling apiInstance.getWebmessagingMessages but I get a 403 forbidden, even though my agent has the conversation / web messaging / view permission. The Documentation states that no permissions are required to get the messages.


    Frederic_Thomas | 2023-03-06 17:14:51 UTC | #2

    Hi Michael,

    This API end point is built to get the history for custom Messenger (client facing) . It's relied on token used at webmessaging session management time.

    On agent side you should rely on conversation / messaging API

    regards

    Frederic Thomas


    Michael_Kork | 2023-03-06 17:57:25 UTC | #3

    Frederic_Thomas, post:2, topic:18748
    conversation / messaging API

    The messagingAPI (platformClient.messagingAPI) has methods only for supported content profiles.

    The conversationsAPI (platformClient.conversationAPI) does not have any methods to get web-messaging chat messages.

    The method getConversationsChatMessages returns 404 (I guess it retrieves web-chat messages) and the getConversationsMessage gets the conversation details without the messages. only the participants.

    Which is the correct method in platformClient to get the web-messaging chat messages?


    Frederic_Thomas | 2023-03-06 20:40:34 UTC | #4

    I am not an expert of these APIs for what I know for live, on live interaction, you should retrieve the conversation details and loops on each messageId

    regards


    Jerome.Saint-Marc | 2023-03-07 10:23:22 UTC | #5

    Hello,

    On Agent side, the messages of a web messaging conversation are retrieved using POST /api/v2/conversations/messages/{conversationId}/messages/bulk. The body contains an array of the messageIds to retrieve. You can get these messageIds from GET /api/v2/conversations/{conversationId} (messageIds of messages sessions for the different participants).

    This blueprint contains a javascript example. Check the showChatTranscript function in https://github.com/GenesysCloudBlueprints/digital-messaging-translator-blueprint/blob/main/docs/scripts/main.js

    Regards,


    system | 2023-04-06 10:18:01 UTC | #6

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 18748