How to use Oauth in custom actions

In order to use your custom action in a workflow, you need to connect it to the service of which you wish to access the resources. This connection can be established by creating either an ‘Oauth’ or a ‘Connection’, depending upon the API requirements of that particular service. 

Typically, you are required to write a code that accepts a set of inputs from the user and in turn creates Oauth/connection for that particular service (learn how to create custom actions). To simplify this process, Built.io Flow has exposed a set of Oauth for a few services, which can be directly used as keys in your custom action. This lets you create an Oauth for your custom action without the need to write the underlying code. Given below is the list of services and their corresponding Oauth keys:

List of Oauth


List of Oauth:

Asana - asana

Bitly - bitly

Buffer - buffer 

Fitbit - fitbit 

Foursquare - foursquare 

Imgur - imgur 

Nimble - nimble 

Pinterest - pinterest 

Pushbullet - pushbullet 

Quip - quip 

Vimeo - vimeo 

Youtube - youtube 

Google Adexchange - google_adexchange 

Google Admin - google_admin  

Google Adsense - google_adsense 

Google Apps - google_apps 

Google Audit - google_audit

Google Bigquery - google_bigquery 

Google Blogger - google_blogger 

Google Books - google_books 

Google Contact - google_contact

Google Cloud - google_cloud 

Google Cloud Print - google_cloudprint 

Google Compute - google_compute 

Google Datastore - google_datastore 

Google DFA Reporting - google_dfareporting 

Google Doubleclick - google_doubleclick

Google Enterprise Licence Manager - google_enterprise_licence_manager

Google Fusion Tables - google_fusiontables 

Google Groups - google_groups

Google Latitude - google_latitude 

Google Licensing - google_licensing

Google Maps - google_maps 

Google Mirror - google_mirror 

Google Play - google_play 

Google Plus - google_plus 

Google Prediction - google_prediction 

Google Shopping - google_shopping 

Google Site - google_site

Google Sheet - google sheet

Google Drive - google drive

Google Analytics - google_analytics

Google Calendar - google_calendar

Google_sql Admin - google_sqladmin 

Google_Storage - google_storage 

Google_Tasks - google_tasks 

Google URL Shortener - google_urlshortener 

Google - google

Gmail - gmail

Salesforce - salesforce

Salesforce v2 - salesforcev2

Salesforce v3 - salesforcev3

Example


We will now understand how to use the an Oauth in your custom action with the help of an example. Let’s say you have created a custom action that includes fields required to retrieve row data from the specified worksheet of your ‘Excel Online’ account. Now, in order to allow this action to access the resources of your ‘Excel Online’ account, add the following code in the ‘this.input’ block of your existing custom action console window. 

"auth": {

"title": "Authorize Excel",

"type": "string",

"oauth": "excel",

"minLength": 1,

"propertyOrder": 1

                            },

Let us understand this block in detail. 

Title: Label of the authorization field   

Type: Input data type

Oauth: Oauth name of the service (Exposed by Built.io Flow) of which resources you wish to access. 

MinLength: Mark the field as a ‘required’ field. 

PropertyOrder: Sequence in which this field should appear in the form. 

oauth-block

Once you have added Oauth to your code, ‘Compile’ your code and click on ‘Done’. This will take you back to the canvas where you can see this action listed under existing actions of the ‘Custom Action’ block. 

Now when you drag this action to the canvas you will see that the authorization field has been added to the form of your custom action.