Conversion Status API
概要: 文書変換ジョブの実行状況を確認するAPIです。ジョブの進行状況(処理待ち、実行中、完了、失敗)をリアルタイムで監視できます。
GET /v1/user/conversions/{conversion_id}/status
変換ジョブの実行ステータスを返します。
ジョブ結果を確認するための変換ID(conversion_id)を渡します。
GET /v1/user/conversions/{conversion_id}/status
Headers
api-key: string(required) - rokadoc APIキー
必須パラメータ
conversion_id: string(required) - 変換ID(パスパラメータ)
オプショナルパラメータ
space_id: string(optional) - スペース機能を利用する場合はスペースIDを指定
Request Example
- Python
- curl
import requests
import os
api_key = os.getenv("ROKADOC_API_KEY")
conversion_id = os.getenv("CONVERSION_ID")
space_id = os.getenv("SPACE_ID")
url = f"https://api.rokadoc.ntt.com/v1/user/conversions/{conversion_id}/status"
headers = {
"api-key": api_key,
"accept": "application/json"
}
params = {}
if space_id:
params["space_id"] = space_id
response = requests.get(url, headers=headers, params=params)
print(response.json())
curl -X 'GET' \
"https://api.rokadoc.ntt.com/v1/user/conversions/${CONVERSION_ID}/status?space_id=${SPACE_ID}" \
-H "api-key: ${ROKADOC_API_KEY}" \
-H 'accept: application/json'
Response
200 OK - ジョブの実行状況
{
"code": 200,
"data": {
"status": "Running",
"conversion_id": "xxxx",
"document_name": "sample.pdf"
}
}
code: integer - ステータスコードdata.status: string - ジョブのステータスPending: 処理待ちRunning: 実行中Succeeded: 完了Failed: 失敗Retrying: リトライ中
data.conversion_id: string - 変換IDdata.document_name: string - ドキュメント名
404 Not Found - 変換IDが存在しない
指定した conversion_id が存在しない、または自身(または所属スペース)に紐付かない場合に返ります。
{
"error": {
"code": 404,
"message": "Not Found",
"details": "リソースが見つかりませんでした。"
}
}
注意事項
- ステータスは Pending → Running → Succeeded の順で変化します
- 失敗した場合はFailedステータスが返されます