(API) How to download your files from a P2 - Pull

How to download files by P2 Request of Pull type:

Instructions

First of All, you must create an P2 containing a type Pull, follow the link to do that: https://botdoc.atlassian.net/wiki/spaces/BOTDOC/pages/41812142 and send to the Receiver, when the Receiver uploads their files, you are able to download the file(s):

  1. To Know how to download files coming from a P2 Pull Request, first you need to GET a list of Media belonging to a determined Pull:

    curl -i --request GET "https://api.botdoc.io/v1/module_container_pull/pull/{pull_id}/pull_file/" \ --header "Authorization: JWT <Authorization Token>" \

     

  2. Based on the list in item 1, you need to GET the Media using this cURL:

    curl -i --request GET "https://api.botdoc.io/v1/module_container_pull/pullfile/{pull_file_id}/download/" \ --header "Authorization: JWT <Authorization Token>" \ --output myfile.jpg