cURL
curl --request POST \
--url https://api.comm.com/api/v1/data-files/{dataFile}/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": {
"number": 1,
"country": 1,
"email": 1,
"name": 1,
"custom1_str": 1,
"custom2_str": 1,
"custom3_str": 1,
"custom4_str": 1,
"custom5_str": 1,
"custom1_int": 1,
"custom2_int": 1,
"custom3_int": 1,
"custom4_int": 1,
"custom5_int": 1,
"custom1_dec": 1,
"custom2_dec": 1,
"custom1_datetime": 1,
"custom2_datetime": 1,
"custom3_datetime": 1,
"custom4_datetime": 1,
"custom5_datetime": 1,
"foreign_id": "<string>",
"timezone": 1
},
"fixed_country_id": 123,
"fixed_network_brand": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.comm.com/api/v1/data-files/{dataFile}/import"
payload = {
"columns": {
"number": 1,
"country": 1,
"email": 1,
"name": 1,
"custom1_str": 1,
"custom2_str": 1,
"custom3_str": 1,
"custom4_str": 1,
"custom5_str": 1,
"custom1_int": 1,
"custom2_int": 1,
"custom3_int": 1,
"custom4_int": 1,
"custom5_int": 1,
"custom1_dec": 1,
"custom2_dec": 1,
"custom1_datetime": 1,
"custom2_datetime": 1,
"custom3_datetime": 1,
"custom4_datetime": 1,
"custom5_datetime": 1,
"foreign_id": "<string>",
"timezone": 1
},
"fixed_country_id": 123,
"fixed_network_brand": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: {
number: 1,
country: 1,
email: 1,
name: 1,
custom1_str: 1,
custom2_str: 1,
custom3_str: 1,
custom4_str: 1,
custom5_str: 1,
custom1_int: 1,
custom2_int: 1,
custom3_int: 1,
custom4_int: 1,
custom5_int: 1,
custom1_dec: 1,
custom2_dec: 1,
custom1_datetime: 1,
custom2_datetime: 1,
custom3_datetime: 1,
custom4_datetime: 1,
custom5_datetime: 1,
foreign_id: '<string>',
timezone: 1
},
fixed_country_id: 123,
fixed_network_brand: '<string>',
tags: ['<string>']
})
};
fetch('https://api.comm.com/api/v1/data-files/{dataFile}/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comm.com/api/v1/data-files/{dataFile}/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'columns' => [
'number' => 1,
'country' => 1,
'email' => 1,
'name' => 1,
'custom1_str' => 1,
'custom2_str' => 1,
'custom3_str' => 1,
'custom4_str' => 1,
'custom5_str' => 1,
'custom1_int' => 1,
'custom2_int' => 1,
'custom3_int' => 1,
'custom4_int' => 1,
'custom5_int' => 1,
'custom1_dec' => 1,
'custom2_dec' => 1,
'custom1_datetime' => 1,
'custom2_datetime' => 1,
'custom3_datetime' => 1,
'custom4_datetime' => 1,
'custom5_datetime' => 1,
'foreign_id' => '<string>',
'timezone' => 1
],
'fixed_country_id' => 123,
'fixed_network_brand' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comm.com/api/v1/data-files/{dataFile}/import"
payload := strings.NewReader("{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comm.com/api/v1/data-files/{dataFile}/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comm.com/api/v1/data-files/{dataFile}/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"size": 123,
"status": "<string>",
"created_at": "<string>",
"created_ago": "<string>",
"columns": "<string>",
"total_rows": "<string>",
"processed_rows": "<string>",
"can_continue": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}DataFiles
Post v1data files import
POST
/
v1
/
data-files
/
{dataFile}
/
import
cURL
curl --request POST \
--url https://api.comm.com/api/v1/data-files/{dataFile}/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": {
"number": 1,
"country": 1,
"email": 1,
"name": 1,
"custom1_str": 1,
"custom2_str": 1,
"custom3_str": 1,
"custom4_str": 1,
"custom5_str": 1,
"custom1_int": 1,
"custom2_int": 1,
"custom3_int": 1,
"custom4_int": 1,
"custom5_int": 1,
"custom1_dec": 1,
"custom2_dec": 1,
"custom1_datetime": 1,
"custom2_datetime": 1,
"custom3_datetime": 1,
"custom4_datetime": 1,
"custom5_datetime": 1,
"foreign_id": "<string>",
"timezone": 1
},
"fixed_country_id": 123,
"fixed_network_brand": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.comm.com/api/v1/data-files/{dataFile}/import"
payload = {
"columns": {
"number": 1,
"country": 1,
"email": 1,
"name": 1,
"custom1_str": 1,
"custom2_str": 1,
"custom3_str": 1,
"custom4_str": 1,
"custom5_str": 1,
"custom1_int": 1,
"custom2_int": 1,
"custom3_int": 1,
"custom4_int": 1,
"custom5_int": 1,
"custom1_dec": 1,
"custom2_dec": 1,
"custom1_datetime": 1,
"custom2_datetime": 1,
"custom3_datetime": 1,
"custom4_datetime": 1,
"custom5_datetime": 1,
"foreign_id": "<string>",
"timezone": 1
},
"fixed_country_id": 123,
"fixed_network_brand": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: {
number: 1,
country: 1,
email: 1,
name: 1,
custom1_str: 1,
custom2_str: 1,
custom3_str: 1,
custom4_str: 1,
custom5_str: 1,
custom1_int: 1,
custom2_int: 1,
custom3_int: 1,
custom4_int: 1,
custom5_int: 1,
custom1_dec: 1,
custom2_dec: 1,
custom1_datetime: 1,
custom2_datetime: 1,
custom3_datetime: 1,
custom4_datetime: 1,
custom5_datetime: 1,
foreign_id: '<string>',
timezone: 1
},
fixed_country_id: 123,
fixed_network_brand: '<string>',
tags: ['<string>']
})
};
fetch('https://api.comm.com/api/v1/data-files/{dataFile}/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comm.com/api/v1/data-files/{dataFile}/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'columns' => [
'number' => 1,
'country' => 1,
'email' => 1,
'name' => 1,
'custom1_str' => 1,
'custom2_str' => 1,
'custom3_str' => 1,
'custom4_str' => 1,
'custom5_str' => 1,
'custom1_int' => 1,
'custom2_int' => 1,
'custom3_int' => 1,
'custom4_int' => 1,
'custom5_int' => 1,
'custom1_dec' => 1,
'custom2_dec' => 1,
'custom1_datetime' => 1,
'custom2_datetime' => 1,
'custom3_datetime' => 1,
'custom4_datetime' => 1,
'custom5_datetime' => 1,
'foreign_id' => '<string>',
'timezone' => 1
],
'fixed_country_id' => 123,
'fixed_network_brand' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comm.com/api/v1/data-files/{dataFile}/import"
payload := strings.NewReader("{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comm.com/api/v1/data-files/{dataFile}/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comm.com/api/v1/data-files/{dataFile}/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": {\n \"number\": 1,\n \"country\": 1,\n \"email\": 1,\n \"name\": 1,\n \"custom1_str\": 1,\n \"custom2_str\": 1,\n \"custom3_str\": 1,\n \"custom4_str\": 1,\n \"custom5_str\": 1,\n \"custom1_int\": 1,\n \"custom2_int\": 1,\n \"custom3_int\": 1,\n \"custom4_int\": 1,\n \"custom5_int\": 1,\n \"custom1_dec\": 1,\n \"custom2_dec\": 1,\n \"custom1_datetime\": 1,\n \"custom2_datetime\": 1,\n \"custom3_datetime\": 1,\n \"custom4_datetime\": 1,\n \"custom5_datetime\": 1,\n \"foreign_id\": \"<string>\",\n \"timezone\": 1\n },\n \"fixed_country_id\": 123,\n \"fixed_network_brand\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"size": 123,
"status": "<string>",
"created_at": "<string>",
"created_ago": "<string>",
"columns": "<string>",
"total_rows": "<string>",
"processed_rows": "<string>",
"can_continue": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The data file ID
Body
application/json
Response
DataFileResource
Show child attributes
Show child attributes
⌘I