編輯

Create pullPrintPrinter

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Create a new pullPrintPrinter object asynchronously.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permission Higher privileged permissions
Delegated (work or school account) PullPrintPrinter.FullControl.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Important

For delegated access using work or school accounts, the signed-in user must have a tenant-wide assignment to a supported Microsoft Entra role. Printer Administrator is the least privileged role supported for this operation.

HTTP request

POST /print/pullPrintPrinters

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the pullPrintPrinter object.

You can specify the following properties when you create a pullPrintPrinter.

Property Type Description
displayName String A nonempty name for the pull print printer. Required.
includeAllPrinters Boolean Indicates whether every printer in the tenant is automatically a member of this pull print printer. Optional. The default is false. When false, add specific printers to the printers relationship.

Response

If successful, this method returns a 202 Accepted response code and no response body.

The Location response header contains the URL of the pullPrintPrinterCreateOperation. The legacy Operation-Location header is also supported and contains the same URL. The Retry-After header specifies the number of seconds to wait before polling.

Use the Get pullPrintPrinterCreateOperation API at the operation URL to retrieve the operation JSON and monitor its status. Observe the Retry-After interval when polling and stop when status.state is succeeded or failed. When creation succeeds, use the pullPrintPrinter relationship of the operation to get the created pullPrintPrinter object.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/print/pullPrintPrinters
Content-Type: application/json

{
  "displayName": "Contoso Pull Print - Building 5",
  "includeAllPrinters": false
}

Response

The following example shows the response.

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/print/operations/f0d0f0f0-1234-5678-9abc-def012345678
Operation-Location: https://graph.microsoft.com/beta/print/operations/f0d0f0f0-1234-5678-9abc-def012345678
Retry-After: 5