Invoke Genesys API inside Genesys

Dears

I hope you are doing well,

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.

Thank you @tim.smith , I was using invalid URL for the endpoint however I have update it and its working fine

now my question is once I got response, i got an wrapup.code as an array, my question always I will get the wrap-

up code at position three as show in the attached
snip

Can you provide some context? I'm not sure what I'm looking at in your screenshot.

What I'm trying to do is to get the wrap-up code for any incoming calls, so I can take use of it and send back to our CRM API

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.

I'm using the following endpoint /api/v2/conversations/calls/${Input.id}

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.

I got your point and I would appreciate your support if you could guide me to find any API that will help

To bring up the wrap-up code for each call

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.

its not exactly like this, I'm going to leverage the Genesys driven data action, so when agent hang-up the call

he should pick a wrap-up code for this interaction and based on that I'm going to run my workflow in the backend

to obtain the selected wrap-up code

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.

Dear @tim.smith

Thank you for your response, I got your Idea and I want to see a clear steps of how I can accomplish the above

if you have any example of flow or any video, I will appreciate that as this the first time for me to call Genesys API

and when I'm trying to filtering The response over Data action I found a complexity in that, Kindly your hand in this

Hi Mohannad,

Here are a couple of resources that might help:

  1. 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.

  2. 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

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