Generate ConversationId and CommunicationId for POST conversations/messages

How do I Generate a ConversationId and CommunicationId for POST
/api/v2/conversations/messages/{conversationId}/communications/{communicationId}/messages

Hi @Greg_Walters1 as you see there you need an active conversation/communication for that endpoint to work. It's designed to outbound a message from Genesys Cloud to the end user on that messaging platform (web messaging, open, whatsapp, etc). This endpoint would be used from a Genesys Cloud agent. There are a couple ways to start a conversation.

  1. The end customer inbounds a message on your Web messaging deployment, or messaging integration, etc. This is the most typical way those conversations are generated. You might find more helpful info here About messaging - Genesys Cloud Resource Center
  2. You can generate an outbound initiated conversation using API Central this document explains how to do this via the UI Send an outbound message on behalf of a queue - Genesys Cloud Resource Center but it uses that above linked api.

Hi Greg,
I was able to run the flow and capture the API calls. The only thing I cannot find is how to get the communicationsId in the

POST /api/v2/conversations/messages//communications//messages

The conversationId is generated by the
POST /api/v2/conversations/messages
which creates the conversation.

Is the communicationsId static by login user? Is there a GET to find the value?

Thanks,
Greg

CommunicationId is in the Conversation model (the one you POSTed), but it's named a little weirdly. So it does bring confusion, not just to you. We are working on documentation to help clarify, and it should explain your exact use case here.
For now though, take a look at this page https://developer.genesys.cloud/commdigital/digital/messagemedia/ this is unrelated to what you are doing, but at the top it has a little example of what a communicationId is on a Conversation. So I think it will help you for your use case here.

Got it. Looks like it is stored in the "peer" value is you use
GET /conversations/messages

Thank you very much!!!

Hi Greg,
Now writing the calls in Python. Having an issue with the login. Doing the following, but I don't know what to put for the encodedsamlassertion. Also, do I have to set the region to uwsc2 somehow. I saw some code doing that, but am assuming you know based on the orgName

import PureCloudPlatformClientV2

client_id = "xxxxxx@xxx.com"
client_secret = "xxxxx"

apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_saml2bearer_token(client_id,
client_secret,
"orgName",
encodedsamlassertion??????)
usersApi = PureCloudPlatformClientV2.UsersApi(apiclient)
print(usersApi.get_users_me())

I'm not part of the Auth side, so can't provide much help there. Someone else might see this and be able to provide assistance. Or you could consider starting a new post about Auth login, as that would allow it to be more visible on the forum. I found this doc, but not sure it can help with your questions or not https://developer.genesys.cloud/authorization/platform-auth/use-saml2-bearer

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