Aspera

Aspera

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  HTML response instead of JSON

    Posted Wed July 17, 2024 12:28 PM

    Hi, I am currently attempting to send a package and then go into uploading and downloading using the AoC, Node and Transfer SDK APIs. However at the moment I have created the bearer token and run the POST requests but am only getting an HTML response when I need a JSON response. I was wondering if anyone could help? I have tried a variety of things but don't know where the source of the problem is. Any information would be a great help. Thanks!



    ------------------------------
    Kam Dudwal
    ------------------------------


  • 2.  RE: HTML response instead of JSON

    Posted Thu July 18, 2024 04:12 AM

    I suggest 2 things:

    1- try to use the command line ascli : https://github.com/IBM/aspera-cli , you can send a package to AoC, and activate traces: --log-level=debug, that will show API calls including payload.

    2- have a look to examples here: https://github.com/laurent-martin/aspera-api-examples/blob/main/python/src/aoc.py



    ------------------------------
    Laurent Martin
    ------------------------------



  • 3.  RE: HTML response instead of JSON

    Posted Mon July 29, 2024 10:22 AM

    Hi,

    Thank you this was very helpful I was able to upload packages to shared inboxes in python using the Transfer SDK. I was just wondering if the process is the same for downloading a package as it is for uploading with some changes in the transfer spec that is being sent. Are there any example of downloading a package using the transfer SDK, Node API, and/or AoC? 

    Thank you for your help!



    ------------------------------
    Kam Dudwal
    ------------------------------



  • 4.  RE: HTML response instead of JSON

    Posted Mon July 29, 2024 10:38 AM

    The procedure for download of package is similar:

    1- get transfer spec for download by providing the id of package

    2- start transfer using transfer SDK , by giving the transfer spec

    see: https://github.com/IBM/aspera-cli/blob/main/lib/aspera/cli/plugins/faspex5.rb#L383

    While for package send it is:

    1- create a package and get the new id

    2- get transfer spec for upload by providing the id of package

    3- start transfer using transfer SDK , by giving the transfer spec

    see: https://github.com/IBM/aspera-cli/blob/main/lib/aspera/cli/plugins/faspex5.rb#L488

    Of course, for download you will need the package identifier, which either you got by some mean, of you can discover by listing available packages:

    https://github.com/IBM/aspera-cli/blob/main/lib/aspera/cli/plugins/faspex5.rb#L346

    Note that a package can be a personal package or coming from shared inbox, etc...

    Again,  an "easy" way is to use `ascli` in debug mode (or --log-level=trtace2) and look at api calls made.



    ------------------------------
    Laurent Martin
    ------------------------------



  • 5.  RE: HTML response instead of JSON

    Posted Mon August 05, 2024 06:54 AM

    Hi, 

    So I have tried using the ascli commands however I will eventually need to create a user-interface for this functionality. So I have been using python to create a package and upload files to a shared inbox. However, when I try and download from a shared inbox to the local machine, using the aoc.py file on this, https://github.com/laurent-martin/aspera-api-examples/blob/main/python/src/aoc.py, it doesn't connect/download. So I was wondering if you have any tips or other things to try? I can upload a package its just downloading where it isn't working, even thought the transfer-spec sent is pretty much the same as the one the web browser shows.



    ------------------------------
    Kam Dudwal
    ------------------------------