Uploading a PDF File via PHP API

Running PHP 5.3.3

Trying to use the PHP API to upload a pdf file that I pull from AWS S3 and attach it to a deal (Currently via linux console, but eventually as a CRON).
I’m able to download the pdf just fine to a local directory, but I’m running into issues trying to actually push the file into pipedrive via CURL.

Did you have a look at this library? https://github.com/IsraelOrtuno/pipedrive

Once you have your file locally, you can just run

$pipedrive = new Devio\Pipedrive\Pipedrive('xxxxxxxxxx');
$file = new \SplFileInfo('attachment.png');
$pipedrive->files->add([
    'file'   => $file,
    'deal_id' => 12
]);

It’s probably much easier than preparing the request yourself.
I just checked and it works pretty well… :slight_smile:

1 Like

Hey @rileydyck I believe your colleague Darin opened a support ticket on which I’ve replied with a solution earlier today. Please feel free to reply on my email in case you find any other issues :wink:

1 Like