Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
79 changes: 79 additions & 0 deletions docs/user-manual/api/branch-create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Branches - Create branch
---

## Route URL

```none
POST https://playcanvas.com/api/branches
```

## Description

Create a new branch from an existing branch and optionally from a specific checkpoint.

## Example

```none
curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "name": "My New Branch", "sourceBranchId": "{sourceBranchId}"}' "https://playcanvas.com/api/branches"
```

HTTP Request

```text
POST https://playcanvas.com/api/branches
Authorization: Bearer {accessToken}
Content-Type: application/json

{
"projectId": {projectId},
"name": "My New Branch",
"sourceBranchId": "{sourceBranchId}"
}
```

## Parameters

| Name | Type | Required | Description |
| ---------------------- | -------- | :------: | -------------------------------------------------------------------------------------------------------------------- |
| `name` | `string` | ✔️ | The name of the new branch. Must be non-empty and cannot exceed 1000 characters. |
| `projectId` | `number` | ✔️ | The id of the project. |
| `sourceBranchId` | `string` | ✔️ | The id of the branch to create the new branch from. |
| `sourceCheckpointId` | `string` | | The id of the checkpoint to create the new branch from. Must belong to the source branch. If not specified, the latest checkpoint of the source branch will be used. |

## Response Schema

```none
Status: 201 Created
```

```json
{
"id": string,
"projectId": int,
"name": string,
"createdAt": date,
"closed": bool,
"permanent": bool,
"latestCheckpointId": string,
"user": {
"id": int,
"fullName": string,
"username": string
}
}
```

## Errors

| Code | Description |
| ---- | -------------------------------------------------- |
| 400 | Invalid request / branch name already exists |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Project not found / Branch not found |
| 429 | Too many requests |

## Rate Limiting

