Skip to content

Commit 26ba1b3

Browse files
committed
tested component
1 parent 7896bf7 commit 26ba1b3

File tree

3 files changed

+62
-25
lines changed

3 files changed

+62
-25
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
export const sessionEndpointData = {
2+
title: "Update Session",
3+
method: "GET",
4+
description: "Fetches details of a specific session using the session ID.",
5+
endpointUrl: "/session/{session_id}",
6+
parameters: [
7+
{
8+
name: "session_id",
9+
required: true,
10+
description: "The unique identifier of the session to retrieve.",
11+
type: "string",
12+
},
13+
],
14+
headers: [
15+
{
16+
name: "x-secret-key",
17+
required: true,
18+
description: "Your thirdweb secret key for authentication.",
19+
type: "string",
20+
},
21+
],
22+
bodyParameters: [],
23+
codeExamples: [
24+
{
25+
language: "curl",
26+
code: `curl -X GET https://nebula-api.thirdweb.com/session/{session_id} \\
27+
-H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY"`,
28+
},
29+
{
30+
language: "JavaScript",
31+
code: "test",
32+
},
33+
],
34+
apiResponses: [
35+
{
36+
status: "200",
37+
description: "Session details retrieved successfully.",
38+
code: `{
39+
"session_id": "abc123",
40+
"created_at": "2024-01-01T00:00:00Z",
41+
"last_active": "2024-01-02T12:34:56Z",
42+
"messages": [
43+
"message_id": "msg1",
44+
"content": "Hello, how can I assist you?",
45+
"timestamp": "2024-01-01T01:23:45Z"
46+
// Additional messages...
47+
]
48+
}`,
49+
},
50+
{
51+
status: "404",
52+
description: "Session not found.",
53+
code: `{
54+
"error": "Session with ID 'abc123' not found."
55+
}`,
56+
},
57+
],
58+
};
Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
#### Update Session
1+
import { ApiEndpoint} from '@doc';
2+
import { sessionEndpointData } from './data';
23

3-
Update an existing session.
4-
5-
```bash
6-
PUT /session/{session_id}
7-
```
8-
9-
**Example curl:**
10-
```bash
11-
curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \
12-
-H "Content-Type: application/json" \
13-
-H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
14-
-d '{
15-
"title": "Updated Title",
16-
"is_public": true
17-
}'
18-
```
19-
20-
**Request Body:**
21-
```tsx
22-
{
23-
"title": "string",
24-
"is_public": boolean
25-
}
26-
```
4+
<ApiEndpoint {...sessionEndpointData} />

apps/portal/src/components/Document/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ export { ConnectCard } from "./Cards/ConnectCard";
2727
export { AAChainList } from "./AAChainList";
2828
export { AuthList } from "./AuthList";
2929
export { FeatureCard } from "./FeatureCard";
30+
export { ApiEndpoint } from "./ApiEndpointComponent";

0 commit comments

Comments
 (0)