cURL
curl -X POST https://api.bizmori.com/api/v2/orders/ai-detection \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"idempotencyKey": "0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59", "fileName": "photo.jpg"}'const response = await fetch('https://api.bizmori.com/api/v2/orders/ai-detection', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
idempotencyKey: '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59',
fileName: 'photo.jpg'
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.bizmori.com/api/v2/orders/ai-detection',
headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
json={'idempotencyKey': '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59', 'fileName': 'photo.jpg'}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bizmori.com/api/v2/orders/ai-detection",
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([
'idempotencyKey' => '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59',
'fileName' => 'photo.jpg',
'orderName' => 'my-detection-order',
'options' => [
'generateHeatmap' => false,
'generateOverlay' => false,
'generateThumbnail' => false
]
]),
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.bizmori.com/api/v2/orders/ai-detection"
payload := strings.NewReader("{\n \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\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.bizmori.com/api/v2/orders/ai-detection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bizmori.com/api/v2/orders/ai-detection")
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 \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"orderId": "<string>",
"orderName": "<string>",
"status": "pending",
"file": {
"fileId": 123,
"fileName": "<string>",
"uploadUrl": "<string>",
"fileKey": "<string>"
}
}
}{
"code": "VALIDATION_FAILED"
}{
"code": "AUTH_NOT_AUTHENTICATED"
}{
"code": "USAGE_LIMIT_EXCEEDED"
}AI Detection
AI Detection注文を作成
AI Detection注文を作成し、画像用のプリサインドS3アップロードURLを発行します。
フロー
- このエンドポイントを呼び出し、プリサインドアップロードURLを受け取ります
- プリサインドURLを使用して画像を直接S3にアップロードします
POST /api/v2/orders/ai-detection/confirmを呼び出して非同期の検知処理を開始します- Webhookまたは注文詳細エンドポイントのポーリングで結果を確認します
注文ステータス
| ステータス | 説明 |
|---|---|
pending | ファイルアップロード待ち |
inProgress | 検知処理中 |
complete | 検知完了、結果を確認可能 |
failed | 検知失敗 |
対応形式
jpg, jpeg, png, webp, bmp, tiff
POST
/
api
/
v2
/
orders
/
ai-detection
cURL
curl -X POST https://api.bizmori.com/api/v2/orders/ai-detection \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"idempotencyKey": "0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59", "fileName": "photo.jpg"}'const response = await fetch('https://api.bizmori.com/api/v2/orders/ai-detection', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
idempotencyKey: '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59',
fileName: 'photo.jpg'
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.bizmori.com/api/v2/orders/ai-detection',
headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
json={'idempotencyKey': '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59', 'fileName': 'photo.jpg'}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bizmori.com/api/v2/orders/ai-detection",
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([
'idempotencyKey' => '0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59',
'fileName' => 'photo.jpg',
'orderName' => 'my-detection-order',
'options' => [
'generateHeatmap' => false,
'generateOverlay' => false,
'generateThumbnail' => false
]
]),
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.bizmori.com/api/v2/orders/ai-detection"
payload := strings.NewReader("{\n \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\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.bizmori.com/api/v2/orders/ai-detection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bizmori.com/api/v2/orders/ai-detection")
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 \"idempotencyKey\": \"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59\",\n \"fileName\": \"photo.jpg\",\n \"orderName\": \"my-detection-order\",\n \"options\": {\n \"generateHeatmap\": false,\n \"generateOverlay\": false,\n \"generateThumbnail\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"orderId": "<string>",
"orderName": "<string>",
"status": "pending",
"file": {
"fileId": 123,
"fileName": "<string>",
"uploadUrl": "<string>",
"fileKey": "<string>"
}
}
}{
"code": "VALIDATION_FAILED"
}{
"code": "AUTH_NOT_AUTHENTICATED"
}{
"code": "USAGE_LIMIT_EXCEEDED"
}承認
外部クライアントアクセス用のBearer APIキー。本番キーは sk_ プレフィックスを使用し、テストキーは sk_test_ プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。
ボディ
application/json
重複リクエストを防ぐための冪等性キー
例:
"0e6c4a9b-b1d8-457e-a9fc-4b7d0e3a6c59"
拡張子を含む画像ファイル名。対応形式: jpg, jpeg, png, webp, bmp, tiff
例:
"photo.jpg"
注文名(任意、未指定の場合は自動生成)
Maximum string length:
64例:
"my-detection-order"
レスポンス
注文が正常に作成されました
Hide child attributes
Hide child attributes
⌘I