特定のバッチに対して完了または失敗したアイテムリストをオプションでコンテンツと共に取得
curl --request GET \
--url https://api.olostep.com/v1/batches/{batch_id}/items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olostep.com/v1/batches/{batch_id}/items"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olostep.com/v1/batches/{batch_id}/items', 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.olostep.com/v1/batches/{batch_id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches/{batch_id}/items"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.olostep.com/v1/batches/{batch_id}/items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches/{batch_id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"batch_id": "batch_abc123def456",
"object": "list",
"status": "completed",
"items": [
{
"custom_id": "product-123",
"retrieve_id": "ret_xyz789",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"retrieve_id": "ret_abc456",
"url": "https://example.com/product/456"
}
],
"items_count": 2
}{
"id": "error_abc123",
"object": "error",
"code": "validation_error",
"type": "https://docs.olostep.com/api-reference/errors/bad_request",
"status": 400,
"title": "不正なリクエスト",
"detail": "Status must be either 'completed' or 'failed'",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/api-reference/errors/unauthorized",
"status": 401,
"title": "認証されていません",
"detail": "Your API key is invalid",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "batch_not_found",
"type": "https://docs.olostep.com/api-reference/errors/not_found",
"status": 404,
"title": "見つかりません",
"detail": "Batch not found",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "内部サーバーエラー",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}バッチ
バッチアイテム
バッチで処理されたアイテムのリストを取得します。その後、retrieve_id を使用して Retrieve エンドポイントでコンテンツを取得できます。
GET
/
v1
/
batches
/
{batch_id}
/
items
特定のバッチに対して完了または失敗したアイテムリストをオプションでコンテンツと共に取得
curl --request GET \
--url https://api.olostep.com/v1/batches/{batch_id}/items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olostep.com/v1/batches/{batch_id}/items"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olostep.com/v1/batches/{batch_id}/items', 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.olostep.com/v1/batches/{batch_id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches/{batch_id}/items"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.olostep.com/v1/batches/{batch_id}/items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches/{batch_id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"batch_id": "batch_abc123def456",
"object": "list",
"status": "completed",
"items": [
{
"custom_id": "product-123",
"retrieve_id": "ret_xyz789",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"retrieve_id": "ret_abc456",
"url": "https://example.com/product/456"
}
],
"items_count": 2
}{
"id": "error_abc123",
"object": "error",
"code": "validation_error",
"type": "https://docs.olostep.com/api-reference/errors/bad_request",
"status": 400,
"title": "不正なリクエスト",
"detail": "Status must be either 'completed' or 'failed'",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/api-reference/errors/unauthorized",
"status": 401,
"title": "認証されていません",
"detail": "Your API key is invalid",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "batch_not_found",
"type": "https://docs.olostep.com/api-reference/errors/not_found",
"status": 404,
"title": "見つかりません",
"detail": "Batch not found",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "内部サーバーエラー",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}メタデータ: バッチを作成する際に個々のアイテムに
metadata を添付した場合、レスポンス内の各アイテムにそのメタデータが返されます。承認
Bearer 形式のBearer認証ヘッダー。はあなたの認証トークンです。
パスパラメータ
アイテムを取得するバッチのID。
クエリパラメータ
取得するURLのステータス(completedまたはfailed)。
利用可能なオプション:
completed, failed 返す結果の数(推奨は10〜50)。
このページは役に立ちましたか?
⌘I