Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Update Wrapup code and Wrpup Note with a script

    Posted 5 days ago

    Hello,

    I want create a script with a list of notes to choose the notes. And after update the notes with API.

    I know that's impossible to use an OAuth Client Credential, to use the API PATCH /api/v2/conversations/{conversationId}/participants/{participantId}.

    I create a Genesys Cloud Data Action integration. And I want to create an OAuth client of the Code Authorization / PKCE type. But I don't know which Authorized redirect URI to use.

    Is this the right approach?

    Thanks in advance


    #PlatformAPI
    #Scripts

    ------------------------------
    Romuald Goux
    Delivery Engineer
    ------------------------------


  • 2.  RE: Update Wrapup code and Wrpup Note with a script

    Posted 5 days ago

    Hi Romuald,

    If your goal is to set the actual wrap-up code and wrap-up note from the script, then using the conversation participant PATCH endpoint makes sense:

    PATCH /api/v2/conversations/{conversationId}/participants/{participantId}

    A few things to check:

    • use the interaction ID as the conversationId
    • use the agent participant ID, not the customer participant ID
    • use the wrap-up code ID, not just the wrap-up name
    • if setting final wrap-up details, send both the wrap-up code and notes in the request body

    I also came across similar discussions where this was done through the Conversations API:

    • https://community.genesys.com/discussion/updating-wrapup-notes
    • https://community.genesys.com/discussion/set-system-wrap-up-via-api

    The part I would question is the Authorization Code / PKCE approach. PKCE usually requires a browser-based user login and an application redirect URI, so it may not be the right fit for a standard Genesys Cloud Data Action.

    Are you receiving a specific error when trying this with the Data Action / Client Credentials approach?

    Hope someone might add more to this.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 3.  RE: Update Wrapup code and Wrpup Note with a script

    Posted 5 days ago

    I agree with you, Phaneendra.


    For a Genesys Cloud Data Action calling a Genesys Cloud API, I would use an OAuth client with the Client Credentials grant type.


    That is the standard approach for Genesys Cloud Data Actions because the action runs as an integration, not as an interactive user login. In this case, Authorization Code / PKCE is not the right approach, and you do not need to configure an Authorized Redirect URI.


    The important point is to make sure the OAuth client used by the Data Action has the required roles and permissions to call the API endpoint.


    So I would suggest:

    • Create an OAuth client using Client Credentials
    • Assign the required roles/permissions to that OAuth client
    • Configure the Genesys Cloud Data Action integration with that client ID and secret
    • Call the Genesys Cloud API through the Data Action


    For this scenario, I would stay with Client Credentials and not use PKCE.



    ------------------------------
    Arthur Pereira Reinoldes
    ------------------------------



  • 4.  RE: Update Wrapup code and Wrpup Note with a script

    Posted 4 days ago

    I use the attached data action in my script to set wrapup code and notes. I send the wrapupcode and participant id from the flow to the script



    ------------------------------
    Eystein Kylland
    Systemutvikler Genesys Applikasjonsspesialist
    ------------------------------



  • 5.  RE: Update Wrapup code and Wrpup Note with a script

    Posted 4 days ago

    Hi Romuald,

    if you want to use an API that needs personal context, than PKCE is the right choice. The problem is: Data Actions do not support that. You will receive an error that contains the warning, that the API needs personal context. The only way I found is to create an interaction widget. You have to host the code somewhere, I use AZURE static web app. An interaction widget is a new tab beside the script. There you can use PKCE auth and after that every API you desire. Because interaction widgets are aware of the conversations of a user its easy to access interaction details.



    ------------------------------
    Christoph Domaschke
    Produktmanager Kunden-Dialog-Center
    ------------------------------