OneDrive / onedrive-api-docs

Official documentation for the OneDrive API
MIT License
453 stars 227 forks source link

Issue with callback after opening files in OneDrive File Picker v7.0 #523

Closed vitalijssilins closed 7 years ago

vitalijssilins commented 7 years ago

Dear team,

I have an issue while opening files through OneDrive File Picker: popup is succesfully opened, I am chosing a file and after the popup is closed, the request to OneDrive API is made and 500 error is thrown:

{
  "error": {
    "code": "generalException",
    "message": "General Exception While Processing",
    "innerError": {
      "request-id": "e2eab86d-645a-4df4-93e1-5cdb33f1ebdd",
      "date": "2017-02-24T14:53:48"
    }
  }
}

Code for file picker:

    filePickerOnedrive(): void {
        let odOptions = {
            clientId: AppSettings.ONEDRIVE_CLIENT_ID,
            action: "query",
            multiSelect: false,
            openInNewWindow: true,
            advanced: {
                queryParameters: "select=id,parentReference,name"
            },
            success: (files) => {
                var file = files.value[0];
                this.templatePath = file.parentReference.path.split(":", 2)[1] + '/' + file.name;
                // force angular 2 to detect changes
                this.changeDetectorRef.detectChanges();
            },
            error: function(e) {
                Materialize.toast(e, 6000);
            }
        };

        OneDrive.open(odOptions);
    }

Request headers:

GET /v1.0/drive/items/46D43437B377753C!324?select=id%2CwebUrl&expand=children(select%3Did%2CparentReference%2Cname) HTTP/1.1
Host: graph.microsoft.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Origin: http://localhost:3000
Application: 0x456e7b6a-b3c3-4283-8ad9-80a9843e8238
X-RequestStats: SDK-Version=js-v2.1
Authorization: bearer [cut-for-anonimity]
Accept: */*
DNT: 1
Referer: http://localhost:3000/admin/templates
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8,ru;q=0.6,lv;q=0.4

Response headers:

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json
request-id: e2eab86d-645a-4df4-93e1-5cdb33f1ebdd
client-request-id: e2eab86d-645a-4df4-93e1-5cdb33f1ebdd
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceB","ScaleUnit":"000","Host":"AGSFE_IN_4","ADSiteName":"AMS"}}
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id
Duration: 130.1266
Date: Fri, 24 Feb 2017 14:53:48 GMT
daboxu commented 7 years ago

@vitalijssilins thanks for the notice, it is some issue with Graph API we are tracking, will be back after it is resolved.

daboxu commented 7 years ago

@vitalijssilins it should be fixed now, could you please confirm that?

vitalijssilins commented 7 years ago

@daboxu I confirm - it works now. Thank you!