curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/email/upload' \
--header 'Authorization: Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c' \
--form 'file=@"<path-to-file>"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/home/sahil/Downloads/welcome-screen.png'));
var config = {
method: 'post',
url: 'https://api.zixflow.com/api/v1/campaign/email/upload',
headers: {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "https://api.zixflow.com/api/v1/campaign/email/upload"
payload={}
files=[
('file',('welcome-screen.png',open('/home/sahil/Downloads/welcome-screen.png','rb'),'image/png'))
]
headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","welcome-screen.png",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/home/sahil/Downloads/welcome-screen.png")))
.build();
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/email/upload")
.method("POST", body)
.addHeader("Authorization", "Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/email/upload'));
request.files.add(await http.MultipartFile.fromPath('file', '/home/sahil/Downloads/welcome-screen.png'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"data": {
"filename": "file-welcome-screen-1672054415115.png",
"size": 7343,
"dateadded": "2022-12-26T11:33:36.2633971Z",
"expirationdate": null,
"fileid": "63a98690b0ec6c81460f4f1d",
"contenttype": "image/png",
"mediumscreenshotpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/mediumscreenshots/file-welcome-screen-1672054415115.png",
"thumbnailpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/thumbnails/file-welcome-screen-1672054415115.png"
},
"message": "Successfully uploaded file"
}
{
"status": false,
"message": "file size exceeded"
}
{
"status": false,
"message": "No token provided"
}
Email Campaign
Upload Attachment
This API used to upload attachments in zixflow platform. Purpose of API is whenever the user wants to send an attachment in the email. user need to upload attachment in zixflow platform first. zixflow will provide id represents to attachment. and the user can send this id in send email API’s attachment field to send attachment along with the email
POST
/
api
/
v1
/
campaign
/
email
/
upload
curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/email/upload' \
--header 'Authorization: Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c' \
--form 'file=@"<path-to-file>"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/home/sahil/Downloads/welcome-screen.png'));
var config = {
method: 'post',
url: 'https://api.zixflow.com/api/v1/campaign/email/upload',
headers: {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "https://api.zixflow.com/api/v1/campaign/email/upload"
payload={}
files=[
('file',('welcome-screen.png',open('/home/sahil/Downloads/welcome-screen.png','rb'),'image/png'))
]
headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","welcome-screen.png",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/home/sahil/Downloads/welcome-screen.png")))
.build();
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/email/upload")
.method("POST", body)
.addHeader("Authorization", "Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/email/upload'));
request.files.add(await http.MultipartFile.fromPath('file', '/home/sahil/Downloads/welcome-screen.png'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"data": {
"filename": "file-welcome-screen-1672054415115.png",
"size": 7343,
"dateadded": "2022-12-26T11:33:36.2633971Z",
"expirationdate": null,
"fileid": "63a98690b0ec6c81460f4f1d",
"contenttype": "image/png",
"mediumscreenshotpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/mediumscreenshots/file-welcome-screen-1672054415115.png",
"thumbnailpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/thumbnails/file-welcome-screen-1672054415115.png"
},
"message": "Successfully uploaded file"
}
{
"status": false,
"message": "file size exceeded"
}
{
"status": false,
"message": "No token provided"
}
Body
file
required
The “File” field refers to an attachment file that must be included in an
email campaign. The file can be in any format, and its size should not exceed
25 megabytes (MB).
Response
boolean
Indicates whether the call was successful. true if successful, false if not.
string
success or error response message
object
The contents of uploaded file
Show data
Show data
string
The name of the file.
integer
The size of the file in bytes.
string
The date and time the file was added.
string
The expiration date of the file (if specified).
string
The unique identifier of the file.
string
The content type of the file.
string
The path to the medium-sized screenshot.
string
The path to the thumbnail.
curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/email/upload' \
--header 'Authorization: Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c' \
--form 'file=@"<path-to-file>"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/home/sahil/Downloads/welcome-screen.png'));
var config = {
method: 'post',
url: 'https://api.zixflow.com/api/v1/campaign/email/upload',
headers: {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "https://api.zixflow.com/api/v1/campaign/email/upload"
payload={}
files=[
('file',('welcome-screen.png',open('/home/sahil/Downloads/welcome-screen.png','rb'),'image/png'))
]
headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","welcome-screen.png",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/home/sahil/Downloads/welcome-screen.png")))
.build();
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/email/upload")
.method("POST", body)
.addHeader("Authorization", "Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer 56616641ee123b80a36b99fedc2bfa4f0d7f63072d97ddb1578c7a5aa970e7edde6618c7f750beb921aee3eebc9cc48899ee992fa4eb95a663d0e0b2eaa35b73f3b2344c'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/email/upload'));
request.files.add(await http.MultipartFile.fromPath('file', '/home/sahil/Downloads/welcome-screen.png'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"data": {
"filename": "file-welcome-screen-1672054415115.png",
"size": 7343,
"dateadded": "2022-12-26T11:33:36.2633971Z",
"expirationdate": null,
"fileid": "63a98690b0ec6c81460f4f1d",
"contenttype": "image/png",
"mediumscreenshotpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/mediumscreenshots/file-welcome-screen-1672054415115.png",
"thumbnailpath": "93b7fbda-4306-4ab7-bb80-e4375750ea76/thumbnails/file-welcome-screen-1672054415115.png"
},
"message": "Successfully uploaded file"
}
{
"status": false,
"message": "file size exceeded"
}
{
"status": false,
"message": "No token provided"
}
⌘I