Skip to content

Commit

Permalink
Cleanup and added OAuth2 documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dnorhoj committed Jan 26, 2024
1 parent fb7fc95 commit 5504d6f
Show file tree
Hide file tree
Showing 15 changed files with 997 additions and 796 deletions.
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"markdownlint.config": {
"no-inline-html": {
"allowed_elements": [
"aside",
"b",
"br",
"span",
"code",
"ul",
"ol",
"li",
],
},
"link-fragments": false,
"no-duplicate-heading": false,
"single-h1": false,
}
}
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
slate-dev:
image: slatedocs/slate:latest
ports:
- 127.0.0.1:4567:4567
volumes:
- ./source:/srv/slate/source:ro
command: serve
194 changes: 99 additions & 95 deletions source/includes/_account.md

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions source/includes/_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

The SimplyPrint API uses the following HTTP error codes:

Error Code | Meaning
---------- | -------
400 | Bad Request -- Your request is invalid.
401 | Unauthorized -- Your API key is wrong.
403 | Forbidden -- Request not allowed.
404 | Not Found -- Endpoint not found.
405 | Method Not Allowed -- You tried to access an endpoint with an invalid method.
406 | Not Acceptable -- You requested a format that isn't json.
410 | Gone -- The endpoint requested has been removed from our servers.
429 | Too Many Requests -- You're requesting too much - slow down
500 | Internal Server Error -- We had a problem with our server. Try again later.
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
| Error Code | Meaning |
| ---------- | ----------------------------------------------------------------------------------------- |
| 400 | Bad Request -- Your request is invalid. |
| 401 | Unauthorized -- Your API key is wrong. |
| 403 | Forbidden -- Request not allowed. |
| 404 | Not Found -- Endpoint not found. |
| 405 | Method Not Allowed -- You tried to access an endpoint with an invalid method. |
| 406 | Not Acceptable -- You requested a format that isn't json. |
| 410 | Gone -- The endpoint requested has been removed from our servers. |
| 429 | Too Many Requests -- You're requesting too much - slow down |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |

## Error Response

Expand All @@ -28,7 +28,7 @@ Error Code | Meaning

When an error occurs, the API will return a JSON object with the following fields:

Field | Description | Type
----- | ----------- | ----
status | The status of the request | Boolean
message | A message describing the error | String|null
| Field | Description | Type |
| ------- | ------------------------------ | ----------- |
| status | The status of the request | Boolean |
| message | A message describing the error | String/null |
216 changes: 108 additions & 108 deletions source/includes/_filament.md

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions source/includes/_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,25 @@ This endpoint returns a list of files and folders in a given folder. If no folde

`GET /{id}/files/GetFiles`

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `f` | integer | no | Folder ID to get files for. **Defaults to 0 (root folder)** |
| `search` | string | no | Search string to filter files by. |
| `global_search` | boolean | no | If true, search all files in the account, not just the folder specified by `f`. |
| `pid` | integer | no | For print cost calculation, if you want the files to use the material of a printer, request with the ID of the printer - don't include the `pid` argument otherwise |
| Parameter | Type | Required | Description |
| --------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `f` | integer | no | Folder ID to get files for. **Defaults to 0 (root folder)** |
| `search` | string | no | Search string to filter files by. |
| `global_search` | boolean | no | If true, search all files in the account, not just the folder specified by `f`. |
| `pid` | integer | no | For print cost calculation, if you want the files to use the material of a printer, request with the ID of the printer - don't include the `pid` argument otherwise |

### Response

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | boolean | True if the request was successful. |
| `message` | string | Error message if `status` is false. |
| `files` | array | Array of file objects. |
| `folders` | array | Array of folder objects. |
| `path` | array | Array of arrays containing the path to the current folder. |
| `sort_type` | string | Sort type from user's settings. |
| `space` | integer | The total space available in bytes. |
| `space_used` | integer | The total space used in bytes. |
| Parameter | Type | Description |
| ------------ | ------- | ---------------------------------------------------------- |
| `status` | boolean | True if the request was successful. |
| `message` | string | Error message if `status` is false. |
| `files` | array | Array of file objects. |
| `folders` | array | Array of folder objects. |
| `path` | array | Array of arrays containing the path to the current folder. |
| `sort_type` | string | Sort type from user's settings. |
| `space` | integer | The total space available in bytes. |
| `space_used` | integer | The total space used in bytes. |

