Change hold prompt through API

Hi,

I am trying to change a Hold System prompt using the API but I have one error, please your help about this:

API: /api/v2/architect/systemprompts/{promptId}/resources/{languageCode}

BODY:
{
"name": "on_hold_music",
"promptId": "on_hold_music",
"language": "en-us",
"durationSeconds": "",
"mediaUri": "https://prod-audio-prompts.s3.amazonaws.com/organizations/99922233-4408-4906-b3aa-18e768c853e0/0587002d-8097-46a5-8765-5a035dde64d6/en-us/08b17bcd-ac8f-4bfe-ab00-50ff7fb7c33e.wav?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJ%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIGVgXjPUmvkEwosNnBs1tmEUOcup3yu%2BQnyWwPMw14xRAiEA14Qv9rc10vuZH%2FdqzsevuKJZy%2Fxgz0%2FLIY8XQvjcEVoqgwQIqP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw3NjU2Mjg5ODU0NzEiDFziBWfqu978F3cRTyrXAzy6bek%2BfhK6r965q4c3weP273gOWqtTu4ZaZ2quPPr4oVCfjbG1zvrDO%2FlMiJRAKebKOzGsWB68hMnAgfanwFWJsrVbPPzSetqiSXBVm%2FQSy61JtYuZqXsqPV8oeed86KGQXziQFvoNxhv2NdGD%2B7f9RZEQqLvZDfVyqFXoVfeHl0FhwK5ee1XevbGTD1W4IgVVkpIW4Yxj6QWWkVKROGLof98zXA6ToY8bV8CjcSq6kiOyuVtsNahWoL%2BxrxmBRr1kNSQjglA2B29s%2Fi9Ebxz40KIcKcq30XKbTnSYPl3Vpo%2BNG7dpZEB%2BTu9%2BDCoCVX%2FcaVZjh09gz16qMdfwkaYO8cioJwhBGxxhVUpMbt8H%2B193mzcSqM2NyC8syRO%2FdeN9SeOPNjBGBH%2FzknNJx%2FSoDcfnIXgqAk5aE%2B0dx2ZnExc5L%2B%2B79H7jDSW%2B6tXeXhx9g9naKbcsIv2hmOAlZG1DXfcM6TQWfMKr9JtYr32YPbYp%2BFnrxOpgK2nYvK6hh6CFBhjvpHzkVeV5dNtLQyDR70V8ZNdZ7W4pf7Un%2FdzYZGsHMRzkJg8O9znYrY3epw9FUGcbk%2F8tb4ROAphE4rcgBO8cPPh1bFONIh6XmqtHOLgzkA0bLjDcoJCIBjqlATSVYepRtvPcMMybvKVJOfKv4DgZ9V3TjJPG6vCUtSYipsXsRoG%2FeY%2BgGkYO6%2BVF158GamKCarls%2FJ3Q%2B3ivxF%2BiEt04xP%2BMalX3OQXeCnquz2ahHXIuUDMyJN4sqw19qbXxD%2BwH0TO7fh6YCurGNPE3oekyayIErKMsdP4ojI2QRNStkIbHo8%2B3t3mytYx1rT%2Bi1YT6Lel1ABJDkfjMGZe8%2Fw38iw%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210730T150829Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIA3EQYLGB77MJ7MDWV%2F20210730%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=9006f3dbe98680a437533a01cd24c3d9e3d9218591f7bec74365d8d4f9c5b019",
"ttsString": "",
"text": "",
"uploadUri": "https://apps.mypurecloud.com/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6Ijk5OTIyMjMzLTQ0MDgtNDkwNi1iM2FhLTE4ZTc2OGM4NTNlMCIsInByb21wdElkIjoiMDU4NzAwMmQtODA5Ny00NmE1LTg3NjUtNWEwMzVkZGU2NGQ2IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9",
"uploadStatus": "uploaded",
"hasDefault": true,
"languageDefault": true,
"tags": {}
}

RESULT:

404 Not Found

{
"message": "Could not find resource override with language 'en-us' in specified system prompt.",
"code": "architect.system.prompt.resource.override.not.found",
"status": 404,
"messageWithParams": "Could not find resource override with language '{language}' in specified system prompt.",
"messageParams": {
"language": "en-us"
},
"contextId": "61fda4ae-d7c8-472a-b05c-c11cf41be069",
"details": [],
"errors": []
}

But, when I search the prompt with the API the language show "en-us"

Someone know something about this?

Regards,
Lorena

Hello,

I'm not sure I understand what you are doing (in your first steps).
I don't practice System Prompts (via API) but I just did a test with Genesys Desktop to see what requests it was sending.

As you are trying to change the hold system prompt (which already exists in the system/configuration):

You would first get the system prompt for a specific language code (GET /api/v2/architect/systemprompts/{promptId}/resources/{languageCode})
In the HTTP response, you have an uploadUri attribute.

To change the prompt, you just need to send an HTTP POST (Content-Type: multipart/form-data) with the new wav file (as binary) to that url.
You must also set your Bearer token (access token) in the Authorization header of your HTTP POST.
This is similar approach to what is described for documents here or for audio prompts here.

That's all you need to do.

If you want to monitor the status of the upload, you can leverage the Notifications API and the v2.architect.systemprompts.on_hold_music.resources.en-us topic.

Regards,

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