Skip to content

Latest commit

 

History

History
98 lines (79 loc) · 3.44 KB

printer-post-jobs.md

File metadata and controls

98 lines (79 loc) · 3.44 KB
title description author localization_priority ms.prod doc_type
Create printJob
Create a new printJob for a printer.
braedenp-msft
Normal
universal-print
apiPageType

Create printJob

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Create a new printJob for a printer.

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 or app's tenant must have an active Universal Print subscription and have a permission that grants Get printer access. The logged-in user must be a Print Administrator.

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

HTTP request

POST print/printers/{id}/jobs

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 printJob object, including one printDocument object. The job and document IDs are set automatically during resource creation.

Right now, Universal Print supports only one printDocument per printJob object.

Response

If successful, this method returns a 201 Created response code and a printJob object and associated printDocument in the response body.

Example

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/print/printers/{id}/jobs

[!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 200 OK
Content-type: application/json
Content-length: 425

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#print/printJobs/$entity",
  "value": [
    {
      "id": "5182",
      "createdDateTime": "2020-02-04T00:00:00.0000000Z",
      "createdBy": {},
      "status": {
        "processingState": "completed",
        "processingStateDescription": "The print job has completed successfully and no further processing will take place."
      }
    }
  ]
}