GoogleKit was designed to simplify the way your Shortcuts connect to the Google API.
Powered by Google
Graphics by MediaKit
Note: Instructions on how to configure this Shortcut are below. If you experience issues or require any assistance, don’t hesitate to contact me via Reddit.
Overview
This shortcut was designed to remove some of the bloat from Shortcuts that utilise the Google API (as well as remove some of the headache). When you implement GoogleKit, you’ll be able to remove over 200 Actions (per Shortcut) and still ensure you’re receiving an active Access Token.
GoogleKit (once setup), will allow access to all of the Google API calls as well are check the Access Token each time your Shortcut is run to make sure it’s still active. If it’s no longer active, it will automatically refresh with the API to make sure everything runs smoothly.
Thanks to GoogleKit, implementing the Google API won’t be as tedious as before. If we wanted to publish a Shortcut that used Google’s API, I found the daily quota to be very low and easily hit. Now thanks to this Shortcut, every user will have their on indicidual quota! This means if one person hits the quota, the service won’t be down for everybody.
Documentation
Setup Instructions
Tip: Follow each step to the letter, this is to minimise the risk of you encountering any issues.
- Visit THIS link to the Google Developer Console.
- Create a new project and call it ”Shortcuts”.
- Visit THIS link to the Google API Credentials page.
- Type “Shortcuts” in ”Application Name” and save it.
- Visit THIS link to the Google oAuth page.
- Select “Web Application” and type “http://localhost/“ (lowercase) into the ”Authorised Redirect URI” box, then create the application.
- Download and run the ”GoogleKit”Shortcut, you will be guided through the rest of the setup from there.
- Done.
Tip: Follow the instructions below each time you install a GoogleKit compatible Shortcut.
- Install a GoogleKit compatible Shortcut such as ”YouTube Manager”.
- Run the new Shortcut once before running ”GoogleKit”.
- Head into ”Settings” and tap on ”Add API”.
- Tap on the new Shortcut and Enable all of the listed API’s.
- Head into ”Settings” and tap on ”Grant Scope”.
- Tap on the new Shortcut and Enable all of the listed Scopes.
- Done.
Implementation
Implementation of GoogleKit couldn’t be easier, all it requires from you is around 7 Actions in total placed near the top of your Shortcut. After you add them, you are good to go.
I do however, highly recommend that you inform people when they run your Shortcut to check GoogleKit for your required Scopes / API’s.
Access Token
GoogleKit can fetch the latest Access Token for you, all this takes is placing 3 Actions near the top of your Shortcut.
- Place the Text Action and type “refresh_token” inside.
- Place the Run Shortcut Action and select the “GoogleKit” Shortcut.
- Place the Set Variable Action and name it “access_token”.
Required API
If you need to set a list of required API’s for your Shortcut, all you need to do is add 2 Actions after Access Token.
- Place the Dictionary Action, add the API name in ”Key” and the API URL in ”Value”.
- Place the Save File Action and set the destination path as “GoogleKit/API/SHORTCUT NAME.json”, and enable ”Overwrite If File Exists”.
Required Scopes
If you’re using an API that requires sensitive data, the user will need to grant access to the Scopes you’re using. If you need to set a list of required Scopes for your Shortcut, all you need to do is add 2 more Actions after Access Token.
- Place the Dictionary Action, add the Scope name in ”Key” and the Scope URL in ”Value”.
- Place the Save File Action and set the destination path as “GoogleKit/Scopes/SHORTCUT NAME.json”, and enable ”Overwrite If File Exists”.
Novidades
Added support for Scopes and API's (this was an oversight), see documentation for change. Bug fixes.
O que ele faz
189 ações-
CommentRelease Notes: - Added support for Scopes and API's (this was an oversight), see documentation for changes.
-
Dictionary
-
Set Variableshortcut_details
-
Comment//start_first_run
-
Create Folder
-
Create Folder
-
Create Folder
-
Get File
-
Count
-
If
-
Dictionary
-
Save File
-
Comment//end_first_run
-
Comment//start_update
-
Get File
-
Count
-
If
-
Dictionary
-
Save File
-
If
-
Date
-
Get Time Between Dates
-
If
-
Get My Shortcuts
-
If
-
Dictionary
-
Run ShortcutUpdateKit
-
Get Dictionary Value
-
If
-
Stop This Shortcut
-
If
-
Show AlertMissing Required Shortcut
-
URLhttp://www.mikebeas.com/updatekit/
-
Open URLs
-
Stop This Shortcut
-
Dictionary
-
Save File
-
Comment//end_update
-
Comment//start_refresh
-
Get File
-
Get Dictionary Value
-
Set Variableaccess_token
-
Count
-
If
-
If
-
Get Variable
-
URLhttps://www.googleapis.com/oauth2/v3/tokeninfo?access_token=…
-
Get Contents of URL
-
If
-
URLhttps://www.googleapis.com/oauth2/v4/token?refresh_token=…&client_id=…&client_secret=…&grant_type=refresh_token
-
Get Contents of URL
-
Get Dictionary Value
-
Set Variableaccess_token
-
Get File
-
Set Dictionary Value
-
Save File
-
Get Variable
-
If
-
Get Variable
-
Count
-
If
-
Get Variable
-
Stop This Shortcut
-
If
-
Show AlertoAuth Error
-
Comment//end_refresh
-
Comment//start_header
-
Text
-
Set Variableshortcut_header
-
Comment//end_header
-
Text
-
Choose from Menu…
-
Choose from MenuSettings
-
Choose from MenuWhat would you like to do?
-
Choose from MenuAdd API
-
Comment//start_api
-
Get File
-
Set Variableapi_data
-
Get File
-
Repeat with Each
-
Get Name
-
Choose from List
-
Get File
-
Choose from List
-
Show AlertSetup Instructions
-
URL…
-
Show Web Page
-
Show AlertSetup Instructions
-
URLhttps://console.developers.google.com/apis/credentials/consent
-
Show Web Page
-
Nothing
-
Show NotificationCongratulations, you have successfully added a new API.
-
Comment//end_api
-
Choose from MenuGrant Scope
-
Comment//start_scopes
-
Get File
-
Set Variableapi_data
-
Get File
-
Repeat with Each
-
Get Name
-
Choose from List
-
Get File
-
Choose from List
-
Set Variableselected_scope
-
URLhttps://www.googleapis.com/oauth2/v1/tokeninfo?access_token=…
-
Get Contents of URL
-
Get Dictionary Value
-
If
-
Nothing
-
Show NotificationYou have already granted access to that Scope.
-
If
-
Show AlertAccess Required
-
URLhttps://accounts.google.com/o/oauth2/v2/auth?scope=…&include_granted_scopes=true&state=state_parameter_passthrough_value&redirect_uri=http://localhost/&response_type=code&access_type=offline&prompt=consent&client_id=…
-
Show Web Page
-
Get Clipboard
-
Match Text
-
Set Variableoauth_code
-
Count
-
If
-
Show NotificationError, please use the share sheet and copy the webpage before tapping done.
-
Stop This Shortcut
-
URLhttps://www.googleapis.com/oauth2/v4/token?code=…&client_id=…&client_secret=…&redirect_uri=http://localhost/&grant_type=authorization_code
-
Get Contents of URL
-
Set Variableoauth2_temp
-
Get File
-
Set Dictionary Value
-
Save File
-
Get File
-
Set Dictionary Value
-
Save File
-
Nothing
-
Show NotificationCongratulations, you have successfully added a new Scope.
-
Comment//end_scopes
-
Choose from MenuSetup OAuth
-
Comment//start_setup
-
Get File
-
Get Dictionary Value
-
Count
-
If
-
Show AlertClient ID Required
-
URLhttps://console.developers.google.com/apis/credentials
-
Show Web Page
-
Get Clipboard
-
Set Variableclient_id
-
Get File
-
Set Dictionary Value
-
Save File
-
If
-
Get File
-
Get Dictionary Value
-
Set Variableclient_id
-
Get File
-
Get Dictionary Value
-
Count
-
If
-
Show AlertClient Secret Required
-
URLhttps://console.cloud.google.com/apis/credentials
-
Show Web Page
-
Get Clipboard
-
Set Variableclient_secret
-
Get File
-
Set Dictionary Value
-
Save File
-
If
-
Get Variable
-
Set Variableclient_secret
-
Show AlertAccess Required
-
URLhttps://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/userinfo.profile&include_granted_scopes=true&state=state_parameter_passthrough_value&redirect_uri=http://localhost/&response_type=code&access_type=offline&prompt=cons…
-
Show Web Page
-
Get Clipboard
-
Match Text
-
Set Variableoauth_code
-
Count
-
If
-
Show NotificationError, please use the share sheet and copy the webpage before tapping done.
-
Stop This Shortcut
-
URLhttps://www.googleapis.com/oauth2/v4/token?code=…&client_id=…&client_secret=…&redirect_uri=http://localhost/&grant_type=authorization_code
-
Get Contents of URL
-
Set Variableoauth2_temp
-
Get File
-
Set Dictionary Value
-
Save File
-
Get File
-
Set Dictionary Value
-
Save File
-
Show NotificationCongratulations, you have successfully setup the … Shortcut!
-
Get Variable
-
Stop This Shortcut
-
Comment//end_setup
Avaliações e comentários
Escrever uma avaliaçãoAinda não há avaliações. Seja o primeiro a compartilhar o que você pensa!