Google API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 07:22 AM
Hello.
Has anybody experiment or developed a workflow in ServiceNow that calls out to Google using the Google APIs? I'm interested in hearing about your experiences and lessons learned.
I am interested in managing users in my Google domain via the Google Directory API.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2016 08:27 AM
I've been trying to do the same thing to get away from using Orchestration and the GAM command line tool (Google App Manager, I think). It has been kind of sketchy sending lists through PowerShell to execute through GAM, as I've run into issues with firewall problems and occasional temporary authentication issues. I've also used it in the past to automatically disable email accounts when employees are terminated.
So I was looking through this document about the Google Contacts API:
Outbound REST with OAuth 2.0 profile tutorial - integrating with Google Contacts API
Which has step-by-step directions for creating the Google Project and credentials, then OAuth profile in Service Now, and finally creating a REST message. It's a great document, except that I'm currently stuck at the point in the REST message where I request the OAuth token, as I get back a response "Unsupported OAuth grant type 'Authorization Code'." I've gone back through the directions, recreated credentials, tried variations on what's in the document, but with no luck. The account does have the Contacts API enabled.
So if anyone has any suggestions, I'd appreciate it. I'm trying this on a Geneva instance with the OAuth 2.0 plugin enabled, if that's relevant. My interest is in creating and populating Google Groups and updating calendars using the Google API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2016 01:42 PM
Can you share your configuration for the OAuth Provider and the OAuth Profile? Make sure that Authorization code is selected on the OAuth Profile.
Just FYI if you install plugin "Email - OAUTH support for IMAP and SMTP" it installs a sample Google OAuth provider that you can take and modify or else create one that mimics it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 04:48 AM
Thanks for the pointer to the Oauth support plugin. There were a couple of lines that I changed in mine to match the one it installed, but I'm still getting this Unsupported OAuth grant type 'Authorization Code' message. I'll put screen shots of the registration and the message below. This is where I was trying the calendar access one in the link I posted earlier. Am I correct in assuming that the error message is coming from the Google side of things instead of the Service Now side?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 07:58 AM
I think the problem is your OAuth API Script. Try referencing "OAuthUtil" instead of OAuthAccessToken.
To support refresh token flow with Google, you'll also have to specify some additional parameters on your authorization code request. Now that you've installed the Email OAuth plugin, you should actually have an extension to OAuthUtil called "OAuthGoogleOfflineAccess". Reference that in your OAuth API Script field. It sets the access_type=offline and approval_prompt=force parameters that will tell Google you want refresh token behavior.