cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
304
Views
10
Helpful
15
Replies
Highlighted

REST POST inserting a "?"

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
Highlighted

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
Highlighted

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

Highlighted
Participant

Rest and post API message retry configuration methods

 

Capture39.JPG 

Highlighted

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

 

 

Highlighted

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

Highlighted

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

Highlighted

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.

Highlighted

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?

Highlighted

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.

Highlighted

Capture.PNG

Highlighted

What's the value of your Content-Type?

Highlighted

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.

Highlighted

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

Highlighted

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. 

 

Highlighted
Participant

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

Content for Community-Ad