Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - Integration::fetch_url - Software Development Kit - cPanel Documentation
Page tree
Skip to end of metadata
Go to start of metadata

 

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. 
  • We introduced this functionality in cPanel & WHM version 56.

 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/