Child pages
  • UAPI Functions - Integration::fetch_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 returns the URL for an integrated application.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Integration/fetch_url?app=applicationname


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// What is the URL of the application applicationname?
$application_url = $cpanel->uapi(
    'Integration', 'fetch_url',    array(
        'app'    => 'applicationname',
    )
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# What is the URL of the application applicationname?
my $application_url = $cpliveapi->uapi(
    'Integration', 'fetch_url',    {
        'app'    => 'applicationname',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- What is the URL of the application applicationname? -->
[% data = execute( 'Integration', 'fetch_url', { app => 'applicationname'}  ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Integration fetch_url app=applicationname


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "messages":null,
   "data":{  
      "redirect_url":"http://applicationname.example.com/application"
   },
   "status":1,
   "errors":null,
   "metadata":{  

   }
}

 

 


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
appstring

Required

The application's name.

A valid string.
applicationname

Returns

The function outputs one or both of the following returns:

ReturnTypeDescriptionPossible valuesExample
redirect_urlstringThe URL to which the application will redirect visitors.

A valid publicly-available URL.

http://application.example.com/application
              
urlstringThe URL to which the application redirects visitors if the redirect_url location is unavailable.A valid publicly-available URL.
http://application.example.com/

 

 

  • No labels