Forum Discussion

elvinristi's avatar
elvinristi
Copper Contributor
Oct 30, 2020

Integration, failing on createUploadSession call

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!

Resources