Hi everyone,
I created a Web API with the get method. To test it I want to use an integration (created in another appian enviroment) but I have some issue.
I can access to the API with Api key as authentication method but I have this error:
To test the connection I always return this:
{ "test" : "success", "call" : { "url" : "mockURLforExample", "pathSegments" : [ ], "queryParameters" : { }, "headers" : { }, "body" : "" } }
This comes from the api and I don0t have any header or parameters.
I use an integration with GET method without any headers or parameter but the http response is this:
HTTP/1.1 400 Bad Request Date: Tue, 04 Jul 2023 09:35:24 GMT Content-Type: text/html; charset=iso-8859-1 Content-Length: 226 Connection: keep-alive Server: Apache
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> </body></html>
Do you know if is possible to test the web api in this way?
Do you think that the problem is the API?
Thanks,
Daniele
Discussion posts and replies are publicly visible
Hi Daniele
You should be able to call your WebAPI from an Integration in another Appian environment. I assume you're passing the API key value you generated for the associated Service Account?
1. locally it works, I use the test button, so yes for the second question too.
2. I can't test it that way right now, if you know some tool to test it will be very helpful.
Yes, I'm passing the api key generated, I had some problem with authentication but now it works and return this error.
It seems like that the integrations sends a request that isn't compatible with the Web API
A lots of developer sue Postman as a tool for testing Web Services:
https://www.postman.com/downloads/
It's a useful tool to test independently of Appian.
Thank you a lot, I'll test it as soon as possible
Sorry but I'm having trouble with postman.I don't know if the problem is my API or my configuration, do you know a tutorial that I can Follow?What is it an example of request that I have to send to my get API?
Thanks,Daniele
It's a get request so you just need to call it with the API key in the header. You could also just try a curl request as described here: https://docs.appian.com/suite/help/23.2/Web_API_Authentication.html
curl https://example.appian.com/suite/webapi/endpoint -H "Appian-API-Key: ${API_KEY}"
Otherwise, maybe you can post screenshots of both your Web API and Integration/Connected System - might be easier.