Visa MarketplaceVisa Marketplace
40Processes
1050Downloads
toggle menu
OAuth authentication
Google
1
1735
81
0
Getting access_token to work with any Google API
Additional information
Version:
 2
Create:
 May 30, 2017
Update:
 May 30, 2017
Click to rate:

OAuth authentication

All requests to Google API support only OAuth2.0 authorization. The general scheme looks as follows:

Every request to API must contain in Header:

Authorization : Bearer {{ACCESS_TOKEN}}

In order to get ACCESS_TOKEN you need to do the following:

1) Click Use this process and template of process "Google OAuth 2.0" will copy to your environment.

2) Open console.developers.google.com, Credentials section

3) Create Client ID and Client Secret

4) Put parameters in URL and run it in browser https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&access_type=offline&scope=&client_id=

where:

* {{CLIENT_ID}} - Client's ID received on Step 2

* {{SCOPE}} - API Google (encode format is required) that you want to get access to. For example, for adWords it is https://www.googleapis.com/auth/adwords

5) In appeared window, choose the account you want to get access to. Press button "Agree" in next window. Copy CODE that appeared on the page, you will need it on step 7.

6) Go to State token diagram, to View mode and press button New task

7) In Task window, in Reference field, add it by "token" value, fill in below and press Add task

*   client_id - You got it on Step 3
*   client_secret - You got it on step 3
*   code - You got it on Step 5

8) In Task window fill the fields below and press Add task

*   **Reference** - give a name to the key that you've got. For example, if it is a key for `gmail`, then specify it in field `Reference` = `gmail`. You will receive `access_token` from other processes with this key.
*   **client_id** - You got it on Step 3
*   **client_secret** - You got it on step 3
*   **code** - You got it on Step 5

378b3cf1a534ac0e5c990fbab3f2a7fdb26917f6

In case of successful creation ACCESS_TOKEN, your request would be located in Active token node. By pressing on this node, you will see all request content, where access_tokenis one of parameters.

You can use received access_token in order to work with any Google API by adding it to Header as:

Authorization : Bearer {{conv[ID_DIAGRAM].ref[REFERENCE].access_token}}

where:

  • ID_DIAGRAM - Diagram ID State token. You can get this ID:
    1. Choose process in browser diagram mode
    2. Choose Start node inside diagram
  • REFERENCE - You set on Step 7, when Add task was made and access_token was generated.
Read more

Similar processes

GMail
GMail
Google
0
FREE
947
42
0
AdWords - ad companies management
AdWords - ad companies management
Google
1
FREE
553
4
0
2020 © Corezoid.com. Middleware Inc., 541 Jefferson Avenue, Suite 100, Redwood City, CA 94063. All rights reserved. Patent protected. Powered by Erlang | Terms & Conditions