列出 printJobsList printJobs

命名空间:microsoft.graphNamespace: microsoft.graph

重要

/betaMicrosoft Graph 中的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

检索与 打印机关联的打印作业的列表。Retrieve a list of print jobs associated with the printer.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

若要使用通用打印服务,用户或应用程序的租户必须具有活动的通用打印订阅、授予 " 获取打印机 访问" 权限的权限以及下表中列出的权限之一。To use the Universal Print service, the user or app's tenant must have an active Universal Print subscription, a permission that grants Get printer access, and one of the permissions listed in the following table. 登录用户必须是 打印机管理员The signed in user must be a Printer Administrator.

若要从其他用户读取打印作业,则已登录用户必须是打印管理员,并且必须是 PrintJob、PrintJob、PrintJob 或 ReadWriteBasic。所有权限的 User.readbasic.all。To read print jobs from another user, the signed in user needs to be a print administrator and have the PrintJob.ReadBasic.All, PrintJob.Read.All, PrintJob.ReadWriteBasic.All, or PrintJob.ReadWrite.All permission.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) PrintJob、PrintJob、user.readbasic.all、PrintJob、PrintJob、ReadWriteBasic、all、PrintJob、PrintJob、ReadWriteBasic、PrintJob、、、、allPrintJob.ReadBasic, PrintJob.Read, PrintJob.ReadBasic.All, PrintJob.Read.All, PrintJob.ReadWriteBasic, PrintJob.ReadWrite, PrintJob.ReadWriteBasic.All, PrintJob.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not Supported.
ApplicationApplication PrintJob、PrintJob、PrintJob、all、all、All 和 All。PrintJob.ReadBasic.All, PrintJob.Read.All, PrintJob.ReadWriteBasic.All, PrintJob.ReadWrite.All

HTTP 请求HTTP request

GET /print/printers/{id}/jobs

可选的查询参数Optional query parameters

此方法支持一些 OData 查询参数来帮助自定义响应。This method supports some of the OData query parameters to help customize the response. 若要了解一般信息,请参阅 OData 查询参数For general information, see OData query parameters.

  • 默认情况下," documents " 属性将从响应中省略。The documents property is omitted from the response by default. 若要同时为每个打印作业返回 printDocuments 的列表,请使用 $expand=documentsTo also return a list of printDocuments for each print job, use $expand=documents.
  • 此方法支持通过创建打印作业的用户对其进行筛选。This method supports filtering print jobs by the user who created them. 使用 $filter=createdBy/userPrincipalName eq '{upn}' ,其中 {upn} 是关联用户的 用户主体名称Use $filter=createdBy/userPrincipalName eq '{upn}', where {upn} is the user principal name of the associated user.

ExceptionsExceptions

某些运算符不受支持: $count$search$filterSome operators are not supported: $count, $search, $filter.

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.

请求正文Request body

请勿提供此方法的请求正文。Do not supply a request body for this method.

响应Response

如果成功,此方法 200 OK 在响应正文中返回响应代码和 printJob 对象集合。If successful, this method returns a 200 OK response code and collection of printJob objects in the response body.

示例Example

请求Request

下面展示了示例请求。The following is an example of the request.

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

响应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: 461

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#print/printers('c05f3726-0d4b-4aa1-8fe9-2eb981bb26fb')/jobs",
  "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."
      }
    }
  ]
}