Jump to content

Recommended Posts

Posted

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

Posted

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:

image.png

With the following headers set:

image.png

Cheers,

Steve

Posted

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. 

1490036057_Postmanrequest.thumb.PNG.d9c358200951abb4e8df3d1f9ef5dd4b.PNGCapture2.thumb.PNG.512a26982034e7c6205a5bf6df494711.PNG

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...