cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1374
Views
10
Helpful
4
Replies

Add Trigger via configuration API fails

Maic Naatz
Level 1
Level 1

hi,

 

i would like to add an trigger via UCCX configuration API with postman for testing purposes. Application and CallControlGroup are valid entries. The trigger can configured manually (is deleted after tested :-))

This is the URL: https://<server>/adminapi/trigger 

This is the body of the request:

<?xml version="1.0" encoding="UTF-8"?>
<trigger>
<self type="trigger" href="https://uccx-11-5.[domain]/adminapi/trigger/1214" rel="self"/>
<directoryNumber>1214</directoryNumber>
<locale>de_DE</locale>
<application name="Hotline">
<refURL>https://uccx-11-5.[domain]/adminapi/application/Hotline</refURL>
</application>
<deviceName>CCX1214</deviceName>
<description>Beschreibung</description>
<callControlGroup name="2">
<refURL>https://uccx-11-5.[domain]/adminapi/callControlGroup/2</refURL>
</callControlGroup>
<triggerEnabled>true</triggerEnabled>
<maxNumOfSessions>2</maxNumOfSessions>
<idleTimeout>5000</idleTimeout>
<overrideMediaTermination>
<dialogGroup name="0">
<refURL>https://uccx-11-5.[domain]/adminapi/dialogGroup/0</refURL>
</dialogGroup>
</overrideMediaTermination>
<alertingNameAscii></alertingNameAscii>
<devicePool>PUB-SUB</devicePool>
<location>L_Labor</location>
<partition>Intern</partition>
<voiceMailProfile>None</voiceMailProfile>
<callingSearchSpace>UCCX</callingSearchSpace>
<callingSearchSpaceForRedirect>default</callingSearchSpaceForRedirect>
<presenceGroup>Standard Presence group</presenceGroup>
<forwardBusy>
<forwardBusyVoiceMail>false</forwardBusyVoiceMail>
<forwardBusyDestination>
</forwardBusyDestination>
<forwardBusyCallingSearchSpace>None</forwardBusyCallingSearchSpace>
</forwardBusy>
<display>44</display>
<externalPhoneMaskNumber></externalPhoneMaskNumber>
</trigger>

 

If i send it, the follwing message appaers:

<apiErrors>
    <apiError>
        <errorData></errorData>
        <errorMessage>
Exception Description: An error occurred marshalling the object
Internal Exception: org.xml.sax.SAXParseException; cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '([0-9*xX#\[\]-]+)|(\+[0-9*xX#\[\]][0-9*xX#\[\]-]*)' for type 'directoryNumber'.</errorMessage>
        <errorType>InvalidInput</errorType>
    </apiError>
</apiErrors>
 
It seems, that the directoryNumber value is empty. Playing around with the entry <directoryNumber>1214</directoryNumber> are not successful.
This is a Contact Center in Release 11.6.2.10000-38. The same behavior in Release 12.0.1.10000-24.
Can everyone give me a hint, how to add that trigger?

 

 

3 Accepted Solutions

Accepted Solutions

Hi @Maic Naatz ,

In attachment, a Postman collection that I have used for the dCloud environment (UCCX v 11.6(3)) and it worked for me. I haven't had a chance to compare your data structure with the one I used.

What you can also do is to:

  • Call Get Trigger List API and get single trigger the object structure from the response
  • Modify the required parameters
  • Call Create Trigger API

This should confirm if you have a valid XML structure. 

 

 

Marek https://gaman-gt.com
UCCE, PCCE, UCCX, WxCC, Cisco Finesse, Custom Gadget, CVP, CUIC, CUCM

View solution in original post

Anthony Holloway
Cisco Employee
Cisco Employee
I have tested the admin API trigger creation on UCCX 12.0 and 12.5 without issue. I simply grab a trigger with an HTTP GET, then copy the body response, paste it into an HTTP POST, modify the few spots (like a copy) to make the new trigger unique, then submit it. Are you doing something similar? Or are you crafting your XML by hand?

View solution in original post

Marek is awesome, no worries from me. Glad you figured it out. A different lesson learned here, documentation can quickly become out of sync, if not out right wrong to being with, therefore, pull live data from a real system and start there.

View solution in original post

4 Replies 4

Hi @Maic Naatz ,

In attachment, a Postman collection that I have used for the dCloud environment (UCCX v 11.6(3)) and it worked for me. I haven't had a chance to compare your data structure with the one I used.

What you can also do is to:

  • Call Get Trigger List API and get single trigger the object structure from the response
  • Modify the required parameters
  • Call Create Trigger API

This should confirm if you have a valid XML structure. 

 

 

Marek https://gaman-gt.com
UCCE, PCCE, UCCX, WxCC, Cisco Finesse, Custom Gadget, CVP, CUIC, CUCM

Hi,

 

many thanks for your replies (now it runs :-))

 

Explanation:

I get the XML data from the Cisco devNet configuration API description (see attached photo).

2020-02-24 14_05_21-Create a New Trigger - Contact Center Express - Document - Cisco DevNet.jpg

After verifying the data with this from Marek i found a little difference (red marked). Then i put it in one line. This was the resolution. Cisco's example is one more time invalid!

 

So you are both right, but i guess, i can only one of you give the button "accept as solution". This was Marek, because he was little bit quicker.

Marek is awesome, no worries from me. Glad you figured it out. A different lesson learned here, documentation can quickly become out of sync, if not out right wrong to being with, therefore, pull live data from a real system and start there.

Anthony Holloway
Cisco Employee
Cisco Employee
I have tested the admin API trigger creation on UCCX 12.0 and 12.5 without issue. I simply grab a trigger with an HTTP GET, then copy the body response, paste it into an HTTP POST, modify the few spots (like a copy) to make the new trigger unique, then submit it. Are you doing something similar? Or are you crafting your XML by hand?