Import one file now with a feed
curl --request POST \
--url https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"as_of": "2023-12-25",
"csv": "<string>",
"filename": "<string>",
"import_id": "<string>",
"s3_key": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run"
payload = {
"as_of": "2023-12-25",
"csv": "<string>",
"filename": "<string>",
"import_id": "<string>",
"s3_key": "<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({
as_of: '2023-12-25',
csv: '<string>',
filename: '<string>',
import_id: '<string>',
s3_key: '<string>'
})
};
fetch('https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run', 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.statisfy.com/v1/integrations/imports/feeds/{name}/run",
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([
'as_of' => '2023-12-25',
'csv' => '<string>',
'filename' => '<string>',
'import_id' => '<string>',
's3_key' => '<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.statisfy.com/v1/integrations/imports/feeds/{name}/run"
payload := strings.NewReader("{\n \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\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.statisfy.com/v1/integrations/imports/feeds/{name}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run")
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 \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"feed": "<string>",
"file_name": "<string>",
"id": "<string>",
"object": "<string>",
"rows": {
"created": 123,
"empty": 123,
"failed": 123,
"skipped": 123,
"succeeded": 123,
"total": 123
},
"source": "upload",
"status": "queued"
}integrations
Import one file now with a feed
Import one file now with a feed’s saved config, whether the feed is on or off, through the same job a file that arrives goes through: a file the feed received (import_id: one held while it was off, or one that failed), the whole file as CSV text (csv), or an object under an S3 feed’s prefix (s3_key). as_of files the usage under a given period (csv or s3_key, on a feed without a date column). Returns the import, queued or running: follow it with integrations.get_import. A file imported already is a 409. Send an Idempotency-Key, so a retried call doesn’t import twice.
POST
/
v1
/
integrations
/
imports
/
feeds
/
{name}
/
run
Import one file now with a feed
curl --request POST \
--url https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"as_of": "2023-12-25",
"csv": "<string>",
"filename": "<string>",
"import_id": "<string>",
"s3_key": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run"
payload = {
"as_of": "2023-12-25",
"csv": "<string>",
"filename": "<string>",
"import_id": "<string>",
"s3_key": "<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({
as_of: '2023-12-25',
csv: '<string>',
filename: '<string>',
import_id: '<string>',
s3_key: '<string>'
})
};
fetch('https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run', 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.statisfy.com/v1/integrations/imports/feeds/{name}/run",
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([
'as_of' => '2023-12-25',
'csv' => '<string>',
'filename' => '<string>',
'import_id' => '<string>',
's3_key' => '<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.statisfy.com/v1/integrations/imports/feeds/{name}/run"
payload := strings.NewReader("{\n \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\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.statisfy.com/v1/integrations/imports/feeds/{name}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/integrations/imports/feeds/{name}/run")
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 \"as_of\": \"2023-12-25\",\n \"csv\": \"<string>\",\n \"filename\": \"<string>\",\n \"import_id\": \"<string>\",\n \"s3_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"feed": "<string>",
"file_name": "<string>",
"id": "<string>",
"object": "<string>",
"rows": {
"created": 123,
"empty": 123,
"failed": 123,
"skipped": 123,
"succeeded": 123,
"total": 123
},
"source": "upload",
"status": "queued"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
application/json
Response
200 - application/json
Successful Response
Was this page helpful?