UAPI Functions - Market::get_ssl_certificate_if_available

Description

This function retrieves SSL certificates when they are available from the cPanel Market provider.

Examples


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Market/get_ssl_certificate_if_available?provider=cPStore&order_item_id=8675309

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Retrieve SSL certificates when they are available from the cPanel Market provider
$get_cert $cpanel->uapi(
    'Market''get_ssl_certificate_if_available',
    array(
        'provider'        => 'cPStore',
        'order_item_id'   => '8675309'
  )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Retrieve SSL certificates when they are available from the cPanel Market provider
my $get_cert $cpliveapi->uapi(
    'Market''get_ssl_certificate_if_available',
    {
        'provider'         => 'cPStore',
        'order_item_id'    => '8675309'
  }
);

 cPanel Template Toolkit

<!-- Retrieve SSL certificates when they are available from the cPanel Market provider -->
[% execute('Market', 'get_ssl_certificate_if_available', { provider => 'cPStore','order_item_id'=>'8675309'} ) %]

 Command Line

uapi --user=username Market get_ssl_certificate_if_available provider=cPStore order_item_id=8675309

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
      "transformed":1
   },
   "data":{ 
      "status_code":"RequiresApproval",
      "certificate_pem":"-----BEGIN CERTIFICATE-----
MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ
c2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI
DAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy
MjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV
BAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P
Xx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW
voK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da
M3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC
+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6
PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj
UDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw
+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh
cDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw
FYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh
/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag
qz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa
Km6r7YmwfLN/YMZBHXSR58oOGP9W
-----END CERTIFICATE-----"
   }
}

 

Note:

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

 

Parameters

Parameter

Type

Description

 Possible values 

 Example 

provider

string

Required

 The cPanel Market provider's name. 

A valid string.

cPStore

 order_item_id 

 string 

Required

The order item for which to poll.

A valid string.

8675309

 

 

Returns

Return

Type

Description

Possible value

Example

status_code

 string 

 The status code of the certificate. 

A valid string.

 RequiresApproval 

 certificate_pem 

string

The certificate's text.

  • null — The certificate is not available.
  • A certificate file in Base64 PEM format. 

 

 

  • 8 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....