You need to sign in to do that
Don't have an account?
Rodolfo Noviski
Salesforce Integration with Google Drive
Hello , I 'm trying to accomplish the following request:
request.setHeader('Authorization', 'Bearer {Token}');
String scope = 'https://www.googleapis.com/auth/drive,'+
'https://www.googleapis.com/auth/drive.file'+
'https://www.googleapis.com/auth/drive.appdata'+
'https://www.googleapis.com/auth/drive.apps.readonly'+
'https://www.googleapis.com/auth/drive.metadata.readonly'+
'https://www.googleapis.com/auth/drive.readonly'+
'https://www.googleapis.com/auth/drive.scripts';
request.setHeader('Content-Type','application/json');
request.setHeader('User-Agent','salesforce-toolkit-googledata/21');
request.setHeader('Scope', scope);
String body = '{\'value\':\'drive.permissions.insert\',\'type\':\'anyone\',\'role\':\'writer\'}';
request.setBody(body);
System.debug('Set Endpoint');
request.setEndpoint(endpoint);
System.debug('Set Method');
request.setMethod('POST');
But I do not know how to automatically get the token that is sought. Could anyone help me?
thank you
request.setHeader('Authorization', 'Bearer {Token}');
String scope = 'https://www.googleapis.com/auth/drive,'+
'https://www.googleapis.com/auth/drive.file'+
'https://www.googleapis.com/auth/drive.appdata'+
'https://www.googleapis.com/auth/drive.apps.readonly'+
'https://www.googleapis.com/auth/drive.metadata.readonly'+
'https://www.googleapis.com/auth/drive.readonly'+
'https://www.googleapis.com/auth/drive.scripts';
request.setHeader('Content-Type','application/json');
request.setHeader('User-Agent','salesforce-toolkit-googledata/21');
request.setHeader('Scope', scope);
String body = '{\'value\':\'drive.permissions.insert\',\'type\':\'anyone\',\'role\':\'writer\'}';
request.setBody(body);
System.debug('Set Endpoint');
request.setEndpoint(endpoint);
System.debug('Set Method');
request.setMethod('POST');
But I do not know how to automatically get the token that is sought. Could anyone help me?
thank you
You need to have App key,App Secret and redirect Uri for sending the request to google drive from your salesforce org.After authorization will get successful you will get access token If this helps you out mark it as best ans to help other !!!