We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - Market::get_ssl_certificate_if_available
Skip to end of metadata
Go to start of metadata

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


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.
 
// 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'
  )
);


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.
 
# 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'
  }
);


Note:

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


 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.
  • 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,
	"errors": null,
	"status": 1,
	"metadata": {
		"transformed": 1
	},
	"data": {
		"certificate_pem": "-----BEGIN CERTIFICATE-----MIIDcTCCAlmgAwIBAgIFAU + BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ + jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD + o9fWvoK1tWJS72FSgPju + 58 mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri / daM3PBWO8ET48FWkyU1kOeZaUlF67 / +wrEiNgg + t1qhKOCAB61PdNVkLaSGHimksuC +Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB / F9ORe74yTzD + vlk0tFMG6PLj / ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3 / mgvit0v6dAgMBAAGjUDBOMB0GA1UdDgQWBBRw + wKBo34 + bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw +wKBo34 + bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH / MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7 / 6 DQ / I3hv3WhcDDIO04I2 / Xhe88MLBaLoM367Ya + vy7CaLr14aLi / SfQszMA0ALBvMao + Fis0iVwFYq / NLgSXw + fgnpFskt8v8iQZ + 4 Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh /SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ + Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy / 4 oQNdg6fOq4l / FrajBv + WkzDVPaKm6r7YmwfLN / YMZBHXSR58oOGP9W-- -- - END CERTIFICATE-- -- - ",
		"status_code": "RequiresApproval",
		"status_message": "PRE-SIGN FAILED: CAA: Processing error",
		"encrypted_action_urls": {
		    "evClickThroughStatus": "mgs8RgnN0rkRmJz0SAMvjLokoPoXm5LdzEkmKA7IsGmzvU5XTrFInOegFBbWFycToS7FPOevzkH9\nZp0+QG1xcC/0bWKB1cNeTiYB3Fmv0HGu2ZsA+AYgIhSsZikyD9M6YbHk1IZA3GLNPl8DxX5zG9LQ\nHiv7Ll2QMJcPmMaJ3xktTY9NuiaPiPmYBljEE094LeqabP3w/kRALDnhR4FcwjsTn7iDJKoxtKju\nP/DbgV32vhESwWoaKrIYPkSJ/Dav0a/LQqLqD3Jg27WgrW+GaZSbHlHr09UQW/2CIiIK7jbUoLG3\nANL0fKevyjxrBjCfXQq0umXcZIJPWo4gfukfkQ==\n",
			"ovCallbackStatus": ""
		} 
	}
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
providerstring

Required

The cPanel Market provider's name.

A valid string.

cPStore
order_item_idstring

Required

The order item for which to poll.

A valid string.8675309

Returns

ReturnTypeDescriptionPossible valueExample
certificate_pemstringThe certificate's text.
  • null — The certificate is not available.
  • A certificate file in Base64 PEM format.
 Click to view...
-----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-----
encrypted_action_urlshash

A hash that contains encrypted URLs a user must click to complete their SSL certificate order.

Each hash contains the  evClickThroughStatus  and  ovCallbackStatus  returns.

Note:

This hash may also contain additional key values. For more information, read Sectigo's documentation.


evClickThroughStatus

string

A URL the user must click to electronically sign an agreement for their Extended Validation (EV) certificate.

The function returns this value in the encrypted_action_urls hash.

  • An encrypted URL.
  • null — No action required.
 Click to view...
mgs8RgnN0rkRmJz0SAMvjLokoPoXm5LdzEkmKA7IsGmzvU5XTrFInOegFBbWFycToS7FPOevzkH9\nZp0+QG1xcC/0bWKB1cNeTiYB3Fmv0HGu2ZsA+AYgIhSsZikyD9M6YbHk1IZA3GLNPl8DxX5zG9LQ\nHiv7Ll2QMJcPmMaJ3xktTY9NuiaPiPmYBljEE094LeqabP3w/kRALDnhR4FcwjsTn7iDJKoxtKju\nP/DbgV32vhESwWoaKrIYPkSJ/Dav0a/LQqLqD3Jg27WgrW+GaZSbHlHr09UQW/2CIiIK7jbUoLG3\nANL0fKevyjxrBjCfXQq0umXcZIJPWo4gfukfkQ==\n 

ovCallbackStatus

string

A URL the user must click to verify their identity by phone to complete their Organization Validation (OV) certificate order.

The function returns this value in the encrypted_action_urls hash.

  • An encrypted URL.
  • null — No action required.
 Click to view...
mgs8RgnN0rkRmJz0SAMvjLokoPoXm5LdzEkmKA7IsGmzvU5XTrFInOegFBbWFycToS7FPOevzkH9\nZp0+QG1xcC/0bWKB1cNeTiYB3Fmv0HGu2ZsA+AYgIhSsZikyD9M6YbHk1IZA3GLNPl8DxX5zG9LQ\nHiv7Ll2QMJcPmMaJ3xktTY9NuiaPiPmYBljEE094LeqabP3w/kRALDnhR4FcwjsTn7iDJKoxtKju\nP/DbgV32vhESwWoaKrIYPkSJ/Dav0a/LQqLqD3Jg27WgrW+GaZSbHlHr09UQW/2CIiIK7jbUoLG3\nANL0fKevyjxrBjCfXQq0umXcZIJPWo4gfukfkQ==\n 
status_codestringThe status code of the certificate.

A valid string.

RequiresApproval


status_messagestring

An error message from the certificate provider. For example, why a certificate authority rejected an SSL certificate.

Note:

  • If no error message exists, this will return an empty string.
  • We added this return in cPanel & WHM version 82.

A valid string.

PRE-SIGN FAILED: CAA: Processing error