cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2773
Views
10
Helpful
15
Replies

REST POST inserting a "?"

JohnBushong8071
Level 1
Level 1

When sending a POST to another server, the CCX inserts a "?" at the end of the URL. The server responds with 200 however, because of the "?" the POST data is dropped by the server.

 

UCCX Status details: "POST https://{server name}/apiv1/coSpaces?

In Postman: https://{server name}/apiv1/coSpaces

 

I tried putting in a "/" after the URL

UCCX Status details: "POST https://{server name}/apiv1/coSpaces/?

 

How do I get rid of that "?" ?

 

John B

1 Accepted Solution

Accepted Solutions

Right ok, so the Content-Type needs to match what you're sending the server.  In UCCX, if you are sending a key/value pair of parameters, this is implying a url form encoded content type.  I don't know where the ? is coming from, but it might actually not be your problem, just that it's the thing you noticed first.

View solution in original post

15 Replies 15

JohnBushong8071
Level 1
Level 1

After messing around with the headers I found that the basic URL is now completing to the server however, the Key items are not being sent. Is there some Header or otherwise that is required to get the Key pairs to transmit?

 

John B

BalajiSivaraj49175
Spotlight
Spotlight

Rest and post API message retry configuration methods

 

Capture39.JPG 

Postman is working fine; it's the UCCX script that is not working.

 

 

Anthony Holloway
Cisco Employee
Cisco Employee

Are you using the Make REST Call step or something else? E.g., URL[] document literal.

Yes, using the Make REST Call step.

I am attempting to use UCCX to send configuration items to the Cisco Meeting Server by API. The CCX sends the POST just fine, but is not getting the Key pair to the CMS. I think it is because of the "?" that is inserted at the end of the URL, but there may be additional characters or something I am missing to get by that and actually send the Key pair.

 

John B

I'm not too familiar with the CMS API, but don't you send it an XML payload?

At any rate, can you post some details about the Make REST Call step and the data you're sending?  Feel free to sanitize.

So My REST step has the URL (which CCX can connect to) and then I am putting Key pairs in the URL Parameters:

 

Method:          Post

URL Parameters          Names                        Values

                                  "needsActivation"        "true"

 

When I run Reactive debug, I can see the connection to CMS however, the Key pair is not sent.

In Postman I do the same by using the Body tab and the Key and Value

 

Does this make sense?

I think that makes sense, but doesn't the CMS API require an XML body?  I guess not, since you're saying it works in postman.  What did you set your Content-Type header to in the Make REST Call step?  Can you provide a screenshot?  Sometimes there are other clues to see if I can see your screen.

What's the value of your Content-Type?

Content Type: Application/XML.

I just noticed Postman has "x-www-form-urlencoded" selected. Is that something that should be in the Header?

Balaji stated I might need something in the Body during the Post. Right now the variable assigned to Body is blank.

Right ok, so the Content-Type needs to match what you're sending the server.  In UCCX, if you are sending a key/value pair of parameters, this is implying a url form encoded content type.  I don't know where the ? is coming from, but it might actually not be your problem, just that it's the thing you noticed first.

I solved this issue by doing the following;

1st MAKE REST = POST (to create the item in CMS)

2nd MAKE REST = GET (to find the Item ID)

3rd MAKE REST = PUT (with the Content Type = "application/x-www-form-encoded" and the information in the body, not the URL Parameters.

 

This script is going to read a list of over 2000 users and build their profiles, with a host PIN and a separate user PIN, in Cisco Meeting Server 1000. 

 

BalajiSivaraj49175
Spotlight
Spotlight

 cant you do it by attaching those in body?Capture54.JPG

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: