Integration, failing on createUploadSession call

Copper Contributor

Hello.

 

Implementing against universal print graph api.

Have so far got result for

- getting print shares using :

print/shares?$select=id,name,defaults,capabilities

- creating printer job :

print/shares/%%PrinterId%%/jobs

 

and now I'm stuck with createUploadSession call:

print/shares/%%PrinterId%%/jobs/%%JobId%%/documents/%%DocumentId%%/createUploadSession

 

Based on

https://docs.microsoft.com/en-us/graph/api/printdocument-createuploadsession?view=graph-rest-beta I need to have PrintJob.ReadWrite.All permission, which I have  (including 
Printer.ReadWrite.All)
 
but when I try POST request with body

 

 

 

{
    "properties": {
        "documentName": "example.pdf",
        "contentType": "application/pdf",
        "size": 144547
    }
}

 

 

then I keep getting "UnknownError - The token does not have one or more required security scopes", i.e.

 

 

 

{
    "error": {
        "code": "UnknownError",
        "message": "\"The token does not have one or more required security scopes.\"",
        "innerError": {
            "date": "2020-10-30T14:48:12",
            "request-id": "9b6e5a98-2b38-428c-9175-335bfce3feee",
            "client-request-id": "9b6e5a98-2b38-428c-9175-335bfce3feee"
        }
    }
}

 

 

 

 

 

what are those "security scopes" what it is after?

 

Unfortunately sample app is outdate so this doesn't even use this call. Sample app is using deprecated call 

print/shares/%%PrinterId%%/jobs/%%JobId%%/documents/%%DocumentId%%/uploadData

so no hints there.

 

Does anyone know solution for this?

Thanks!

1 Reply

Got reply on my question in https://github.com/microsoftgraph/microsoft-graph-docs/issues/10486#issuecomment-719839157

 

that I would need also PrinterShare.ReadWrite.All permission. This got further from this initial error message to next - seems application/pdf is not supported :S

 

Unsupported document-format: application/pdf.
Supported formats: Attribute document-format-supported: SimpleIppValue-Type:MimeMediaType-Value:application/oxps