...
Code Block |
---|
string fileDataBase64 = Convert.ToBase64String(File.ReadAllBytes("./assets/file.zip"));
object[] fileDataList = new[] {
new
{
value = new
{
value = fileDataBase64,
mimeType = "application/zip"
}
}
};
|
Code Block |
---|
file_data = open("./assets/file.zip", "rb").read()
file_data_base64 = base64.b64encode(file_data).decode("utf-8") # .decode("utf-8") so that it's a string
file_data_list = [
{
"value": {
"value": file_data_base64,
"mimeType": "application/zip"
}
}
]
|
Code Block |
---|
let fileDataBase64 = await fs.readFile("./assets/file.zip", { encoding: 'base64' });
let fileDataList = [
{
"value": {
"value": fileDataBase64,,
"mimeType": "application/zip"
}
}
];
|
PhotoCheck
Photo are somewhat different from other checks, as you have to provide a mime type for every photo you send to the API. For a list of all allowed mime types visit Allowed MIME types for PhotoChecks.
Code Block |
---|
string photoDataBase64 = Convert.ToBase64String(File.ReadAllBytes("./assets/photo.png"));
object photoDataObject = new
{
value = new
{
value = photoDataBase64,
mimeType = "image/png"
}
};
|
Code Block |
---|
photo_data = open("./assets/photo.png", "rb").read()
photo_data_base64 = base64.b64encode(photo_data).decode("utf-8") # .decode("utf-8") so that it's a string
photo_data_object = {
"value": {
"value": photo_data_base64,
"mimeType": "image/png"
}
}
|
Code Block |
---|
let photoDataBase64 = await fs.readFile("./assets/photo.png", { encoding: 'base64' });
let photoDataObject = {
"value": {
"value": photoDataBase64,
"mimeType": "image/png"
}
};
|
Notice that we don't use a list here like we do with FileChecks.
...