Lampirkan file yang diunggah atau repositori GitHub ke session yang sudah ada sebagai resource.
Catatan
Parameter path
| Parameter | Type | Description |
|---|---|---|
|
|
string | Session ID dengan awalan |
Header Permintaan
| Header | Wajib | Deskripsi |
|---|---|---|
|
|
Ya |
|
|
|
Ya |
|
Badan permintaan
| Field | Type | Required | Description |
|---|---|---|---|
|
|
array | Yes | Array objek resource |
|
|
string | Yes | Salah satu dari: |
|
|
string | Yes | File ID yang diperoleh dari Files API |
Contoh permintaan
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"}
]
}'Contoh tanggapan
HTTP 200 OK
Mengembalikan objek sesi yang diperbarui dengan daftar
Kesalahan
| HTTP | Type | Trigger |
|---|---|---|
| 400 |
|
Permintaan tidak sesuai format (misalnya, |
| 401 |
|
PAT tidak valid atau telah kedaluwarsa |
| 404 |
|
Sesi atau file tidak ditemukan |
Contoh tanggapan galat
{
"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"
}File tidak ditemukan:
{
"error": {
"message": "File 'file_fake_test_id' was not found.",
"type": "not_found_error"
},
"type": "error"
}Lihat Kesalahan untuk daftar error lengkap.