You need to sign in to do that
Don't have an account?
Suraj Singh
Salesforce - One Drive integeration Error
Hi All,
Whenever we make a request to Microsoft one drive, it will always throws the error
When we made a request to create a folder or upload a file on one-Drive, if will done successfully but the response is still same, Since response was not correct, so we are unable to know is folder created or not?, what was the id of created folder?
Here is the code that we are using to get USER.
Whenever we make a request to Microsoft one drive, it will always throws the error
{ "error": { "code": "BadRequest", "message": "The MIME type 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' requires a '/' character between type and subtype, such as 'text/plain'.", "innerError": { "request-id": "8b4202bd-d0db-4c2f-9c0a-9186aae3f6ee", "date": "2017-05-01T17:20:30" } } }Now the strange thing is that,
When we made a request to create a folder or upload a file on one-Drive, if will done successfully but the response is still same, Since response was not correct, so we are unable to know is folder created or not?, what was the id of created folder?
Here is the code that we are using to get USER.
Http h = new Http(); HttpRequest req = new HttpRequest(); req.setMethod('GET'); req.setHeader('Authorization', 'Bearer ' + accessToken); req.setEndpoint('https://graph.microsoft.com/v1.0/users'); HttpResponse res; try { res = h.send(req); System.debug('HTTP Response Code: ' + res.getStatusCode()); System.debug('Response Body: ' + res.getBody()); } catch (Exception e) { System.debug('Callout Error:' + e.getMessage()); }Thank you.
You will need to check what Content-Type's the request supports.