As I’m writing a POSTmethod to send files from my API toPipeDrive API and I encountered a convertion problem(or the lack of convertion).
This is the code Im converting a file with extension (PDF or Excel)
As documentation says the file should be send as a binary file.This is my code in c# to convert the file.
Byte bytes = System.IO.File.ReadAllBytes(filePath); String file = Convert.ToBase64String(bytes) [...] body.Add(new StreamContent(File.OpenRead(filePath)), "file", fileName) var response = client.SendAsync(request).Result;
The file is saved in bytes on pipedrive (I see it as I download them from PipeDrive).
How should I code the file so it will be readable on PipeDrive?