You need to sign in to do that
Don't have an account?

Automate Google Drive Integration
Hello everyone.
I have a requirement that asks me to backup the documents in Salesforce in Google Drive.
I have already managed to connect and load the documents, but I need to automate this process, logging into Google automatically without the screen in which I request the credentials.
I do not have much experience in web services, so I do not know if I'm doing the order right to the server.
Is there a way to pass the email and password in the body of the request to log in?
Greetings thank you!
I have a requirement that asks me to backup the documents in Salesforce in Google Drive.
I have already managed to connect and load the documents, but I need to automate this process, logging into Google automatically without the screen in which I request the credentials.
I do not have much experience in web services, so I do not know if I'm doing the order right to the server.
HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setEndpoint('https://accounts.google.com/o/oauth2/token'); req.setHeader('content-type', 'application/x-www-form-urlencoded'); String messageBody = 'code='+code+'&client_id='+key+'&client_secret='+secret+'&redirect_uri='+redirect_uri+'&grant_type=authorization_code'; req.setHeader('Content-length', String.valueOf(messageBody.length())); req.setBody(messageBody); req.setTimeout(60*1000); Http h = new Http(); String resp; HttpResponse res = h.send(req); resp = res.getBody();
Is there a way to pass the email and password in the body of the request to log in?
Greetings thank you!