Jump to content

Python/API - How to download an attachment file from a specific request type?


Recommended Posts

Hello,

I wonder, if someone could help me with finalising my API integration using Python scripting or advise on the alternative/more efficient approach.

I have browsed existing threads on this forum and read various Hornbill documentation pages, but have not managed to put together a fully working process.

Using xmlmc libraries, I have successfully retrieved information about my request and an attachment.

image.png.0cd990e0fae4f623ac1004a0e2ccf0d8.png

However, I have not managed to get the h_contentlocation info mentioned in another thread.

I wasn't able to successfully execute smGetAttachments or find any supporting information about this process. Has it been phased out? How to use it with Python scripting?

 

Following above thread I have manually called API below, that completed successfully, however have not provided content of the file - got some HTML webpage headers instead. What could go wrong?

https://live.hornbill.com/YOURINSTANCEID/php/attachment.php?application=com.hornbill.servicemanager&entity=Requests&key=IN00012345&filepath=attachmentname.pdf&secure=true

I would appreciate any help on this topic.

Regards

Norbert

Link to comment
Share on other sites

  • 2 weeks later...
On 28/11/2023 at 16:36, Norbert said:

I wasn't able to successfully execute smGetAttachments or find any supporting information about this process. Has it been phased out?

I can only usefully refer you to Gerry's post on another thread:

Which I can summarise by saying if it's not visible on the Hornbill Documents site then it's not supported.

Additionally (and I'm happy to stand corrected if Development need to do so) my understanding is that we have completed the removal of php from the platform, which would explain the link you posted above not working - and it appears this is based on a 3 year old thread, so it's quite likely that information is out of date.

Link to comment
Share on other sites

Just on the point @Steve Giller mentioned, PHP has not been used in our code base for more than 8 years.  Our API's are pretty generic though, so they certainly usable from PHP if requiired.  Because our API stack is focused on JSON now, especially for customer-facing API's there is no longer any need for us to provide platform-specific API libraries, just use the standerd RPC/REST style API's, they are simple and easy to use from pretty much every language that works with modern web stuff.  Our docs to contain examples in numerous languages. 

Gerry 

Link to comment
Share on other sites

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...