cURL
curl -X POST https://api.bizmori.com/api/v2/orders/webhooks \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Webhook",
"url": "https://example.com/webhook"
}'const response = await fetch('https://api.bizmori.com/api/v2/orders/webhooks', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Webhook',
url: 'https://example.com/webhook'
})
});
const data = await response.json();
// Save data.data.secret securely — it won't be shown againimport requests
response = requests.post(
'https://api.bizmori.com/api/v2/orders/webhooks',
headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
json={
'name': 'My Webhook',
'url': 'https://example.com/webhook'
}
)
data = response.json()
# Save data['data']['secret'] securely — it won't be shown again<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bizmori.com/api/v2/orders/webhooks",
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([
'url' => 'https://example.com/webhook',
'name' => '<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.bizmori.com/api/v2/orders/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"name\": \"<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.bizmori.com/api/v2/orders/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bizmori.com/api/v2/orders/webhooks")
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 \"url\": \"https://example.com/webhook\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"secret": "<string>"
}
}{
"code": "VALIDATION_FAILED"
}{
"code": "AUTH_NOT_AUTHENTICATED"
}Webhooks
Webhookを作成
新しいWebhookを登録します。
- 複数のWebhookを登録可能
- 登録時に署名シークレットが返却されます
重要: シークレットはこのレスポンスでのみ表示されます。安全に保管してください。
Webhookイベントタイプ
| イベントタイプ | 説明 |
|---|---|
order.antiAi.completed | Anti-AI処理が完了 |
order.antiAi.failed | Anti-AI処理が失敗 |
order.watermarkEmbed.completed | watermark 埋め込みが完了 |
order.watermarkEmbed.failed | watermark 埋め込みが失敗 |
order.watermarkExtract.completed | watermark 抽出が完了 |
order.watermarkExtract.failed | watermark 抽出が失敗 |
署名検証
Webhookリクエストには X-MoriBiz-Signature ヘッダーが含まれます。
署名は、登録時に発行されたシークレットを使用してHMAC-SHA256で生成されます。
const crypto = require('crypto');
const signature = crypto.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
リトライポリシー
- 最大3回リトライ
- 指数バックオフ(1秒、2秒、4秒)
- 成功レスポンス: 2xxステータスコード
POST
/
api
/
v2
/
orders
/
webhooks
cURL
curl -X POST https://api.bizmori.com/api/v2/orders/webhooks \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Webhook",
"url": "https://example.com/webhook"
}'const response = await fetch('https://api.bizmori.com/api/v2/orders/webhooks', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Webhook',
url: 'https://example.com/webhook'
})
});
const data = await response.json();
// Save data.data.secret securely — it won't be shown againimport requests
response = requests.post(
'https://api.bizmori.com/api/v2/orders/webhooks',
headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
json={
'name': 'My Webhook',
'url': 'https://example.com/webhook'
}
)
data = response.json()
# Save data['data']['secret'] securely — it won't be shown again<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bizmori.com/api/v2/orders/webhooks",
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([
'url' => 'https://example.com/webhook',
'name' => '<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.bizmori.com/api/v2/orders/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"name\": \"<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.bizmori.com/api/v2/orders/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bizmori.com/api/v2/orders/webhooks")
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 \"url\": \"https://example.com/webhook\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"secret": "<string>"
}
}{
"code": "VALIDATION_FAILED"
}{
"code": "AUTH_NOT_AUTHENTICATED"
}承認
外部クライアントアクセス用のBearer APIキー。本番キーは sk_ プレフィックスを使用し、テストキーは sk_test_ プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。
ボディ
application/json
⌘I