## Move File(s) to Folder

Expand All @@ -182,17 +182,17 @@ This endpoint moves one or more files to a given folder.

`GET /{id}/files/MoveFiles`

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `files` | array | yes | Array of file IDs to move. Separate multiple IDs with a comma. |
| `folder` | integer | yes | Folder ID to move files to. |
| Parameter | Type | Required | Description |
| --------- | ------- | -------- | -------------------------------------------------------------- |
| `files` | array | yes | Array of file IDs to move. Separate multiple IDs with a comma. |
| `folder` | integer | yes | Folder ID to move files to. |

### Response

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | boolean | True if the request was successful. |
| `message` | string | Success message or error message if `status` is false. |
| Parameter | Type | Description |
| --------- | ------- | ------------------------------------------------------ |
| `status` | boolean | True if the request was successful. |
| `message` | string | Success message or error message if `status` is false. |

## Get Folder Details

Expand Down Expand Up @@ -234,24 +234,24 @@ This endpoint returns details about a given folder.

`GET /{id}/files/GetFolder`

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | Folder ID to get details for. |
| Parameter | Type | Required | Description |
| --------- | ------- | -------- | ----------------------------- |
| `id` | integer | yes | Folder ID to get details for. |

### Response

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | boolean | True if the request was successful. |
| `message` | string | Error message if `status` is false. |
| `folder` | object | Folder object. |
| `folder.id` | integer | Folder ID. |
| `folder.name` | string | Folder name. |
| `folder.org` | boolean | True if the folder is an organization folder.<br>**Requires Print Farm plan** |
| `folder.permissions` | object|null | Folder permissions. |
| `folder.permissions.view` | array | Array of [group IDs](#get-company-groups) that can view the folder. |
| `folder.permissions.upload` | array | Array of [group IDs](#get-company-groups) that can upload files to the folder. |
| `folder.permissions.modify` | array | Array of [group IDs](#get-company-groups) that can modify the folder. |
| Parameter | Type | Description |
| --------------------------- | ----------- | ------------------------------------------------------------------------------ |
| `status` | boolean | True if the request was successful. |
| `message` | string | Error message if `status` is false. |
| `folder` | object | Folder object. |
| `folder.id` | integer | Folder ID. |
| `folder.name` | string | Folder name. |
| `folder.org` | boolean | True if the folder is an organization folder.<br>**Requires Print Farm plan** |
| `folder.permissions` | object/null | Folder permissions. |
| `folder.permissions.view` | array | Array of [group IDs](#get-company-groups) that can view the folder. |
| `folder.permissions.upload` | array | Array of [group IDs](#get-company-groups) that can upload files to the folder. |
| `folder.permissions.modify` | array | Array of [group IDs](#get-company-groups) that can modify the folder. |

## Move Folder

Expand Down Expand Up @@ -279,14 +279,14 @@ Also, folders cannot be moved into themselves.

`GET /{id}/files/MoveFolder`

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `folder` | integer | yes | Folder ID to move. |
| `target` | integer | yes | Folder ID to move to. |
| Parameter | Type | Required | Description |
| --------- | ------- | -------- | --------------------- |
| `folder` | integer | yes | Folder ID to move. |
| `target` | integer | yes | Folder ID to move to. |

### Response

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | boolean | True if the request was successful. |
| `message` | string | Success message or error message if `status` is false. |
| Parameter | Type | Description |
| --------- | ------- | ------------------------------------------------------ |
| `status` | boolean | True if the request was successful. |
| `message` | string | Success message or error message if `status` is false. |
Loading

0 comments on commit 5504d6f

Please sign in to comment.