API Reference
Upload the file of a bulk import
PUT
/
v1
/
imports
/
{id}
/
file
Upload the file of a bulk import
curl --request PUT \
--url https://api.elastly.ai/v1/imports/{id}/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-ndjson' \
--data '<string>'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/x-ndjson'},
body: '<string>'
};
fetch('https://api.elastly.ai/v1/imports/{id}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/imports/{id}/file"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-ndjson"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/imports/{id}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-ndjson"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.elastly.ai/v1/imports/{id}/file")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-ndjson")
.body("<string>")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/imports/{id}/file"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-ndjson")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "catalog_items",
"source": "api",
"format": "jsonl",
"state": "awaiting_file",
"counts": {
"received": 1,
"accepted": 1,
"imported": 1,
"unresolved": 1,
"failed": 1,
"stale": 1
},
"error": {
"code": "<string>",
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"committedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}Authorizations
Body
application/x-ndjsontext/csv
The body is of type file.
Response
Upload the file of a bulk import
⌘I
Upload the file of a bulk import
curl --request PUT \
--url https://api.elastly.ai/v1/imports/{id}/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-ndjson' \
--data '<string>'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/x-ndjson'},
body: '<string>'
};
fetch('https://api.elastly.ai/v1/imports/{id}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/imports/{id}/file"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-ndjson"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/imports/{id}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-ndjson"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.elastly.ai/v1/imports/{id}/file")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-ndjson")
.body("<string>")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/imports/{id}/file"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-ndjson")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "catalog_items",
"source": "api",
"format": "jsonl",
"state": "awaiting_file",
"counts": {
"received": 1,
"accepted": 1,
"imported": 1,
"unresolved": 1,
"failed": 1,
"stale": 1
},
"error": {
"code": "<string>",
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"committedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}