title | description | author | ms.localizationpriority | ms.subservice | doc_type |
---|---|---|---|---|---|
printer: create |
Creates (registers) a printer with the Universal Print service. |
braedenp-msft |
medium |
universal-print |
apiPageType |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Create (register) a printer with the Universal Print service. This is a long-running operation and as such, it returns a printerCreateOperation that can be used to track and verify the registration of the printer.
[!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.
[!INCLUDE permissions-table]
POST /print/printers/create
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-type | application/json. Required. |
In the request body, provide a JSON object with the following properties.
Parameter | Type | Description | Required? |
---|---|---|---|
displayName | String | The display name to assign to the printer. | Yes |
manufacturer | String | The manufacturer of the printer. | Yes |
model | String | The model of the printer. | Yes |
physicalDeviceId | String | The physical device UUID of the printer. Required if the hasPhysicalDevice property is true. |
No |
hasPhysicalDevice | Boolean | True if the printer has physical output device, false otherwise. If omitted, the default value is true. | No |
certificateSigningRequest | printCertificateSigningRequest | The X.509 Certificate Signing Request (CSR) for the certificate created and used by the printer to identify itself. | Yes |
connectorId | String | Id of Connector acting as proxy to the printer. | No |
If successful, this method returns a 202 Accepted
response code and a link to the associated printerCreateOperation in the Operation-Location
header.
Making a GET request to the linked URL can be used to get the status of an ongoing printer registration. Once printer registration has completed successfully, a GET request to the linked URL will contain the created printer object and registered certificate.
The following example shows a request.
POST https://graph.microsoft.com/beta/print/printers/create
Content-type: application/json
{
"displayName": "Test Printer",
"manufacturer": "Test Printer Manufacturer",
"model": "Test Printer Model",
"physicalDeviceId": null,
"hasPhysicalDevice": false,
"certificateSigningRequest": {
"content": "{content}",
"transportKey": "{sampleTransportKey}"
},
"connectorId": null
}
[!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]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 202 Accepted
Operation-Location: https://graph.microsoft.com/beta/print/operations/f221760a-52e8-4c11-b8c5-5dfaef3a49db
Retry-After: 5