Google API

pathat
Kilo Expert

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.

20 REPLIES 20

Thanks for the update brantgluth. It seems that we are on our own in this endeavor. I still have hope to build this in SN. Wish me luck.


Well my Google solution ended up being a little more complicated than I expected, but I have a functional product at this point.



Background:


What we're doing on our side is creating an onboarding   catalog item for managers that, once the criteria are filled out, will automatically create for the requested user


  • A username and password to our specs that does not exist in the four following systems/services
  • ServiceNow Account lionked to the department, manager and location of the request
  • Active Directory accounts for the new users assigned to all the proper access and security groups based off an OU user template
  • Google account   assigned to the proper org units and distribution lists
  • Office 365 account for the users.


The Google component was the major roadblock for me with the REST call as I needed a service account to work with so that the midserver would not be sitting there waiting for an OAUH approval click from a user



I built a .NET dll to wrap all of the authentication (p12 etc) to streamline Google   access via their .NET API. I tied that dll into a .NET web API web service which I was planning to make JSON REST   calls from ServiceNow on our internal Network usign REST Messages annd Custom Activities. When the project was started, I had the impression that the REST calls were made from the midserver, not from the ServiceNow website instance.



Once created, REST messages from ServiceNow could not reach it without my opening ports on our firewall (all sorts of 404ery). As I have the authentication built into the dll, this   would not work for me as I would be perpetually losing sleep about other folk accessing it no matter how I much I locked it down. As such, I am using Powershell custom activity and the Invoke-RestMethod method to access our internal web service to make all of the Google calls and return information to our workflow for branching. This is actually working very well right now. Just took a little bit looking around the problem in a different way.   There may be a way to make REST calls internal from the mid server, I just haven't found it yet, and I wanted to get this project done. As the PowerShell is actually run from the midserver, it stays internal to our network, and provides me all the security that I wish to have with our Google API.



I realize this complicated a process is not going to be useful/practical for resolving OAUTH and Google via the SNow interface, and if an easier way comes along, I'd love to hear bout it.


So do you know if the Google API you are needing is API key accessible?



For one client, I needed to estimate the cost of airfare (Trip Request Catalog Item).   We chose to use the Google QPX Express API.   An instead of using OAuth to get access to the API, we created an API key via the console.developers.google.com.   This made using the API simple and the only overhead was securing the API key which we placed in an application property.   I believe that many of the Google API provide access via an API key.



As for having a Mid Server making web service request.   I have a Mid Server making SOAP calls and I would assume that REST is also possible. For another customer (since you are already building .NET code), we stood up a MidServerHelper web service.   A workflow on SN drop a SOAP request into the ECC queue which triggers the MidServer to make a web service call to the MidServerHelper, the data pass to the MidServerHelper is use to populate a PDF template with the information pass in and then attach the PDF document back on the SN record.



Just Thoughts,


Gene


I am   using the API keys from developers.google.et al for our access. I pulled a   p12 key down and have it embedded as a resource in my dll wrapper that my web service calls (which in turn handles Powershell rest calls to and from the midserver


Amruta12
Tera Contributor

Hi Gene



Do you mind putting up some screenshots from Servicenow end? What did you set the Authentication Type as? I am calling the Google API passing the key but it is not working.