Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+2
person also asked this
people also asked this
Replies
22 replies
Answers
1 answer
Subscribers
9 subscribers
Views
20652 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Web API with POST Method
erick258
over 7 years ago
Hi, I'm trying to create a query datastore WEB API with a POST HTTP Method. Is there a way to test request through Appian as I can't seem to find the field to edit the request body? Thanks
OriginalPostID-251548
Discussion posts and replies are publicly visible
0
chetany
A Score Level 1
over 7 years ago
Here are the options:
1. Test it from within Appian - create a test process model and use the HTTP Query Smart service - it supports POST
2. Use a Chrome plugin like Postman - this is for testing from outside Appian.
In both cases, you need to use HTTP Basic Authentication, and you can send the data in the request body
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 7 years ago
SoapUI also supports calling Appian Web API. Create a REST project providing the Appian URL. Then you can setup your test cases.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@erick258 you can go for the Options suggested by @stefanh791 and @chetany, but don't you feel that for querying the Database, POST is not required, we can do it using GET also
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chetany
A Score Level 1
over 7 years ago
Yes, if you are just reading from DB and returning the response in Web API - POST method is not needed. But, if you are getting the data from request body and writing to DB using a!writeToDataStoreEntity() in Web API, then POST is the correct method.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@chetany that's true, I agree
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erick258
over 7 years ago
@chetany I'm using post method for the purpose of passing filter parameter e.g passing a login username and password. And when I'm using Postman it's give me an HTTP 401 Error which is a "JBWEB000121: This request requires HTTP authentication."
@stefanh791 In case of SoapUI it returns a HTTP 404 not found.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
+1
chetany
A Score Level 1
over 7 years ago
You don't need POST method for passing username and password. username and password are sent in header and they are base 64 encoded. The name of the header should be "Authorization" and its value should be "Basic BASE64ENCODE(CONCATENTAION_OF_USERNAME_AND_PASSWORD) " You can do it with GET method too.
In Postman, specify it as "Basic Authorization " under "Authorization" tab, and enter the username and password - it will automatically encode it for you to base64
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
0
chetany
A Score Level 1
over 7 years ago
401 is for incorrect auth. 404 is for incorrect resource.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erick258
over 7 years ago
@chetany The username and password passed here is not for the API Authorization, they are the parameter for the API itself, say they're the parameter needed for some Login Verification API which returns specific value if login is verified.
I have check and recheck the Authorization for Postman, it always return 401 when I'm trying to try out the API using POST method. While for GET method API, it worked out just fine. Is this because all API created by Appian is a GET method API?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erick258
over 7 years ago
edit * all Query database API is a GET method API
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>