Hello everyone, I am currently trying to post a http post request using Cucumber for Appian to the Appian system itself using the cheat sheet made available by Appian. But I am facing errors and I am unsure what Im supposed to put in the 'BODY' parameter. Please see below:
Cucumber scripts cheat sheet:
Discussion posts and replies are publicly visible
Hello Rabiah,
A post operation requires a body, which means the parameters you are sending are in the body (create a new client, update the client, delete the client with id #)
If you webapi Justo query information is more likely to be a get operation. On which you don’t have to pass parameters.
From your example you are trying to create a new product so you need to pass all the data of the product you are trying to create I guess you are using Json?
Maybe something like
{productName:“product1”}
Hope this helps
Jose
Hi Jose, I was indeed trying to do a POST api request and I managed to understand how the post API cheat sheet was talking about. for the WEB_API_ENDPOINT script (Given I post web api "WEB_API_ENDPOINT" with body "BODY" with username "USERNAME"), it ws referring to just the endpoint instead of the full URL of the web api. eg. ">appian-example.com/.../createNewProduct", the endpoint Cucumber for Appian is looking for is actually just "createNewProduct"
thank you for the answer and the next step of my work is to send a json request and have 2 questions regarding it.
1) what if i have a very long json request to be processed in Appian? is there a way i can store my request in a .json file and call it in cucumber for appian script?2) How do I read the response from making the web api call in cucumber?
Hi Rabiah were you able to complete a successful cucumber test with testing an appian api? I am having trouble with it and see no documentation.
hi laurela, in the end i didnt make use of their body as it seems to be unrealistic to throw a big json body request into it. I created my own custom cucumber scripts that would take in my own personal request in my .json file. So its smth like "Given I send my request", and in the backend, its a list of codes calling the web api and forming my body request. Its easier to read and manage