| title | Get printJob |
|---|---|
| description | Retrieve the properties and relationships of a print job. |
| author | braedenp-msft |
| ms.localizationpriority | medium |
| ms.subservice | universal-print |
| doc_type | apiPageType |
| ms.date | 09/24/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Retrieve the properties and relationships of a print job.
[!INCLUDE national-cloud-support]
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.
Note: For an app with delegated permissions to cancel other users' jobs, the signed-in user must be a member of the Printer Administrator role.
For an app with application permissions to retrieve users' jobs, the app needs a permission that grants Get printer access along with one of the application permissions described in the Permissions table.
[!INCLUDE permissions-table]
To get a job from a printer:
GET /print/printers/{id}/jobs/{id}To get a job from a printer share:
GET /print/shares/{id}/jobs/{id}This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a printJob object in the response body.
The following example shows a request to get metadata for a print job.
GET https://graph.microsoft.com/beta/print/printers/c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb/jobs/5182
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#print/printers('c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb')/jobs/$entity",
"id": "5182",
"displayName": "testjob",
"createdDateTime": "2020-02-04T00:00:00.0000000Z",
"createdBy": {
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"displayName": "John Smith",
"userPrincipalName": "john.smith@contoso.com"
},
"status": {
"state": "completed",
"description": "The print job has completed successfully and no further processing will take place.",
"details": []
},
"redirectedTo": null,
"redirectedFrom": null,
"isFetchable": false
}The following example shows a request to get a print job and any tasks that are running or have run against it.
GET https://graph.microsoft.com/beta/print/printers/c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb/jobs/5182?$expand=tasks
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#print/printers('c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb')/jobs(tasks())/$entity",
"id": "5182",
"displayName": "testjob",
"createdDateTime": "2020-06-30T17:18:52.3930472Z",
"createdBy": {
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"displayName": "John Smith",
"userPrincipalName": "john.smith@contoso.com"
},
"status": {
"state": "completed",
"description": "The print job has completed successfully and no further processing will take place.",
"details": []
},
"redirectedTo": null,
"redirectedFrom": null,
"isFetchable": false,
"configuration": {},
"tasks": [
{
"id": "d036638b-1272-4bba-9227-732463823ed3",
"parentUrl": "https://graph.microsoft.com/beta/print/printers/c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb/jobs/5182",
"status": {
"state": "processing",
"description": "The task is being processed."
}
}
]
}The following example shows a request to get a print job and its associated document data.
GET https://graph.microsoft.com/beta/print/printers/86b6d420-7e6b-4797-a05c-af4e56cd81bd/jobs/31216?$expand=documents
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#print/printers('86b6d420-7e6b-4797-a05c-af4e56cd81bd')/jobs(documents())/$entity",
"id": "31216",
"displayName": "testjob",
"createdDateTime": "2020-06-26T04:20:06.5715544Z",
"createdBy": {
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"displayName": "John Smith",
"userPrincipalName": "john.smith@contoso.com"
},
"status": {
"state": "completed",
"description": "The print job has completed successfully and no further processing will take place.",
"details": []
},
"redirectedTo": null,
"redirectedFrom": null,
"isFetchable": false,
"configuration": {},
"documents": [
{
"id": "ca96c367-c3ad-478a-bbce-fbd1cd856e73",
"displayName": "",
"contentType": "application/oxps",
"size": 276604
}
]
}