Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions docs/api-reference/assets/create-user-asset-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Original filename of the asset

MIME type of the file

- `image/jpeg` - JPEG
- `image/png` - PNG
- `image/webp` - WebP
- `image/jpg` - JPG
- `image/gif` - GIF
* `image/jpeg` - JPEG
* `image/png` - PNG
* `image/webp` - WebP
* `image/jpg` - JPG
* `image/gif` - GIF

</ApiParam>

Expand All @@ -50,8 +50,8 @@ File size in bytes

Type of user asset

- `USER_AVATAR` - User Avatar
- `USER_COVER` - User Cover
* `USER_AVATAR` - User Avatar
* `USER_COVER` - User Cover

</ApiParam>

Expand All @@ -66,6 +66,7 @@ Type of user asset

</div>


</div>

<div class="api-right">
Expand Down Expand Up @@ -114,14 +115,14 @@ const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/",
method: "POST",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Example Name",
type: "image/jpeg",
size: 1024000,
entity_type: "USER_AVATAR",
}),
"name": "Example Name",
"type": "image/jpeg",
"size": 1024000,
"entity_type": "USER_AVATAR"
}),
});
const data = await response.json();
```
Expand Down Expand Up @@ -152,6 +153,7 @@ const data = await response.json();

</ResponsePanel>


</div>

</div>
24 changes: 13 additions & 11 deletions docs/api-reference/assets/create-workspace-asset-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords: plane, plane api, rest api, api integration, assets, create workspace

<div class="api-endpoint-badge">
<span class="method post">POST</span>
<span class="path">/api/v1/workspaces/{slug}/assets/</span>
<span class="path">/api/v1/workspaces/{workspace_slug}/assets/</span>
</div>

<div class="api-two-column">
Expand All @@ -22,9 +22,9 @@ Generate presigned URL for generic asset upload

<div class="params-list">

<ApiParam name="slug" type="string" :required="true">
<ApiParam name="workspace_slug" type="string" :required="true">

Workspace slug
The workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL `https://app.plane.so/my-team/projects/`, the workspace slug is `my-team`.

</ApiParam>

Expand Down Expand Up @@ -84,6 +84,7 @@ External source system (for integration tracking)

</div>


</div>

<div class="api-right">
Expand Down Expand Up @@ -136,16 +137,16 @@ const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspac
method: "POST",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Example Name",
type: "image/jpeg",
size: 1024000,
project_id: "550e8400-e29b-41d4-a716-446655440000",
external_id: "550e8400-e29b-41d4-a716-446655440000",
external_source: "github",
}),
"name": "Example Name",
"type": "image/jpeg",
"size": 1024000,
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"external_id": "550e8400-e29b-41d4-a716-446655440000",
"external_source": "github"
}),
});
const data = await response.json();
```
Expand Down Expand Up @@ -176,6 +177,7 @@ const data = await response.json();

</ResponsePanel>


</div>

</div>
12 changes: 7 additions & 5 deletions docs/api-reference/assets/delete-user-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Asset ID

</div>


</div>

<div class="api-right">
Expand All @@ -51,9 +52,9 @@ Asset ID

```bash
curl -X DELETE \
"https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/" \
"https://api.plane.so/api/v1/assets/user-assets/asset-uuid/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN"
```

</template>
Expand All @@ -63,7 +64,7 @@ curl -X DELETE \
import requests

response = requests.delete(
"https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/",
"https://api.plane.so/api/v1/assets/user-assets/asset-uuid/",
headers={"X-API-Key": "your-api-key"}
)
print(response.status_code)
Expand All @@ -73,10 +74,10 @@ print(response.status_code)
<template #javascript>

```javascript
const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/", {
const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/asset-uuid/", {
method: "DELETE",
headers: {
"X-API-Key": "your-api-key",
"X-API-Key": "your-api-key"
},
});
console.log(response.status);
Expand All @@ -91,6 +92,7 @@ No response body.

</ResponsePanel>


</div>

</div>
31 changes: 15 additions & 16 deletions docs/api-reference/assets/get-workspace-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords: plane, plane api, rest api, api integration, assets, get workspace ass

<div class="api-endpoint-badge">
<span class="method get">GET</span>
<span class="path">/api/v1/workspaces/{slug}/assets/{asset_id}/</span>
<span class="path">/api/v1/workspaces/{workspace_slug}/assets/{asset_id}/</span>
</div>

<div class="api-two-column">
Expand All @@ -24,13 +24,13 @@ Get presigned URL for asset download

<ApiParam name="asset_id" type="string" :required="true">

Asset id.
The unique identifier of the asset.

</ApiParam>

<ApiParam name="slug" type="string" :required="true">
<ApiParam name="workspace_slug" type="string" :required="true">

Workspace slug
The workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL `https://app.plane.so/my-team/projects/`, the workspace slug is `my-team`.

</ApiParam>

Expand All @@ -45,6 +45,7 @@ Workspace slug

</div>


</div>

<div class="api-right">
Expand All @@ -54,9 +55,9 @@ Workspace slug

```bash
curl -X GET \
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/550e8400-e29b-41d4-a716-446655440002/" \
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/asset-uuid/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN"
```

</template>
Expand All @@ -66,7 +67,7 @@ curl -X GET \
import requests

response = requests.get(
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/550e8400-e29b-41d4-a716-446655440002/",
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/asset-uuid/",
headers={"X-API-Key": "your-api-key"}
)
print(response.json())
Expand All @@ -76,15 +77,12 @@ print(response.json())
<template #javascript>

```javascript
const response = await fetch(
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/550e8400-e29b-41d4-a716-446655440002/",
{
method: "GET",
headers: {
"X-API-Key": "your-api-key",
},
}
);
const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/assets/asset-uuid/", {
method: "GET",
headers: {
"X-API-Key": "your-api-key"
},
});
const data = await response.json();
```

Expand All @@ -107,6 +105,7 @@ const data = await response.json();

</ResponsePanel>


</div>

</div>
2 changes: 2 additions & 0 deletions docs/api-reference/assets/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Assets let you upload and manage files used across user profiles and workspaces,

### Attributes



</div>
<div class="api-right">

Expand Down
24 changes: 13 additions & 11 deletions docs/api-reference/assets/update-user-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Additional attributes to update for the asset

</div>


</div>

<div class="api-right">
Expand All @@ -63,7 +64,7 @@ Additional attributes to update for the asset

```bash
curl -X PATCH \
"https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/" \
"https://api.plane.so/api/v1/assets/user-assets/asset-uuid/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
Expand All @@ -84,7 +85,7 @@ curl -X PATCH \
import requests

response = requests.patch(
"https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/",
"https://api.plane.so/api/v1/assets/user-assets/asset-uuid/",
headers={"X-API-Key": "your-api-key"},
json={
"attributes": {
Expand All @@ -102,20 +103,20 @@ print(response.status_code)
<template #javascript>

```javascript
const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/550e8400-e29b-41d4-a716-446655440002/", {
const response = await fetch("https://api.plane.so/api/v1/assets/user-assets/asset-uuid/", {
method: "PATCH",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
attributes: {
name: "Example Name",
type: "image/jpeg",
size: 1024000,
},
entity_type: "USER_AVATAR",
}),
"attributes": {
"name": "Example Name",
"type": "image/jpeg",
"size": 1024000
},
"entity_type": "USER_AVATAR"
}),
});
console.log(response.status);
```
Expand All @@ -129,6 +130,7 @@ No response body.

</ResponsePanel>


</div>

</div>
Loading
Loading