Attaches uploaded files or GitHub repositories to an existing session as resources.
Notes
Path parameters
| Parameter | Type | Description |
|---|---|---|
|
|
string | Session ID with the |
Request headers
| Header | Required | Description |
|---|---|---|
|
|
Yes |
|
|
|
Yes |
|
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
|
array | Yes | Array of resource objects |
|
|
string | Yes | One of: |
|
|
string | Yes | File ID obtained from the Files API |
Example request
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"}
]
}'
Example response
HTTP 200 OK
Returns the updated session object with the new
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 |
|
Malformed request (e.g., |
| 401 |
|
PAT invalid or expired |
| 404 |
|
Session or file does not exist |
Error response examples
Invalid
{
"error": {
"message": "resources[0]: field 'type' must be one of 'file', 'github_repository'.",
"type": "invalid_request_error"
},
"type": "error"
}
Missing
{
"error": {
"message": "resources[0]: field 'file_id' must be a non-empty string.",
"type": "invalid_request_error"
},
"type": "error"
}
File not found:
{
"error": {
"message": "File 'file_fake_test_id' was not found.",
"type": "not_found_error"
},
"type": "error"
}
See Errors for the full error envelope.