Child pages
  • WHM API 1 Functions - get_login_url
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

Version 1 Next »

 

Description

This function retrieves the login URL for the cPanel Store or a cPanel Market provider.

Examples  


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_login_url?api.version=1&url_after_login=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate&provider=cPStore
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_login_url?api.version=1&url_after_login=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate&provider=cPStore
 Command Line
whmapi1 get_login_url url_after_login=http:\/\/hostname.example.com\/redirectionlocation.cgi?state provider=cPStore


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": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "data": {
       "payload": "https://account.cpanel.net/oauth2/auth/login?client_id=d5eff4a09e29d5b20752674c0ab2c799c428eb23df4db2df10a5c9d96c37472c76013a41e9a0c714e852965ceaed2e8e05e2f738bc27ee562cfb683fbfc75a01&email=&redirect_uri=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate&response_type=token"
    },
    "command": "get_login_url"
  }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <data>
            <payload>https://account.cpanel.net/oauth2/auth/login?client_id=d5eff4a09e29d5b20752674c0ab2c799c428eb23df4db2df10a5c9d96c37472c76013a41e9a0c714e852965ceaed2e8e05e2f738bc27ee562cfb683fbfc75a01&email=&redirect_uri=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate&response_type=token</payload>
        </data>
        <command>get_login_url</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
providerstring

Required

The cPanel Store or cPanel Market provider's name.

  • cPStore
  • Any valid provider name.
cPStore
url_after_login
string

Required

The location to which the cPanel Store or cPanel Market provider redirects the user's browser after they log in.

Any valid URL that includes a query component.
http://hostname.example.com/redirectionlocation.cgi?state

 

Return

ReturnTypeDescriptionPossible valuesExample
payloadstring

The URL to which to redirect the browser after login.

A valid URL.
 Click to view...
https://account.cpanel.net/oauth2/auth/login?client_id=d5eff4a09e29d5b20752674c0ab2c799c428eb23df4db2df10a5c9d96c37472c76013a41e9a0c714e852965ceaed2e8e05e2f738bc27ee562cfb683fbfc75a01&email=&redirect_uri=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate&response_type=token
  • No labels