import requests
with open('qwerty.csv', 'rb') as f:
r = requests.post('https://api.pipedrive.com/v1/files',
params={'api_token': 'MY_TOKEN'}, files={'file': f})
Could I please have an example of uploading a file in NodeJS?
Because I am getting an error as Pipedrive API error:Invalid File Create request - data contains invalid keys while adding a file by using the endpoint (pipedrive.Files.add(data, [callback])). I have used the data keys as per the given documentations.
My data to upload the file is shown below.
let dataToAddFile = {
file: pdfToBeUploaded,
deal_id: 1
}