I'm trying to invoke Genesys API inside Genesys, but I failed, as I followed the below steps:
1- create client ID auth
2- Install genesys integration and insert the secret with its ID
3- call Data action
after all of this its didn't work as its show me the following error "Response from web service: {"message":"This request requires a user context. Client credentials cannot be used for requests to this resource.","code":"not.a.user","status":400,"contextId":"591ebe54-fb12-477e-86e4-c6f55d942aed","details":[],"errors":[]} [d34c4ed1-82d7-47a3-b425-7df4923d6839]"
However I'm trying to invoke "/api/v2/analytics/conversations/{conversationId}/details" to bring up the wrap-up code ID, could anyone give me a hand in this and show me a clear steps as this first time for me trying to do this
This error means that you cannot use the endpoint via data actions because it requires a human to be present to complete the OAuth flow in a browser as a known Genesys Cloud user.
Sorry, I meant context like where is that data coming from? How are you getting it? There's nearly 2000 Platform API endpoints and I don't recognize that off the top of my head.
Ah, I see what that is. That's the output from testing a data action, not an actual API response. Because you've flattened the response, it turns properties that have a single value into an array. The positions in the array are relative to whatever it was that was flattened, which is the list of participants in this case. There is no guarantee of the order of participants in the results. But even if they were ordered in a predictable way, that's not a sensible target to look for a fixed position because the number of participants is different depending on how many participants were involved over the duration of the call.
I'm not sure what you mean by this in the context of a data action. Data actions run in an Architect flow or in an agent script, which both happen while the call is active before a wrap up code is assigned.
Happy to help, but I don't understand your meaning. It sounds like you're trying to use a data action in an Architect flow to get a wrap up code that hasn't been assigned yet. If you're trying to get a wrap up code to push to an external system, you have to get it after the agent has assigned it. If you can explain your workflow more clearly, I can likely recommend an approach. But what I think I understand so far isn't making sense to me.
So are you using Triggers and maybe the topic v2.detail.events.conversation.{id}.customer.end to run a Workflow in Architect where you're running this data action?
If that's the case, you should be able to use the data action to invoke GET /api/v2/conversations/calls/{conversationId} and iterate over the array of responses to find the wrap up codes assigned to the conversation using Architect's data tools. Keep in mind that it is absolutely possible to have multiple wrap up codes per conversation, so you'll need to account for this in your design. (e.g. call was handled by an agent, requeued, and handled by another agent)
Alternatively, you can build your own web service to perform this lookup so you can code in whatever logic you need to find the code and return a single value. Then your data action can invoke your service so the logic in Architect becomes very simple.
Callback with SMS Notification. This is a blueprint where we set up a process automation trigger to listen to for the end of conversation event (e.g. the acw event) based on the wrapup code we then trigger an Architect workflow to do some work.
Event-based integrations. This is a youtube video of presentation I had put together (unfortunately I could not do the presentation) that covers the different mechanisms for doing event-based integration.
I hope this helps.
Thanks,
John Carnell
Director, Developer Engagement