SOLVED

Can't update printer

Copper Contributor

When trying to call this API: (https://docs.microsoft.com/en-us/graph/api/printer-update?view=graph-rest-1.0&tabs=http)

 

I get back the following response:

{
    "error": {
        "code""400",
        "message""One or more of the atributes provided are not supported by the printer.",
        "innerError": {
            "date""2021-04-19T16:23:32",
            "request-id""bab5ec38-e37c-4579-8f4e-f7c309f3d9b5",
            "client-request-id""bab5ec38-e37c-4579-8f4e-f7c309f3d9b5"
        }
    }
}
 
This is when I send the identical defaults that I received on a GetPrinter call:
{
    "defaults": {
        "copiesPerJob"1,
        "finishings": [
            "none"
        ],
        "mediaColor""Unknown",
        "mediaType""stationery",
        "mediaSize""North America Letter",
        "pagesPerSheet"1,
        "orientation""portrait",
        "outputBin""auto",
        "inputBin""auto",
        "documentMimeType""application/oxps",
        "pdfFitToPage"false,
        "duplexConfiguration""oneSided",
        "presentationDirection""clockwiseFromBottomLeft",
        "printColorConfiguration""color",
        "printQuality""medium",
        "contentType""application/oxps",
        "fitPdfToPage"null,
        "multipageLayout"null,
        "colorMode""color",
        "quality""medium",
        "duplexMode""oneSided",
        "dpi"600,
        "scaling"null
    }
}
 
I've tried the process of elimination to determine which default it doesn't like, but it seems like there are many that cause this error. I can successfully just set copiesPerJob, orientation, and outputBin, for what its worth.
 
Can you tell me what defaults are supported at this time?
 
Thanks
 
Matt Cecile
 
1 Reply
best response confirmed by MCecile (Copper Contributor)
Solution

@MCecile 

Hi,

The defaults being configured should be present in the capabilities of the printer.
You can get the capabilities of the printer using this API:
GET https://graph.microsoft.com/v1.0/print/printers/{printerId}?$select=id,displayName,capabilities

 

1 best response

Accepted Solutions
best response confirmed by MCecile (Copper Contributor)
Solution

@MCecile 

Hi,

The defaults being configured should be present in the capabilities of the printer.
You can get the capabilities of the printer using this API:
GET https://graph.microsoft.com/v1.0/print/printers/{printerId}?$select=id,displayName,capabilities

 

View solution in original post