Assignments

Assignments represent the allocation of printers to groups and their users within an ezeep organization.

Get all available Printers

Lists all printers with their group assignments. Use the printer_id to assign a printer to groups.

GET "https://api2.ezeep.com/printing/v1/assignments/"

Response attributes:

Attribute Type Description
printer_id string uuid of the printer
printer_name string name of the printer
assignments list of objects groups assigned to the printer, with their settings

Example Request

curl  -X GET "https://api2.ezeep.com/printing/v1/assignments/" \
      --header "Authorization: Bearer <access_token>"

Example Response

{
  "count": 37,
  "next": "https://api2.ezeep.com/printing/v1/assignments/?limit=20&offset=20",
  "previous": null,
  "results": [
    {
      "printer_id": "64cd9c03-9749-4dc5-b5f2-dcc651adb5b5",
      "printer_name": "Microsoft XPS Document Writer",
      "assignments": []
    },
    {
      "printer_id": "b00f8e38-b347-46e9-b51d-d9bcaab54c2b",
      "printer_name": "AnyDesk Printer",
      "assignments": []
    },
    {
      "printer_id": "a2af8a4c-ea54-4a2c-8881-3b75b141be09",
      "printer_name": "Samsung M2070 Series",
      "assignments": []
    },
    {
      "printer_id": "dc6ddec3-2685-49a4-bdb7-b60ebd4635a9",
      "printer_name": "Invia a OneNote 2010",
      "assignments": []
    },
    {
      "printer_id": "643e8e5b-2c47-4367-bf97-5ffccab11c95",
      "printer_name": "OneNote (Desktop)",
      "assignments": []
    },
    {
      "printer_id": "845f5c81-ba14-49a4-acd8-fa1d633418a2",
      "printer_name": "OneNote for Windows 10",
      "assignments": []
    }
  ]
}

Get Printers for Specific Groups

Lists the printers assigned to a group. Pass the group_id in the request.

GET "https://api2.ezeep.com/printing/v1/assignments/?group=<group_id>"

Response attributes:

Attribute Type Description
printer_id string uuid of the printer
printer_name string name of the printer
assignments list of objects groups assigned to the printer, with their settings

Example Request

curl  -X GET "https://api2.ezeep.com/printing/v1/assignments/?group=22222222-2222-4222-8222-222222222222" \
      --header "Authorization: Bearer <access_token>"

Example Response

{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "printer_id": "b5e91fac-88a2-42fb-83d3-e0f0e7990364",
      "printer_name": "ZDesigner GK420t 234",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "5a3deccc-8334-4512-9162-0bdfe8cc3552",
      "printer_name": "Canon MG3600 series Printer",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "15abe3b7-7711-401e-9dec-1add57eb888e",
      "printer_name": "TSC TE210",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    }
  ]
}

Assign Printers to Groups

To assign a printer to groups, pass the printer_id in the URL and the group_id values in the request body.

PATCH "https://api2.ezeep.com/printing/v1/assignments/<printer_id>/"
Attribute Type Required Description
printer_id string yes uuid of the printer (path parameter)
assignment list of objects yes list of groups assigned to the printer with their group_id

Example Request

curl  -X PATCH "https://api2.ezeep.com/printing/v1/assignments/15abe3b7-7711-401e-9dec-1add57eb888e/" \
      --header "Content-Type: application/json" \
      --header "Authorization: Bearer <access_token>" \
      --data '{
                "assignment": [
                  {
                    "groups": [
                      {
                        "group_id": "22222222-2222-4222-8222-222222222222"
                      }
                    ]
                  }
                ]
              }'

Example Response

{
  "printer_id": "15abe3b7-7711-401e-9dec-1add57eb888e",
  "printer_name": "TSC TE210",
  "assignments": [
    {
      "settings": null,
      "groups": [
        {
          "group_id": "22222222-2222-4222-8222-222222222222",
          "group_name": "free",
          "group_foreign_id": null,
          "force_chosen": false
        }
      ]
    }
  ]
}

Remove Printers from Groups

To remove a printer from a group, pass the printer_id in the URL and the group_id in the request body. The example removes printer 15abe3b7-7711-401e-9dec-1add57eb888e from group 22222222-2222-4222-8222-222222222222.

DELETE "https://api2.ezeep.com/printing/v1/assignments/<printer_id>/"
Attribute Type Required Description
printer_id string yes uuid of the printer (path parameter)
assignment list of objects yes list of groups assigned to the printer with their group_id

Example Request

curl  -X DELETE "https://api2.ezeep.com/printing/v1/assignments/15abe3b7-7711-401e-9dec-1add57eb888e/" \
      --header "Content-Type: application/json" \
      --header "Authorization: Bearer <access_token>" \
      --data '{
                "assignment": [
                  {
                    "groups": [
                      {
                        "group_id": "22222222-2222-4222-8222-222222222222"
                      }
                    ]
                  }
                ]
              }'

Example Response

204

Get Printers assigned to Users

Printers are assigned to groups, and a user can be part of multiple groups. To find the printers a user can access, first get the groups the user is part of, then list the printers of each group.

  • In the example, user_id 44444444-4444-4444-8444-444444444444 is part of two groups, so the user can use all printers assigned to either group.
GET "https://api2.ezeep.com/printing/v1/assignments/?group=<group_id>"
Type Key Value
Header Authorization Bearer

Example Request

curl  -X GET "https://api2.ezeep.com/printing/v1/assignments/?group=22222222-2222-4222-8222-222222222222" \
      --header "Authorization: Bearer <access_token>"

Example Response

{
  "count": 6,
  "next": null,
  "previous": null,
  "results": [
    {
      "printer_id": "b5e91fac-88a2-42fb-83d3-e0f0e7990364",
      "printer_name": "ZDesigner GK420t 234",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "30dbc200-f01e-4c59-9922-e5b02ee281cd",
      "printer_name": "Canon MG3600 series",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "359bf1fb-eb55-40e4-b7e4-8c637f5f549c",
              "group_name": "test2",
              "group_foreign_id": null,
              "force_chosen": false
            },
            {
              "group_id": "bd63ffd9-6904-46ec-b271-b258a59f07a5",
              "group_name": "test",
              "group_foreign_id": null,
              "force_chosen": false
            },
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "5a3deccc-8334-4512-9162-0bdfe8cc3552",
      "printer_name": "Canon MG3600 series Printer",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "4d7901a5-dcc6-4fd9-aa64-e3fe0604d53d",
      "printer_name": "TSC TE210x",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "15abe3b7-7711-401e-9dec-1add57eb888e",
      "printer_name": "TSC TE210",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    },
    {
      "printer_id": "176f7433-48b1-43c0-bf5f-637c0d831bdd",
      "printer_name": "Canon Generic UFR II Driver",
      "assignments": [
        {
          "settings": null,
          "groups": [
            {
              "group_id": "22222222-2222-4222-8222-222222222222",
              "group_name": "free",
              "group_foreign_id": null,
              "force_chosen": false
            }
          ]
        }
      ]
    }
  ]
}
  • The user can use all 6 printers of this group. Send the same request with the group_id of each of the user’s other groups.