RouteMate API
POST /v1/integration-importリクエスト
{
"external_job_id": "BATCH-001",
"title": "Morning Deliveries",
"driver_email": "driver@example.com",
"stops": [
{
"external_stop_id": "STOP-1",
"address": "1 George St, Brisbane QLD 4000",
"label": "Customer A",
"parcel_count": 2
}
]
}レスポンス
{
"job_id": "e7ad097b-...",
"optimization": {
"total_distance_km": 12.4,
"total_duration_minutes": 25
},
"stops": [ /* optimized order */ ],
"warnings": [...]
}認証情報を取得
RouteMate ダッシュボードの設定画面で client ID と secret を生成します。
トークンを取得
認証情報を 1 時間有効な bearer token に交換します。
API を呼び出す
取込やステータス確認のリクエストで Authorization ヘッダーにトークンを含めます。
認証
クライアントクレデンシャルフロー
RouteMate API は OAuth2 の client credentials フローを利用します。client ID と secret を短時間有効な bearer token に交換し、以後のリクエストの Authorization ヘッダーに含めます。
01
認証情報を取得
RouteMate ダッシュボードの設定画面で client ID と secret を生成します。
02
トークンを取得
認証情報を 1 時間有効な bearer token に交換します。
03
API を呼び出す
取込やステータス確認のリクエストで Authorization ヘッダーにトークンを含めます。
API
主要 API エンドポイント
これらのエンドポイントで、配送ワークフローの主要な連携タスクをカバーできます。
POST
/v1/integration-tokenアクセストークンを取得
client credentials を 1 時間有効な短期アクセストークンに交換します。
リクエスト
{
"client_id": "rm_ci_your_client_id",
"client_secret": "rm_cs_your_client_secret"
}レスポンス
{
"access_token": "rm_at_e5988dd1b91a...",
"token_type": "Bearer",
"expires_in": 3600
}POST
/v1/integration-importジョブを取り込みルートを最適化
停止地点付きジョブを取り込み、住所をジオコーディングし、ルートを最適化してドライバーに割り当てます。
リクエスト
{
"external_job_id": "BATCH-001",
"title": "Morning Deliveries",
"driver_email": "driver@example.com",
"stops": [
{
"external_stop_id": "STOP-1",
"address": "1 George St, Brisbane QLD 4000",
"label": "Customer A",
"parcel_count": 2
}
]
}レスポンス
{
"job_id": "e7ad097b-...",
"optimization": {
"total_distance_km": 12.4,
"total_duration_minutes": 25
},
"stops": [ /* optimized order */ ],
"warnings": [...]
}GET
/v1/integration-jobsジョブステータスを確認
ジョブと停止地点の状態、配送進捗、件数を確認できます。
リクエスト
// GET requestレスポンス
{
"job_id": "e7ad097b-...",
"status": "assigned",
"stop_count": 3,
"status_counts": {
"pending": 2,
"completed": 1
},
"stops": [...]
}コード例
数分で開始
以下の例を使って認証、ジョブ取込、配送ステータス確認を始められます。
curl
curl -X POST https://api.routemate.app/v1/integration-token \
-H "Content-Type: application/json" \
-d '{"client_id":"rm_ci_your_client_id","client_secret":"rm_cs_your_client_secret"}'node
const tokenRes = await fetch("https://api.routemate.app/v1/integration-token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
client_id: "rm_ci_your_client_id",
client_secret: "rm_cs_your_client_secret",
}),
});python
import requests
token_res = requests.post(
"https://api.routemate.app/v1/integration-token",
json={
"client_id": "rm_ci_your_client_id",
"client_secret": "rm_cs_your_client_secret",
},
)SaaS チーム向け
初日から本番運用に対応
信頼性の高い配送フロー、リトライ、後続処理を前提に設計されています。
安全な認証
短時間有効な bearer token と制御された認証情報の受け渡し。
高速インポート
自社システムから配送データを 1 リクエストで送信。
安全なリトライ
冪等キーを使って失敗したリクエストを安全に再実行。
状況の可視化
ジョブと停止地点の進捗をプログラムから追跡。