Child pages
  • WHM API 1 Functions - backup_generate_google_oauth_uri
Skip to end of metadata
Go to start of metadata

Description

This function generates a Google Drive™ OAuth redirect URI.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/backup_generate_google_oauth_uri?api.version=1&client_id=aBcdeFgHIjK123&client_secret=luggage123456
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/backup_generate_google_oauth_uri?api.version=1&client_id=aBcdeFgHIjK123&client_secret=luggage123456
 Command Line
whmapi1 backup_generate_google_oauth_uri client_id=aBcdeFgHIjK123 client_secret=aBcde123FgHIjK456


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{ 
   "metadata":{ 
      "result":1,
      "command":"backup_generate_google_oauth_uri",
      "reason":"OK",
      "version":1
   },
   "data":{ 
      "uri":"https://accounts.google.com/o/oauth2/auth?client_id=aBcdeFgHIjK123&response_type=code&redirect_uri=https%3A%2F%2Fhost-10-0-0-2.example.tld%3A2087%2Fgoogledriveauth%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&access_type=offline&prompt=consent&state=IkdLqOej5CLPW1nHRF6OJYaahE7HPXrRUvpFs6MhmBMbCjvWDQcstyYhbUFge5IJ"
   }
}
 Output (XML)
<result>
   <data>
      <uri>https://accounts.google.com/o/oauth2/auth?client_id=aBcdeFgHIjK123&response_type=code&redirect_uri=https%3A%2F%2Fhost-10-0-0-2.example.tld%3A2087%2Fgoogledriveauth%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&access_type=offline&prompt=consent&state=IkdLqOej5CLPW1nHRF6OJYaahE7HPXrRUvpFs6MhmBMbCjvWDQcstyYhbUFge5IJ</uri>
   </data>
   <metadata>
      <version>1</version>
      <reason>OK</reason>
      <result>1</result>
      <command>backup_generate_google_oauth_uri</command>
   </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
client_idstring

Required

The Google Drive client ID.

A valid client ID.aBcdeFgHIjK123
client_secretstring

Required

The Google Drive client secret.

A valid client secret.aBcde123FgHIjK456

Returns

ReturnTypeDescriptionPossible valuesExample
uri string The generated Google Drive OAuth redirect URI.A valid URI.
 Click to view...
https://accounts.google.com/o/oauth2/auth?client_id=aBcdeFgHIjK123&response_type=code&redirect_uri=https%3A%2F%2Fhost-10-0-0-2.example.tld%3A2087%2Fgoogledriveauth%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&access_type=offline&prompt=consent&state=IkdLqOej5CLPW1nHRF6OJYaahE7HPXrRUvpFs6MhmBMbCjvWDQcstyYhbUFge5IJ