アップロード済みのファイルまたは GitHub リポジトリを、既存のセッションにリソースとしてアタッチします。
注意事項
パスパラメーター
| パラメーター | タイプ | 説明 |
|---|---|---|
|
|
string |
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
|
|
はい |
|
|
|
はい |
|
リクエストボディ
| フィールド | タイプ | 必須 | 説明 |
|---|---|---|---|
|
|
array | はい | リソースオブジェクトの配列 |
|
|
string | はい | |
|
|
string | はい | Files API から取得したファイル ID |
リクエスト例
curl -X POST https://api.qoder.com.cn/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/resources \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"resources": [
{"type": "file", "file_id": "file_abc123def456"}
]
}'
レスポンス例
HTTP 200 OK
新しい
エラー
| HTTP | タイプ | トリガー |
|---|---|---|
| 400 |
|
不正なリクエスト (例: |
| 401 |
|
PAT が無効または期限切れ |
| 404 |
|
セッションまたはファイルが存在しない |
エラーレスポンス例
無効な
{
"error": {
"message": "resources[0]: field 'type' must be one of 'file', 'github_repository'.",
"type": "invalid_request_error"
},
"type": "error"
}
{
"error": {
"message": "resources[0]: field 'file_id' must be a non-empty string.",
"type": "invalid_request_error"
},
"type": "error"
}
ファイルが見つからない:
{
"error": {
"message": "File 'file_fake_test_id' was not found.",
"type": "not_found_error"
},
"type": "error"
}
エラーエンベロープの詳細については、エラーのセクションを参照してください。