Skip to content

Commit d5bc98a

Browse files
authored
Merge pull request #245 from makeplane/refactor-update_developer_docs
[DOCSW-615] docs: refresh API reference and add new endpoints
2 parents abbea9f + 5684fe6 commit d5bc98a

216 files changed

Lines changed: 16825 additions & 4705 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/.vitepress/config.mts

Lines changed: 199 additions & 54 deletions
Large diffs are not rendered by default.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
title: Create user asset upload
3+
description: Create user asset upload via Plane API. HTTP request format, parameters, scopes, and example responses for create user asset upload.
4+
keywords: plane, plane api, rest api, api integration, assets, create user asset upload
5+
---
6+
7+
# Create user asset upload
8+
9+
<div class="api-endpoint-badge">
10+
<span class="method post">POST</span>
11+
<span class="path">/api/v1/assets/user-assets/</span>
12+
</div>
13+
14+
<div class="api-two-column">
15+
<div class="api-left">
16+
17+
Generate presigned URL for user asset upload
18+
19+
<div class="params-section">
20+
21+
### Body Parameters
22+
23+
<div class="params-list">
24+
25+
<ApiParam name="name" type="string" :required="true">
26+
27+
Original filename of the asset
28+
29+
</ApiParam>
30+
31+
<ApiParam name="type" type="string" :required="false">
32+
33+
MIME type of the file
34+
35+
- `image/jpeg` - JPEG
36+
- `image/png` - PNG
37+
- `image/webp` - WebP
38+
- `image/jpg` - JPG
39+
- `image/gif` - GIF
40+
41+
</ApiParam>
42+
43+
<ApiParam name="size" type="integer" :required="true">
44+
45+
File size in bytes
46+
47+
</ApiParam>
48+
49+
<ApiParam name="entity_type" type="string" :required="true">
50+
51+
Type of user asset
52+
53+
- `USER_AVATAR` - User Avatar
54+
- `USER_COVER` - User Cover
55+
56+
</ApiParam>
57+
58+
</div>
59+
</div>
60+
61+
<div class="params-section">
62+
63+
### Scopes
64+
65+
`assets:write`
66+
67+
</div>
68+
69+
</div>
70+
71+
<div class="api-right">
72+
73+
<CodePanel title="Create user asset upload" :languages="['cURL', 'Python', 'JavaScript']">
74+
<template #curl>
75+
76+
```bash
77+
curl -X POST \
78+
"https://api.plane.so/api/v1/assets/user-assets/" \
79+
-H "X-API-Key: $PLANE_API_KEY" \
80+
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
81+
-H "Content-Type: application/json" \
82+
-d '{
83+
"name": "Example Name",
84+
"type": "image/jpeg",
85+
"size": 1024000,
86+
"entity_type": "USER_AVATAR"
87+
}'
88+
```
89+
90+
</template>
91+
<template #python>
92+
93+
```python
94+
import requests
95+
96+
response = requests.post(
97+
"https://api.plane.so/api/v1/assets/user-assets/",
98+
headers={"X-API-Key": "your-api-key"},
99+
json={
100+
"name": "Example Name",
101+
"type": "image/jpeg",
102+
"size": 1024000,
103+
"entity_type": "USER_AVATAR"
104+
}
105+
)
106+
print(response.json())
107+
```
108+
109+
</template>
110+
<template #javascript>
111+
112+
```javascript
113+
const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/", {
114+
method: "POST",
115+
headers: {
116+
"X-API-Key": "your-api-key",
117+
"Content-Type": "application/json",
118+
},
119+
body: JSON.stringify({
120+
name: "Example Name",
121+
type: "image/jpeg",
122+
size: 1024000,
123+
entity_type: "USER_AVATAR",
124+
}),
125+
});
126+
const data = await response.json();
127+
```
128+
129+
</template>
130+
</CodePanel>
131+
132+
<ResponsePanel status="200">
133+
134+
```json
135+
{
136+
"asset_id": "550e8400-e29b-41d4-a716-446655440000",
137+
"asset_url": "/api/assets/v2/static/550e8400-e29b-41d4-a716-446655440000/",
138+
"upload_data": {
139+
"url": "https://uploads.example.com/plane-bucket",
140+
"fields": {
141+
"Content-Type": "image/png",
142+
"key": "user-assets/550e8400-e29b-41d4-a716-446655440000/profile-image.png",
143+
"x-amz-algorithm": "AWS4-HMAC-SHA256",
144+
"x-amz-credential": "example/20240101/us-east-1/s3/aws4_request",
145+
"x-amz-date": "20240101T000000Z",
146+
"policy": "example-policy",
147+
"x-amz-signature": "example-signature"
148+
}
149+
}
150+
}
151+
```
152+
153+
</ResponsePanel>
154+
155+
</div>
156+
157+
</div>
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
title: Create workspace asset upload
3+
description: Create workspace asset upload via Plane API. HTTP request format, parameters, scopes, and example responses for create workspace asset upload.
4+
keywords: plane, plane api, rest api, api integration, assets, create workspace asset upload
5+
---
6+
7+
# Create workspace asset upload
8+
9+
<div class="api-endpoint-badge">
10+
<span class="method post">POST</span>
11+
<span class="path">/api/v1/workspaces/{slug}/assets/</span>
12+
</div>
13+
14+
<div class="api-two-column">
15+
<div class="api-left">
16+
17+
Generate presigned URL for generic asset upload
18+
19+
<div class="params-section">
20+
21+
### Path Parameters
22+
23+
<div class="params-list">
24+
25+
<ApiParam name="slug" type="string" :required="true">
26+
27+
Workspace slug
28+
29+
</ApiParam>
30+
31+
</div>
32+
</div>
33+
34+
<div class="params-section">
35+
36+
### Body Parameters
37+
38+
<div class="params-list">
39+
40+
<ApiParam name="name" type="string" :required="true">
41+
42+
Original filename of the asset
43+
44+
</ApiParam>
45+
46+
<ApiParam name="type" type="string" :required="false">
47+
48+
MIME type of the file
49+
50+
</ApiParam>
51+
52+
<ApiParam name="size" type="integer" :required="true">
53+
54+
File size in bytes
55+
56+
</ApiParam>
57+
58+
<ApiParam name="project_id" type="string" :required="false">
59+
60+
UUID of the project to associate with the asset
61+
62+
</ApiParam>
63+
64+
<ApiParam name="external_id" type="string" :required="false">
65+
66+
External identifier for the asset (for integration tracking)
67+
68+
</ApiParam>
69+
70+
<ApiParam name="external_source" type="string" :required="false">
71+
72+
External source system (for integration tracking)
73+
74+
</ApiParam>
75+
76+
</div>
77+
</div>
78+
79+
<div class="params-section">
80+
81+
### Scopes
82+
83+
`assets:write`
84+
85+
</div>
86+
87+
</div>
88+
89+
<div class="api-right">
90+
91+
<CodePanel title="Create workspace asset upload" :languages="['cURL', 'Python', 'JavaScript']">
92+
<template #curl>
93+
94+
```bash
95+
curl -X POST \
96+
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/" \
97+
-H "X-API-Key: $PLANE_API_KEY" \
98+
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
99+
-H "Content-Type: application/json" \
100+
-d '{
101+
"name": "Example Name",
102+
"type": "image/jpeg",
103+
"size": 1024000,
104+
"project_id": "550e8400-e29b-41d4-a716-446655440000",
105+
"external_id": "550e8400-e29b-41d4-a716-446655440000",
106+
"external_source": "github"
107+
}'
108+
```
109+
110+
</template>
111+
<template #python>
112+
113+
```python
114+
import requests
115+
116+
response = requests.post(
117+
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/",
118+
headers={"X-API-Key": "your-api-key"},
119+
json={
120+
"name": "Example Name",
121+
"type": "image/jpeg",
122+
"size": 1024000,
123+
"project_id": "550e8400-e29b-41d4-a716-446655440000",
124+
"external_id": "550e8400-e29b-41d4-a716-446655440000",
125+
"external_source": "github"
126+
}
127+
)
128+
print(response.json())
129+
```
130+
131+
</template>
132+
<template #javascript>
133+
134+
```javascript
135+
const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/assets/", {
136+
method: "POST",
137+
headers: {
138+
"X-API-Key": "your-api-key",
139+
"Content-Type": "application/json",
140+
},
141+
body: JSON.stringify({
142+
name: "Example Name",
143+
type: "image/jpeg",
144+
size: 1024000,
145+
project_id: "550e8400-e29b-41d4-a716-446655440000",
146+
external_id: "550e8400-e29b-41d4-a716-446655440000",
147+
external_source: "github",
148+
}),
149+
});
150+
const data = await response.json();
151+
```
152+
153+
</template>
154+
</CodePanel>
155+
156+
<ResponsePanel status="200">
157+
158+
```json
159+
{
160+
"asset_id": "550e8400-e29b-41d4-a716-446655440000",
161+
"asset_url": "/api/assets/v2/workspaces/my-workspace/projects/None/issues/None/attachments/550e8400-e29b-41d4-a716-446655440000/",
162+
"upload_data": {
163+
"url": "https://uploads.example.com/plane-bucket",
164+
"fields": {
165+
"Content-Type": "image/png",
166+
"key": "workspace-assets/550e8400-e29b-41d4-a716-446655440000/workspace-image.png",
167+
"x-amz-algorithm": "AWS4-HMAC-SHA256",
168+
"x-amz-credential": "example/20240101/us-east-1/s3/aws4_request",
169+
"x-amz-date": "20240101T000000Z",
170+
"policy": "example-policy",
171+
"x-amz-signature": "example-signature"
172+
}
173+
}
174+
}
175+
```
176+
177+
</ResponsePanel>
178+
179+
</div>
180+
181+
</div>

0 commit comments

Comments
 (0)