02-03-2017 08:49 AM - edited 03-15-2019 06:27 AM
I need to call a Rest POST API (json ) in my ccx editor. I am using Make Rest Call node. The rest content Type is JSON. When i call that API i received error "parameter not found", but actually i am sending the parameter in body.
In the body i have given json parameter "cnic" but when i sent request it throw me error NIC not found, its mean i am not able to send cnic parameter correctly.
Screen shot is attached, any help is much appreciated
.
02-03-2017 11:40 AM
When I'm testing out whether or not an API is going to work..I use POSTMAN first..I would experiment with that..and then try to figure out what you might be doing wrong with the particular STEP you are trying to use on that platform..or in your case..you are passing the correct data..but there really isn't a NIC for the ID you passed as the param in the object..
https://www.getpostman.com
02-03-2017 12:14 PM
Thanks @Samuel Womack for your reply.
Actually i have already tested this API in different tools, like Rest API client in intelliji idea, postman etc . And it works perfectly well. But when i run this inside the ccx client i got this error.
According to error its seems somehow i am not passing the correct data.
02-03-2017 01:43 PM
I always build my API body as a string before the rest step so I can see what CCX is putting in the string.
Then in the Rest step just reference string in the body.
I also seem to recall problems escaping double quotes so I have tended to use double single quotes instead of backslash double quote.
Graham
02-03-2017 10:55 PM
So what i needed to do ??
Should i create a string assign that expression string and use that String inside the the body ?
05-21-2018 02:28 AM
I am facing an issue with post API and I am using make rest call, the body i have given json parameters, in the below format.
u"{\"Amount\":\"Int_Amount\",
\"AccountId\":\"String_AccountId\"}".
I tried posting the required parameters using postman. there its working fine.
Whereas, while doing reactive debug in uccx tool,I sent request to post the body parameter,its goes to unsuccessful part of the make rest call, it throw me error as 400 bad request , it mean i am not able to send body parameters correctly.
Your help would be most appreciated.
02-03-2017 02:27 PM
Graham makes a good point..about creating a variable for the Body, however I found double single quotes do not work..so I believe you were on the right track with your var expression:
u"{\"name\":\"name\"}"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide