Servicenow and googledrive integration

Sharath807
Tera Contributor

Hi all am trying to integrate servicenow and googledrive .I created generated client id , client secret, auth url, token url etc.from google api .Then created application registry in servicenow and also rest message .Now am facing issue in getting token . When I click 'Get OAuth Token' in rest message after filling required datas. Its display error as shared below.

Screenshot (215)_LI.jpg

Can anyone help to solve this.

4 REPLIES 4

Ratnakar7
Mega Sage
Mega Sage

Hi @Sharath807 ,

 

To resolve this issue, make sure you include the scope parameter in your request when obtaining the OAuth token. The scope parameter should specify the required access scopes for your integration with Google Drive.

Here's an example of how you can include the scope parameter in your token request:

  1. In your ServiceNow REST Message record, navigate to the "Endpoint" related list.

  2. Edit the existing endpoint record or create a new one.

  3. Add the scope parameter to the "Query Parameters" section.

  4. Set the value of the scope parameter to the desired access scopes. For Google Drive integration, you can use the following scope for basic read/write access:

 

scope=https://www.googleapis.com/auth/drive

 

If you need additional scopes, you can specify them using space-separated values. For example, to access both Google Drive and Google Calendar, you can use:

 

scope=https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/calendar

 

     

       5. Save the endpoint record and test your REST Message again by clicking "Get OAuth Token".

By including the scope parameter with the appropriate access scopes, you should be able to obtain the OAuth token successfully and continue with your integration between ServiceNow and Google Drive.

Make sure to review the Google Drive API documentation for a complete list of available scopes and their respective permissions:

https://developers.google.com/drive/api/v3/about-auth

 

 

Thanks,

Ratnakar

Sharath807
Tera Contributor

@Ratnakar7 Hi sir , I added query parameter as u mentioned ..still its showing same error
Screenshot (217).pngScreenshot (218).png

Sharath807
Tera Contributor

@Ratnakar7 hi sir further I need to make any changes?

Sharath807
Tera Contributor

@Ratnakar7 Hi sir now the access token is available and it has validity period.. Now  what can i  do to copy attachment from custom form to google drive folder. Is it possible using business rule.
Screenshot (230).png

can you help me to achieve this.. am new to integration