Se requiere uno de los siguientes permisos para llamar a esta API. Para obtener más información, incluido cómo elegir permisos, vea Permisos.
Para usar el servicio de impresión universal, el inquilino del usuario o de la aplicación debe tener una suscripción de impresión universal activa, además de los permisos enumerados en la tabla siguiente. El usuario que ha iniciado sesión debe ser un administrador de impresoras.
No proporcione un cuerpo de solicitud para este método.
Respuesta
Si se ejecuta correctamente, este método devuelve un 200 OK código de respuesta y un objeto de impresora en el cuerpo de la respuesta.
De forma predeterminada, la respuesta no contiene capacidades de impresora. Para obtener printerCapabilities, use el parámetro de $select consulta.
GET https://graph.microsoft.com/v1.0/print/printers/{printerId}
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Print.Printers["{printer-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
printers, err := graphClient.Print().Printers().ByPrinterId("printer-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Printer result = graphClient.print().printers().byPrinterId("{printer-id}").get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.print.printers.by_printer_id('printer-id').get()
GET https://graph.microsoft.com/v1.0/print/printers/{printerId}?$select=id,displayName,capabilities
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Print.Printers["{printer-id}"].GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "id","displayName","capabilities" };
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphprint "github.com/microsoftgraph/msgraph-sdk-go/print"
//other-imports
)
requestParameters := &graphprint.PrintPrinterItemRequestBuilderGetQueryParameters{
Select: [] string {"id","displayName","capabilities"},
}
configuration := &graphprint.PrintPrinterItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
printers, err := graphClient.Print().Printers().ByPrinterId("printer-id").Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Printer result = graphClient.print().printers().byPrinterId("{printer-id}").get(requestConfiguration -> {
requestConfiguration.queryParameters.select = new String []{"id", "displayName", "capabilities"};
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.print.printers.item.printer_item_request_builder import PrinterItemRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = PrinterItemRequestBuilder.PrinterItemRequestBuilderGetQueryParameters(
select = ["id","displayName","capabilities"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.print.printers.by_printer_id('printer-id').get(request_configuration = request_configuration)