Skip to content

Commit

Permalink
Document printer groups
Browse files Browse the repository at this point in the history
  • Loading branch information
johanohly committed Oct 5, 2024
1 parent d745c9a commit 8a12c2d
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 0 deletions.
195 changes: 195 additions & 0 deletions source/includes/_printer_groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Printer Groups

## Get groups

```shell
curl https://api.simplyprint.io/{id}/groups/Get \
-H 'accept: application/json' \
-H 'X-API-KEY: {API_KEY}' \
```

> Success response
```json
{
"status": true,
"message": null,
"groups": [
{
"id": 1,
"name": "Group 1"
},
{
"id": 2,
"name": "Group 2"
}
]
}
```

`GET /{id}/groups/Get`

### Response

| Parameter | Type | Description |
|-----------------|---------|---------------------------------------|
| `status` | boolean | `true` if the request was successful. |
| `message` | string | Error message if `status` is `false`. |
| `groups` | array | Array of printer groups. |
| `groups[].id` | integer | Unique identifier for the group. |
| `groups[].name` | string | Name of the group. |

## Create group

```shell
curl https://api.simplyprint.io/{id}/groups/Create \
-H 'accept: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"name": "New Group Name"
}'
```

> Success response
```json
{
"status": true,
"message": null,
"id": 123
}
```

`POST /{id}/groups/Create`

### Request Body

| Parameter | Type | Description |
|-----------|--------|----------------------------|
| `name` | string | The name of the new group. |

### Response

| Parameter | Type | Description |
|-----------|---------|---------------------------------------|
| `status` | boolean | `true` if the request was successful. |
| `message` | string | Error message if `status` is `false`. |
| `id` | integer | Unique identifier for the new group. |

## Update group

```shell
curl https://api.simplyprint.io/{id}/groups/Update?group=123 \
-H 'accept: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"name": "Updated Group Name"
}'
```

> Success response
```json
{
"status": true,
"message": null
}
```

`POST /{id}/groups/Update`

### Request Parameters

| Parameter | Type | Description |
|-----------|---------|--------------------------------|
| `group` | integer | The ID of the group to update. |

### Request Body

| Parameter | Type | Description |
|-----------|--------|-----------------------------|
| `name` | string | The new name for the group. |

### Response

| Parameter | Type | Description |
|-----------|---------|---------------------------------------|
| `status` | boolean | `true` if the request was successful. |
| `message` | string | Error message if `status` is `false`. |

## Delete group

```shell
curl https://api.simplyprint.io/{id}/groups/Delete?group=123 \
-X POST \
-H 'accept: application/json' \
-H 'X-API-KEY: {API_KEY}'
```

> Success response
```json
{
"status": true,
"message": null
}
```

`POST /{id}/groups/Delete`

### Request Parameters

| Parameter | Type | Description |
|-----------|---------|--------------------------------|
| `group` | integer | The ID of the group to delete. |

### Response

| Parameter | Type | Description |
|-----------|---------|---------------------------------------|
| `status` | boolean | `true` if the request was successful. |
| `message` | string | Error message if `status` is `false`. |

## Arrange groups

```shell
curl https://api.simplyprint.io/{id}/groups/Arrange?pid=1234&group=123 \
-H 'accept: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"from": 1,
"to": 2
}'
```

> Success response
```json
{
"status": true,
"message": null
}
```

`POST /{id}/groups/Arrange`

### Request Parameters

| Parameter | Type | Description |
|-----------|---------|-----------------------------------|
| `pid` | integer | The ID of the printer to arrange. |
| `group` | integer | The ID of the group to move to. |

### Request Body

| Parameter | Type | Description |
|-----------|---------|--------------------------------------|
| `from` | integer | The current position of the printer. |
| `to` | integer | The new position of the printer. |

### Response

| Parameter | Type | Description |
|-----------|---------|---------------------------------------|
| `status` | boolean | `true` if the request was successful. |
| `message` | string | Error message if `status` is `false`. |
1 change: 1 addition & 0 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ includes:
- filament
- jobs
- queue
- printer_groups
- files
- api_files
- account
Expand Down

0 comments on commit 8a12c2d

Please sign in to comment.