Payables & Cash Management

Get Involved. Join the Conversation.

Topic

    Krishnan Venkatachalam
    Invoice REST API - Error Download Managed URL Invoices
    Topic posted September 12, 2019 by Krishnan VenkatachalamBronze Medal: 1,250+ Points, tagged Financials, Invoice Imaging, Payables 
    40 Views, 6 Comments
    Title:
    Invoice REST API - Error Download Managed URL Invoices
    Summary:
    Unable to download Invoices that are Scanned In
    Content:

    Hi All,

    I am trying to come up with code that can download invoice attachments. I am using the REST API  (https://docs.oracle.com/en/cloud/saas/financials/18c/farfa/op-invoices-invoiceid-child-attachments-get.html) to try and download the attachment.

    It works if the invoice is manually created ("name": "FileContents" JSON), however if the Invoice was sent as a Scanned one (via KOFAX) this fails. In fact the attachment Type (which indicates the type of attachment) is Managed URL vs a FILE. Has someone overcome this issue before?

    Regards,

     

    Comment

     

    • Becky Alvarez

      The only thing I can offer here is that you need to make sure the invoice has successfully been created and validated or at least needs validation.  Then I would try the following (maybe you already have)

      1. Try and manually add the URL attachment to the Scanned invoice and see if you can successfully add it.  Make sure the invoice is in the same status it is in when you are doing it via the REST API
      2. Test with another API such as the SOAP Web Service for Invoice Attachment and see if the attachment works successfully
      3. If you still can't figure out your issue try and log an SR.

      Or maybe someone else has some other options.

      • Krishnan Venkatachalam

        Thanks for the response Becky. All invoices are validated and posted and I do have an SR open :)

        The SOAP service also fails (it basically downloads the login page). I think we have figured out a work around, Once I have it working will post the solution here.

        Regards,

    • Krishnan Venkatachalam

      For Folks who are interested, here is the solution for this whole thing:
      1. The REST API should be able to provide the file type, if the file type is FILE then use the FileContents link to download it
      2. If the FILE type is managed URL that means you now have to go to the Web Center Image component. This is made up of two individual services
          - Login Service (requires security header and comes back with Jsession cookie)
          - Document Download service (will not take the security header but the cookie generated step before)
           Reference - https://docs.oracle.com/cd/E29542_01/dev.1111/e12784/api.htm#IPMDV10139 
           Between the Login Service and download service when you knock up the code (I did .NET) you have to be innovative on passing off the security info.

      Worked for me :).. Well I have not tried any other sources yet.

      PS: I did not use the default attachment SOAP service as it would not download the imaged invoice or provide the file name for tracking.

      Regards,

      • Becky Alvarez

        Krishnan,

        Thank you so much for sharing this.  I am sure many were interested and will benefit from your experience.  This is why we created Customer Conned and we appreciate you sharing in the true spirit of collaboration.

      • marcelo scalia

        Hi Krishnan,

        We are also experiencing issues with the REST API to download an invoice attachment. We have also coded a solution in .NET to download or display in-browser the image... however we are interminently seeing HTTP 404 URI not found error returned. Some times it works and some times it doesn't.

        Have you had the same issue when trying to download /view individual invoice attachments?

        CHeers, Marcelo