So, we’re trying to dynamically update wrap-up codes in Architect flows via the API - thought it’d be a quick win, but “get_routing_wrapupcodes” doesn’t seem to exist in purecloudplatformclientv2. Seems odd, since NICE has a perfectly serviceable endpoint for this. The SDK’s documentation is…sparse, let’s say.
We’re pushing wrap-up code updates from Segment, based on CDP attribute changes - theoretically, a clean, event-driven update. Trying to pull the existing codes to diff against before applying changes, expecting a list, but it’s just not exposed. Instead, it’s forcing a full replacement which is… suboptimal, to say the least.
The apply is failing with this, consistently:
{
"message": "The requested resource was not found.",
"code": 404,
"status": 404,
"error_class": "resource_not_found"
}
Using purecloudplatformclientv2 v13.0.0, running in a Python 3.9 environment. Anyone else run into this or discover a hacky workaround?
hey! ran into something similar a while back lol. it’s almost always the wrap-up codes - seriously.
We’re on Zoom Contact Center and it looks like the purecloudplatformclientv2 SDK is… well, a bit behind, yeah? NICE does have that endpoint, but it’s kinda weird they don’t keep the SDK up to date.
You can actually pull the wrap-up codes with a GET request to /api/v2/routing/wrapupcodes. It’s not in the SDK, but it works fine when you call it directly.
Here’s a super basic example - I haven’t tested it fully tbh, just cobbled it together from what we did.
import requests
url = "https://genesyscloud.com/api/v2/routing/wrapupcodes"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
wrapup_codes = response.json()
print(wrapup_codes)
else:
print(f"Error: {response.status_code}")
Is the token set up correctly? That always gets me.
You’ll probably want to paginate the results too, in case you have a ton of wrap-up codes. I think it defaults to 100 per page? Just a thought. Anyway, once you have the list, you can compare it to what Segment’s sending and only update the ones that are different. Does that make sense?