cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1429
Views
0
Helpful
4
Replies

UCSD REST API Bad Request using curl

Sean Chandler
Cisco Employee
Cisco Employee

Does anyone have a working example of a curl call to UCS Director REST API.  Requests using the REST API browser seem to work but I have yet to replicate that on the command line.  No amount of escaping seems to work.  Neither GET nor POST etc etc.

Anyone?

curl -X GET -v -k -H 'X-Cloupia-Request-Key: 96E0734017714BF48408EC3C4A8672D3' 'https://192.168.241.252/app/api/rest?formatType=json&opName=userAPISubmitWorkflowServiceRequest&opData=\{param0:"InvokeCustTask",param1:\{"list":\[\{"name":"First Input","value":"Another"\},\{"name":"Second Input","value":"User"\}\]\},param2:-1\}'

...

> GET /app/api/rest?formatType=json&opName=userAPISubmitWorkflowServiceRequest&opData={param0:"InvokeCustTask",param1:{"list":[{"name":"First Input","value":"Another"},{"name":"Second Input","value":"User"}]},param2:-1} HTTP/1.1

...

< HTTP/1.1 400 Bad Request

< Transfer-Encoding: chunked

< Date: Fri, 11 May 2018 16:27:51 GMT

< Connection: close

* Server Web is not blacklisted

< Server: Web