Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Orbita lets the Voice Experience developer integrate Google drive with Orbita’s project. This allows the Voice Experience developer to retrieve or send data.

Integrate Google Drive with Orbita’s project.

Experience Designer

  1. Login to Orbita and open Experience Designer.

  2. Add the below code in the function node or import the sample flow attached.

var orbitaUtil = global.get('orbitaUtil');
var resPromise = orbitaUtil.getGoogleAuthJWTToken({ client_email: "<ABCD@EFGH.iam.gserviceaccount.com>", private_key: "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBg...\n-----END PRIVATE KEY-----\n", scope: ["https://www.googleapis.com/auth/drive"]});

resPromise.then(function(resData){
    msg.headers = {};
    msg.headers = {
        "Authorization": `Bearer ${resData.access_token}`,
        "Accept": "application/json"
    };
    node.warn(resData);
    node.send([msg, null]);
}).catch(function(err){
    node.error(err);
    node.send([null, msg]);
});
  File Modified

Google Dialogflow

  1. Navigate to https://console.cloud.google.com/iam-admin/serviceaccounts and log in.

  2. Select the project you want to connect with Google services.

  3. Choose the service account from the list. Click on the vertical ellipses icon. Select Create key.

  4. Select JSON in the pop-up window. Select Create.

  5. A JSON file with the client email and the private key will get downloaded.

  6. Copy the client_email and private_key from the JSON file and paste them in the function node in the Experience Designer flow.

  7. Navigate to https://console.developers.google.com/apis/library/drive.googleapis.com

  8. Make sure the project is selected and Enable the Google Drive API.

You have successfully integrated Google drive with Orbita.

Related Articles

  • No labels