Skip to content

Commit 6e513cc

Browse files
committed
Document printer AutoPrint endpoints
1 parent cf07071 commit 6e513cc

File tree

1 file changed

+317
-0
lines changed

1 file changed

+317
-0
lines changed

source/includes/_printers.md

Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,323 @@ you want to change the printer that is connected to a pi.
604604
| `status` | boolean | True if the request was successful. |
605605
| `message` | string | Error message if `status` is false. |
606606

607+
## List one-click printers
608+
609+
```shell
610+
curl https://api.simplyprint.io/{id}/printers/OneClickPrint?pIds=1234,1235 \
611+
-H 'accept: application/json' \
612+
-H 'X-API-KEY: {API_KEY}'
613+
```
614+
615+
> Success response
616+
617+
```json
618+
{
619+
"status": true,
620+
"message": null,
621+
"bedsMustBeCleared": true,
622+
"autoAddAvailable": true,
623+
"settings": {
624+
...
625+
},
626+
"canEditSettings": true,
627+
"hasQueue": true,
628+
"custom_fields": [
629+
...
630+
],
631+
"queue": [
632+
...
633+
]
634+
}
635+
```
636+
637+
`GET /{id}/printers/OneClickPrint?pid=1234,1235`
638+
639+
#### Query parameters
640+
641+
| Parameter | Type | Required | Description |
642+
|-----------|-----------|----------|------------------------------------------|
643+
| `pid` | integer[] | yes | Printers you want to retrieve data about |
644+
645+
### Response
646+
647+
| Parameter | Type | Description |
648+
|---------------------|---------|-------------------------------------------------|
649+
| `status` | boolean | `true` if the request was successful. |
650+
| `message` | string | Error message if `status` is `false`. |
651+
| `bedsMustBeCleared` | boolean | `true` if beds must be cleared before printing. |
652+
| `autoAddAvailable` | boolean | `true` if auto-discover printers is available. |
653+
| `settings` | object | Queue auto-start settings. |
654+
| `canEditSettings` | boolean | `true` if the user can edit settings. |
655+
| `hasQueue` | boolean | `true` if the company has a print queue. |
656+
| `custom_fields` | array | Array of custom fields for the print queue. |
657+
| `queue` | array | Array of next items in the print queue. |
658+
659+
```
660+
661+
## AutoPrint enable / disable
662+
663+
```shell
664+
curl https://api.simplyprint.io/{id}/printers/autoprint/SetEnabled \
665+
-X POST \
666+
-H 'accept: application/json' \
667+
-H 'X-API-KEY: {API_KEY}' \
668+
-d '{
669+
"on": true
670+
}'
671+
```
672+
673+
> Success response
674+
675+
```json
676+
{
677+
"status": true,
678+
"message": null
679+
}
680+
```
681+
682+
`POST /{id}/printers/autoprint/SetEnabled`
683+
684+
#### Request body
685+
686+
| Parameter | Type | Required | Description |
687+
|-----------|---------|----------|--------------------------------------------------------------|
688+
| `on` | boolean | yes | Set to `true` to enable autoprint, or `false` to disable it. |
689+
690+
### Response
691+
692+
| Parameter | Type | Description |
693+
|-----------|---------|---------------------------------------|
694+
| `status` | boolean | `true` if the request was successful. |
695+
| `message` | string | Error message if `status` is `false`. |
696+
697+
## AutoPrint check state
698+
699+
```shell
700+
curl https://api.simplyprint.io/{id}/printers/autoprint/CheckState \
701+
-H 'accept: application/json' \
702+
-H 'X-API-KEY: {API_KEY}' \
703+
```
704+
705+
> Success response
706+
707+
```json
708+
{
709+
"status": true,
710+
"message": null,
711+
"printers": [
712+
{
713+
...
714+
}
715+
]
716+
}
717+
```
718+
719+
`GET /{id}/printers/autoprint/CheckState`
720+
721+
### Response
722+
723+
| Parameter | Type | Description |
724+
|----------------------------------------------|-------------|------------------------------------------------------------------------|
725+
| `status` | boolean | `true` if the request was successful. |
726+
| `message` | string | Error message if `status` is `false`. |
727+
| `printers` | array | Array of printers along with their AutoPrint status. |
728+
| `printers[].printer` | integer | The printer id. |
729+
| `printers[].ready` | boolean | Whether the printer is ready. |
730+
| `printers[].issues` | array | An array of issues with the printer. |
731+
| `printers[].state` | object | The state of the printer. |
732+
| `printers[].state.awaitingBedCool` | boolean | True if the printer is awaiting the bed to cool down. |
733+
| `printers[].state.awaitingSecondsPass` | boolean | True if the printer is awaiting a specified number of seconds to pass. |
734+
| `printers[].state.awaitingManualClear` | boolean | True if the printer is awaiting manual clearance. |
735+
| `printers[].state.maxCyclesReached` | boolean | True if the printer has reached the maximum number of print cycles. |
736+
| `printers[].state.waitingForSystem` | boolean | True if the printer is waiting for the system. |
737+
| `printers[].state.awaitingMatchingQueueItem` | boolean | True if the printer is awaiting a matching queue item. |
738+
| `printers[].nextItem` | object/null | The next queue item formatted for the printer. |
739+
740+
## AutoPrint get settings
741+
742+
```shell
743+
curl https://api.simplyprint.io/{id}/printers/autoprint/GetAutoPrintSettings \
744+
-H 'accept: application/json' \
745+
-H 'X-API-KEY: {API_KEY}'
746+
```
747+
748+
> Success response
749+
750+
```json
751+
{
752+
"status": true,
753+
"message": null,
754+
"gcode": "...",
755+
"printer_settings": {
756+
...
757+
},
758+
"printer_has_settings": true,
759+
"account_settings": {
760+
...
761+
},
762+
"account_has_settings": true,
763+
"queue_match_settings": {
764+
...
765+
},
766+
"can_macro": true
767+
}
768+
```
769+
770+
`GET /{id}/printers/autoprint/GetAutoPrintSettings`
771+
772+
### Response
773+
774+
| Parameter | Type | Description |
775+
|------------------------|---------|------------------------------------------------------------------------------|
776+
| `status` | boolean | `true` if the request was successful. |
777+
| `message` | string | Error message if `status` is `false`. |
778+
| `gcode` | string | G-code for clearing the auto print settings. |
779+
| `printer_settings` | object | The auto print settings for the printer. |
780+
| `printer_has_settings` | boolean | `true` if the printer has auto print settings. |
781+
| `account_settings` | object | The auto print settings for the account. |
782+
| `account_has_settings` | boolean | `true` if the account has auto print settings. |
783+
| `queue_match_settings` | object | The queue match criteria settings for the account. |
784+
| `can_macro` | boolean | `true` if the user has permission to manage G-code profiles for the company. |
785+
786+
## AutoPrint save settings
787+
788+
```shell
789+
curl https://api.simplyprint.io/{id}/printers/autoprint/SaveAutoPrintSettings \
790+
-X POST \
791+
-H 'accept: application/json' \
792+
-H 'X-API-KEY: {API_KEY}' \
793+
-H 'Content-Type: application/json' \
794+
-d '{
795+
"useDefault": true,
796+
"saveAsDefault": false,
797+
"bedReleaseTemp": 60,
798+
"autoReleaseTime": 3600,
799+
"maxPrints": 100,
800+
"ackNoGcode": true,
801+
"method": "loop"
802+
}'
803+
```
804+
805+
> Success response
806+
807+
```json
808+
{
809+
"status": true,
810+
"message": null
811+
}
812+
```
813+
814+
`POST /{id}/printers/autoprint/SaveAutoPrintSettings`
815+
816+
### Request Body
817+
818+
| Parameter | Type | Description |
819+
|-------------------|---------|-------------------------------------------------------------------------------------------|
820+
| `useDefault` | boolean | `true` to use company defaults, `false` to use custom settings. |
821+
| `saveAsDefault` | boolean | `true` to save the settings as company defaults. |
822+
| `bedReleaseTemp` | integer | Temperature at which the bed releases the print. |
823+
| `autoReleaseTime` | integer | Time in seconds after which the print is automatically released. |
824+
| `maxPrints` | integer | Maximum number of prints before requiring manual intervention. |
825+
| `ackNoGcode` | boolean | `true` to acknowledge no G-code is required. |
826+
| `method` | string | Method to use for auto print settings. One of `loop`, `jobox`, `3dque`, `belt`, `pushoff` |
827+
828+
### Response
829+
830+
| Parameter | Type | Description |
831+
|-----------|---------|---------------------------------------|
832+
| `status` | boolean | `true` if the request was successful. |
833+
| `message` | string | Error message if `status` is `false`. |
834+
835+
## AutoPrint get gcode templates
836+
837+
```shell
838+
curl https://api.simplyprint.io/{id}/printers/autoprint/GetGcodeTemplates \
839+
-H 'accept: application/json' \
840+
-H 'X-API-KEY: {API_KEY}'
841+
```
842+
843+
> Success response
844+
845+
```json
846+
{
847+
"status": true,
848+
"message": null,
849+
"methods": [
850+
{
851+
"name": "loop",
852+
"gcode": "..."
853+
},
854+
{
855+
"name": "jobox",
856+
"gcode": "..."
857+
},
858+
{
859+
"name": "3dque",
860+
"gcode": "..."
861+
},
862+
{
863+
"name": "belt",
864+
"gcode": "..."
865+
},
866+
{
867+
"name": "pushoff",
868+
"gcode": "..."
869+
}
870+
]
871+
}
872+
```
873+
874+
`GET /{id}/printers/autoprint/GetGcodeTemplates`
875+
876+
### Response
877+
878+
| Parameter | Type | Description |
879+
|-------------------|---------|--------------------------------------------------|
880+
| `status` | boolean | `true` if the request was successful. |
881+
| `message` | string | Error message if `status` is `false`. |
882+
| `methods` | array | Array of G-code templates for different methods. |
883+
| `methods[].name` | string | Name of the method. |
884+
| `methods[].gcode` | string | G-code template for the method. |
885+
886+
## AutoPrint set cleared beds amount
887+
888+
```shell
889+
curl https://api.simplyprint.io/{id}/printers/autoprint/SetClearedBedsAmount \
890+
-X POST \
891+
-H 'accept: application/json' \
892+
-H 'X-API-KEY: {API_KEY}' \
893+
-H 'Content-Type: application/json' \
894+
-d '{
895+
"amount": 10
896+
}'
897+
```
898+
899+
> Success response
900+
901+
```json
902+
{
903+
"status": true,
904+
"message": null
905+
}
906+
```
907+
908+
`POST /{id}/printers/autoprint/SetClearedBedsAmount`
909+
910+
### Request Body
911+
912+
| Parameter | Type | Description |
913+
|-----------|-----------|-------------------------------------------------------------------------------------|
914+
| `pid` | integer[] | The ID(s) of the printer(s) to set the cleared beds amount for. |
915+
| `amount` | integer | The number of cleared beds to set for the printer(s). Must be between 0 and 100000. |
916+
917+
### Response
918+
919+
| Parameter | Type | Description |
920+
|-----------|---------|---------------------------------------|
921+
| `status` | boolean | `true` if the request was successful. |
922+
| `message` | string | Error message if `status` is `false`. |
923+
607924
## Cancel reasons
608925

609926
| ID | Description |

0 commit comments

Comments
 (0)