资源
列出会话资源
通过 OMA API 列出会话资源。
GET
/
v1
/
sessions
/
{session_id}
/
resources
列出会话资源
curl --request GET \
--url http://localhost:38080/v1/sessions/{session_id}/resources \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/sessions/{session_id}/resources"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/sessions/{session_id}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/sessions/{session_id}/resources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": {
"type": "branch",
"name": "main"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}每个请求都必须发送
?beta=true。授权
omaApiKeyomaBearer
OMA 工作区 API 密钥。
路径参数
会话标识符。
查询参数
为此接口启用 Beta API 合同,必须为 true。
可用选项:
true 每页返回的最大资源数(最大 1000)。省略时返回所有资源。
来自上一个响应 next_page 字段的不透明游标。
响应
请求成功。
附加到会话的资源分页列表。
该会话的资源,按 created_at 排序。
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
示例:
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": { "type": "branch", "name": "main" },
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
示例:
[
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": { "type": "branch", "name": "main" },
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
]
下一页的不透明游标。没有更多结果时为 null。
示例:
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
此页面对您有帮助吗?
⌘I
列出会话资源
curl --request GET \
--url http://localhost:38080/v1/sessions/{session_id}/resources \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/sessions/{session_id}/resources"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/sessions/{session_id}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/sessions/{session_id}/resources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": {
"type": "branch",
"name": "main"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}