I'm using Postman and trying to send a POST request to an API with an image, one of the required parameters to do so is a file "Base 64 encoded file content string. Maximum file size to upload 5Mb". Not sure what else I can try.
the example they give in the documentation is:
"file": "https://example.com/image.png"
*from:
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax/send -d "{"did_from": 3332224444, "did_to": 1112223333, "file": "https://example.com/image.png"}"
I tried uploading a test image to a image hosting site then included its link that but got: "error": "File Type is not Supported" (My test image was also a png) filetypes accepted are:(string)jpeg, jpg, gif, png, tif, tiff, pdf, doc, rtf, ods, xls, csv, ppt, txt, rar, zip, 7z4
I've also tried running my test image through https://www.base64decode.org/ then used the string it output but received an error saying URI was to long.
*I also just tried uploading the file, got the same File Type is not Supported error:
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api2.questblue.com/fax/send',
'headers': {
'Content-type': 'application/json',
'Security-Key': 'key',
'Authorization': 'auth'
},
formData: {
'did_from': 3332224444,
'did_to': 1112223333,
'filename': 'testfax',
'file': {
'value': fs.createReadStream('C:/Users/zee/folder/testfax.jpg'),
'options': {
'filename': 'C:/Users/zee/folder/testfax.jpg',
'contentType': null
}
}
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});```