Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  POST /api/v2/conversations/messages/{integrationId}/inbound/open/message doesn't return ConversationId

    Posted 2 days ago

    Doing some development with the open messaging API and using POST: /api/v2/conversations/messages/{integrationId}/inbound/open/message

    It all works, but the API Explorer says that it will return a conversationId in the 202 response.

    But it doesn't in any of my testing; Either against the platform API or using the NodeJS SDK.

    • Is this an oversight in the documentation, or the implementation? 
    • Because it would be REALLY helpful if it did return the conversationId

    Lloyd


    #Integrations
    #PlatformAPI
    #PlatformSDK

    ------------------------------
    Lloyd Taylor
    Solution Architect & Development Lead
    ------------------------------


  • 2.  RE: POST /api/v2/conversations/messages/{integrationId}/inbound/open/message doesn't return ConversationId

    Posted 2 days ago

    Hello,

    I just tried in my GC org, sending a message, and I did get a conversationId back.
    Could you please share your nodejs code (extract of code doing the send message if what you have is spread in different files)?

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: POST /api/v2/conversations/messages/{integrationId}/inbound/open/message doesn't return ConversationId

    Posted 2 days ago

    Thanks Jerome,

    Here's screenshots of the request/response using the Platform API & Postman that demonstrates it, but I get the same result using 

    postConversationsMessageInboundOpenMessage from the Node SDK

    POST:  https://api.mypurecloud.com.au/api/v2/conversations/messages/{{myIntegrationIdGoesHere}}/inbound/open/message

    Request:

    202 Response:



    ------------------------------
    Lloyd Taylor
    Solution Architect & Development Lead
    ------------------------------



  • 4.  RE: POST /api/v2/conversations/messages/{integrationId}/inbound/open/message doesn't return ConversationId
    Best Answer

    Posted 2 days ago
    Edited by Lloyd Taylor 2 days ago

    Hello,

    You are missing a query parameter in Postman. In order to get the conversationId in the response, you need to set an url query parameter named "prefetchConversationId" and equal to true.

    I mean: POST /api/v2/conversations/messages/{integrationId}/inbound/open/message?prefetchConversationId=true

    Using the Platform API Javascript SDK, this would look like this:

    let ConversationsApi = new platformClient.ConversationsApi();
    let integrationId = "YOUR_OPEN_MESSAGING_INTEGRATION_ID"; // String | integrationId
    let body = {
        "text": "This is a test",
        "channel": {
            "from": {
                "id": "1234567890",
                "idType": "Opaque"
            },
            "time": "2025-11-19T06:02:00.000Z",
            "messageId": "11223346"
        }
    };
    let opts = {
        "prefetchConversationId": true // Boolean | Indicates whether or not to prefetch conversationId
    };
    let api_response = await ConversationsApi.postConversationsMessageInboundOpenMessage(integrationId, body, opts);
    You can find more information on the use of prefetchConversationId on this Dev Center page: https://developer.genesys.cloud/commdigital/digital/openmessaging/inboundTextMessages#prefetch-conversationid-usage

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 5.  RE: POST /api/v2/conversations/messages/{integrationId}/inbound/open/message doesn't return ConversationId

    Posted 2 days ago

    Fantastic - I'd missed that one completely!!

    It's now working exactly as you described.

    Thank you Jerome



    ------------------------------
    Lloyd Taylor
    Solution Architect & Development Lead
    ------------------------------