Skip to content

Latest commit

 

History

History
101 lines (77 loc) · 3.68 KB

printer-post-tasktriggers.md

File metadata and controls

101 lines (77 loc) · 3.68 KB
title description author localization_priority ms.prod doc_type
Create taskTrigger
Create a new task trigger on the specified printer.
braedenp-msft
Normal
universal-print
apiPageType

Create taskTrigger

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Create a new task trigger on the specified printer. Currently, only one task trigger can be specified per printer, but this limit may be removed in the future. Additionally, only the application that registered the printer can manage its task triggers.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

In addition to the following permissions, the user's tenant must have an active Universal Print subscription. The logged-in user must be a Print Administrator.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Printer.ReadWrite.All, Printer.FullControl.All
Delegated (personal Microsoft account) Not Supported.
Application Not Supported.

HTTP request

POST /print/printers/{id}/taskTriggers

Request headers

Name Description
Authorization Bearer {token}. Required.
Content-type application/json. Required.

Request body

In the request body, supply a JSON representation of a printTaskTrigger object. Supply a reference to a printTaskDefinition by using the @odata.bind format, as shown in the following example.

Response

If successful, this method returns a 201 Created response code and a printTaskTrigger in the response body.

Example

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/print/printers/ae63f617-4856-4b45-8ea9-69dfbeea230e/taskTriggers

{
  "event": "jobStarted",
  "definition@odata.bind": "https://graph.microsoft.com/beta/print/taskDefinitions/3203656e-6069-4e10-8147-d25290b00a3c"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]



Response

The following is an example of the response.

Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.

HTTP/1.1 201 Created
Content-type: application/json
Content-length: 196

{
  "@odata.context": "https://graph.print.microsoft.com/v1.0/$metadata#Collection(Microsoft.Graph.PrintTaskTrigger)",
  "id": "b6a843ca-e60e-4e20-a222-a58d85eead6d",
  "event": "jobStarted"
}