RyanMesser Posted January 31, 2019 Posted January 31, 2019 Hi Guys, Have been trying to pull from the API, I have created a key and tried running GET /session/?op=getSessionInfo to api.hornbill.com but all it seems to return is the API help page? I've been doing this postman, and i'm sending the API key in the header like Authorization: ESP-API <apikey> Probably doing something wrong Thanks
Steve G Posted January 31, 2019 Posted January 31, 2019 Hi @RyanMesser, To call the Hornbill APIs you need to make a POST request to the endpoint, and provide the XML payload in the body as defined in the API documentation . So to get the session information, you request would look like: With the following headers set: Cheers, Steve
RyanMesser Posted January 31, 2019 Author Posted January 31, 2019 Hi Steve, I tried doing post previously and received 501 in Postman, so not sure if I need to setup anything other than API Key in the admin portal? Or something else I'm missing in Postman? My request below with key and instance name omitted.
Steve G Posted January 31, 2019 Posted January 31, 2019 Hi @RyanMesser, You'd get a 501 returned if the request type was set to something other than GET or POST as those are the only methods enabled on the web servers. I've tried a POST to that service for your instance and I get a status of 200 back as expected - with an error in the body telling me that the API key is incorrect Can you add this request to its own Postman collection, then share it and send me the link in a private message please? If so, then I can import it into my Postman and see what's going wrong. Thanks, Steve
RyanMesser Posted January 31, 2019 Author Posted January 31, 2019 Hi Steve, I've just tried it and now I'm getting 200 OK? I doubled check to see I wasn't using an Environment in Postman and I wasn't but now it works, strange... I have only ever been doing GET or POST as that is all I need. Very odd. Ryan
Steve G Posted January 31, 2019 Posted January 31, 2019 Hi @RyanMesser, Ah ok, glad it's working Let me know if you need any other pointers. Cheers, Steve
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now