Legacy Dev Forum Posts

 View Only

Sign Up

Update and change system wrap up codes

  • 1.  Update and change system wrap up codes

    Posted 06-05-2025 18:13

    Darryn_Chang | 2018-03-19 01:45:49 UTC | #1

    I have recently been provided basic steps to attempt to change a System (ININ-OUTBOUND-TimeOut) wrap up code to a relevant user wrapup. I am no developer but followed the instructions nevertheless. I am receiving a 403 forbidden error when attempting to access the conversation id

    Is there a tutorial or video to show how this is done correctly, to make sure i am doing everything correct?

    curl -X PATCH -H "Content-Type: application/json" -H "Authorization: bearer <INSERT AUTH TOKEN>" -d '{ "wrapup": { "code": "c5ed5040-7661-4be3-ad8d-caacf984748d", "name": "AUDG Not Interested", "notes": "", "tags": [], "durationSeconds": 0, "endTime": "", "provisional": true }, "state": "disconnected", "recording": true, "muted": true, "confined": true, "held": true, "wrapupSkipped": true }' "https://api.mypurecloud.com.au/api/v2/conversations/chats/0ae82ce3-5c8e-4865-82d4-caa2a4e6a1de/participants/7dd60e2f-7c6d-44b0-a894-0bd3b8840f46"

    Result: { "status": 403, "code": "not.authorized", "message": "Access to Conversation 0ae82ce3-5c8e-4865-82d4-caa2a4e6a1de is forbidden.", "messageWithParams": "Access to {type} {id} is forbidden.", "messageParams": { "id": "0ae82ce3-5c8e-4865-82d4-caa2a4e6a1de", "type": "Conversation" }, "contextId": "8d839ca0-c5f5-47b2-aeba-dab735f926bc", "details": [], "errors": [] }


    tim.smith | 2018-03-19 16:43:09 UTC | #2

    Every property you set on that API resource tries to take an action. For example, sending “state”: “disconnected” is telling PureCloud to try and change the conversation's state. You're getting a 403 because you are not allowed to disconnect that conversation (because it's not active anymore). Only send the properties you want (i.e. the wrapup property), and only send the properties you actually have a value for (i.e. code).


    Darryn_Chang | 2018-03-19 21:16:47 UTC | #3

    Hi Tim, tried what you said and removed the "disconnected" now I am getting a 400 Bad Request. I have extracted the wrap up codes and tried with and without the code id also removing the name and running just with the code id but i keep getting the below message

    Hence why i added the "disconnected" in state { "status": 400, "code": "invalid.value", "message": "Value [] is not valid for field type [State]. Allowable values are: alerting, dialing, contacting, offering, connected, disconnected, terminated, converting, uploading, transmitting, none" }


    tim.smith | 2018-03-19 23:03:45 UTC | #4

    Can you provide the context/correlation ID from the response please?


    Darryn_Chang | 2018-03-20 00:09:58 UTC | #5

    curl -X PATCH -H "Content-Type: application/json" -H "Authorization: bearer <INSERT AUTH TOKEN>" -d '{ "wrapup": { "code": "c5ed5040-7661-4be3-ad8d-caacf984748d", "name": "AUDG Not Interested", "notes": "", "tags": [], "durationSeconds": 0, "endTime": "", "provisional": true }, "state": "", "recording": true, "muted": true, "confined": true, "held": true, "wrapupSkipped": true }' "https://api.mypurecloud.com.au/api/v2/conversations/messages/d88d9840-02e6-4ce0-ba61-5446579a85ce/participants/2e43f0c1-1b00-47ec-b3e0-1746c9de4726"

    PATCH /api/v2/conversations/messages/d88d9840-02e6-4ce0-ba61-5446579a85ce/participants/2e43f0c1-1b00-47ec-b3e0-1746c9de4726 HEADERS Key Value Content-Type application/json Authorization <HIDDEN>

    400 Bad Request HEADERS Key Value cache-control no-cache, no-store, must-revalidate content-type application/json expires 0 inin-correlation-id 6b3eb402-2273-4c5a-bca8-476a7874b430 pragma no-cache BODY { "status": 400, "code": "invalid.value", "message": "Value [] is not valid for field type [State]. Allowable values are: alerting, dialing, contacting, offering, connected, disconnected, terminated, converting, uploading, transmitting, none" }


    tim.smith | 2018-03-20 19:47:55 UTC | #6

    tim.smith, post:2, topic:2636
    Only send the properties you want (i.e. the wrapup property), and only send the properties you actually have a value for (i.e. code).

    @Darryn_Chang You are still sending all of the properties in your request.


    Darryn_Chang | 2018-03-21 20:26:46 UTC | #7

    Does that mean i remove all the other properties detail and just leave it like this?

    “wrapup”: { “code”: “c5ed5040-7661-4be3-ad8d-caacf984748d”, “name”: “AUDG Not Interested”,

    When i do this it creates an error on the line in the dev tools. Is there any chance you can provide me an example of what I should be sending?


    tim.smith | 2018-03-21 20:39:07 UTC | #8

    When i do this it creates an error on the line in the dev tools.

    What's the error?

    Is there any chance you can provide me an example of what I should be sending?

    What you commented with, but you need to send valid JSON. Also, the JSON object in your post is using an extended ascii character for the quotes. You're using (hex 0x201c), but you should be using " (hex 0x22). These fancy quotes usually come from using document authoring software like Microsoft Word or Outlook instead of a text editor like Notepad, Sublime, or any IDE.

    {
      "wrapup": {
        "code": "c5ed5040-7661-4be3-ad8d-caacf984748d",
        "name": "AUDG Not Interested"
      }
    }

    Darryn_Chang | 2018-03-21 21:01:31 UTC | #9

    I wasn't using Notepad but merely copying from the dev tools page. I will take note to use the text editor in future.

    It has worked successfully, thank you


    tim.smith | 2018-03-22 15:25:05 UTC | #10

    You’re using “ (hex 0x201c), but you should be using " (hex 0x22).

    Turns out this is a new site setting on the forum that was enabled by default. It was "prettyifying" posts and presenting normal quotes as "smart quotes". That setting is now disabled so there shouldn't be issues with copy/pasting quotes from the forum anymore.


    system | 2018-04-22 15:26:42 UTC | #11

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


    This post was migrated from the old Developer Forum.

    ref: 2636