This route uses a [normal](/user-manual/api#rate-limiting) rate limit.
74 changes: 74 additions & 0 deletions docs/user-manual/api/checkpoint-create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Checkpoints - Create checkpoint
---

## Route URL

```none
POST https://playcanvas.com/api/checkpoints
```

## Description

Create a new checkpoint for a branch. A checkpoint captures the current state of a branch so that it can be restored later.

## Example

```none
curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "branchId": "{branchId}", "description": "My checkpoint"}' "https://playcanvas.com/api/checkpoints"
```

HTTP Request

```text
POST https://playcanvas.com/api/checkpoints
Authorization: Bearer {accessToken}
Content-Type: application/json

{
"projectId": {projectId},
"branchId": "{branchId}",
"description": "My checkpoint"
}
```

## Parameters

| Name | Type | Required | Description |
| ------------- | -------- | :------: | -------------------------------------------------------------------------------- |
| `projectId` | `number` | ✔️ | The id of the project. |
| `branchId` | `string` | ✔️ | The id of the branch. |
| `description` | `string` | ✔️ | A description for the checkpoint. Must be non-empty and cannot exceed 10,000 characters. |

## Response Schema

```none
Status: 201 Created
```

```json
{
"id": string,
"user": {
"id": int,
"fullName": string,
"username": string
},
"createdAt": date,
"description": string
}
```

## Errors

| Code | Description |
| ---- | ------------------ |
| 400 | Invalid request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Project not found / Branch not found |
| 429 | Too many requests |

## Rate Limiting

This route uses a [normal](/user-manual/api#rate-limiting) rate limit.
64 changes: 64 additions & 0 deletions docs/user-manual/api/checkpoint-get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Checkpoints - Get checkpoint
---

## Route URL

```none
GET https://playcanvas.com/api/checkpoints/:id
```

## Description

Get a checkpoint by its id.

## Example

```none
curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/checkpoints/{id}"
```

HTTP Request

```text
GET https://playcanvas.com/api/checkpoints/{id}
Authorization: Bearer {accessToken}
```

## Parameters

| Name | Type | Description |
| ---- | -------- | ------------------------ |
| `id` | `string` | The id of the checkpoint. |

## Response Schema

```none
Status: 200
```

```json
{
"id": string,
"user": {
"id": int,
"fullName": string,
"username": string
},
"createdAt": date,
"description": string
}
```

## Errors

| Code | Description |
| ---- | -------------------- |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Checkpoint not found |
| 429 | Too many requests |

## Rate Limiting

This route uses a [normal](/user-manual/api#rate-limiting) rate limit.
73 changes: 73 additions & 0 deletions docs/user-manual/api/checkpoint-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Checkpoints - List checkpoints
---

## Route URL

```none
GET https://playcanvas.com/api/branches/:branchId/checkpoints
```

## Description

Get a list of checkpoints for a branch, sorted by newest first.

## Example

```none
curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/branches/{branchId}/checkpoints"
```

HTTP Request

```text
GET https://playcanvas.com/api/branches/{branchId}/checkpoints
Authorization: Bearer {accessToken}
```

## Parameters

| Name | Type | Required | Description |
| ---------- | -------- | :------: | ----------------------------------------------------------------------------------------------------- |
| `branchId` | `string` | ✔️ | The id of the branch. |
| `limit` | `number` | | The maximum number of checkpoints to return. Cannot exceed 50. |
| `skip` | `string` | | A checkpoint id. The result will only contain checkpoints that were created before this checkpoint. |

## Response Schema

```none
Status: 200
```

```json
{
"result": [{
"id": string,
"user": {
"id": int,
"fullName": string,
"username": string
},
"createdAt": date,
"description": string
}, ...],
"pagination": {
"hasMore": bool
}
}
```

This endpoint uses a slightly different pagination method. If a response contains the value `hasMore: true` then additional results are available. Use the `skip` query parameter with the id of the last received checkpoint to receive more results.

## Errors

| Code | Description |
| ---- | ----------------- |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Branch not found |
| 429 | Too many requests |

## Rate Limiting

This route uses a [normal](/user-manual/api#rate-limiting) rate limit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: ブランチ - Create branch
---

## ルートURL

```none
POST https://playcanvas.com/api/branches
```

## 説明

既存のブランチから、オプションで特定のチェックポイントを指定して、新しいブランチを作成します。

## 例

```none
curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "name": "My New Branch", "sourceBranchId": "{sourceBranchId}"}' "https://playcanvas.com/api/branches"
```

HTTP リクエスト

```text
POST https://playcanvas.com/api/branches
Authorization: Bearer {accessToken}
Content-Type: application/json

{
"projectId": {projectId},
"name": "My New Branch",
"sourceBranchId": "{sourceBranchId}"
}
```

## パラメーター

| 名前 | タイプ | Required | 説明 |
| ---------------------- | -------- | :------: | -------------------------------------------------------------------------------------------------------------------- |
| `name` | `string` | ✔️ | The name of the new branch. Must be non-empty and cannot exceed 1000 characters. |
| `projectId` | `number` | ✔️ | The id of the project. |
| `sourceBranchId` | `string` | ✔️ | The id of the branch to create the new branch from. |
| `sourceCheckpointId` | `string` | | The id of the checkpoint to create the new branch from. Must belong to the source branch. If not specified, the latest checkpoint of the source branch will be used. |

## レスポンススキーマ

```none
ステータス: 201 Created
```

```json
{
"id": string,
"projectId": int,
"name": string,
"createdAt": date,
"closed": bool,
"permanent": bool,
"latestCheckpointId": string,
"user": {
"id": int,
"fullName": string,
"username": string
}
}
```

## エラー

| コード | 説明 |
| ---- | -------------------------------------------------- |
| 400 | Invalid request / branch name already exists |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Project not found / Branch not found |
| 429 | Too many requests |

## レート制限

このルートは[通常](/user-manual/api#rate-limiting)のレート制限を使用します。
Loading