Create an SSL Certificate

POST

This API creates a new SSL certificate in PAM360. By providing the required certificate details, the API generates and stores the certificate in the PAM360 repository.

Request URL

https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/api/pki/restapi/createCertificate

Header Parameters

{
	"AUTHTOKEN" : "<<Authtoken-generated-from-PAM360>>",
	"orgName"   : "<<org display name>>"
}	

ParameterDescriptionValues

AUTHTOKEN

Authentication token for the user to authorize the API request.
Type : String
Mandatory : Yes

Default Value : N/A

orgName

Organization name available in PAM360.
Type : String
Mandatory : No

Default Value : The organization to which the user belongs.

Body Parameters

INPUT_DATA={
	"operation":{
		"Details":{
		"CNAME": "mytestcert",
		"ALT_NAMES": "test",
		"ORGUNIT": "zohocorp",
		"ORG": "manageengine",
		"LOCATION": "chennai",
		"STATE": "Tamilnadu",
		"COUNTRY": "IN",
		"PASSWORD": "zohocorp",
		"VALIDITY": "888",
		"VALIDITY_TYPE": "days",
		"ALG": "RSA",
		"LEN": "4096",
		"SIGALG": "SHA256",
		"StoreType": "PKCS12"
		}
	}
}	

ParametersDescriptionValues

CNAME

Common Name for the certificate.
Type : String
Mandatory : Yes

Default Value : N/A

ALT_NAMES

Subject Alternative Names for the certificate.
Type : String
Mandatory : No

Default Value : N/A

ORGUNIT

Organizational Unit for the certificate.
Type : String
Mandatory : No

Default Value : N/A

ORG

Organization for the certificate.
Type : String
Mandatory : No

Default Value : N/A

LOCATION

Location of the organization.
Type : String
Mandatory : No

Default Value : N/A

STATE

State of the organization.
Type : String
Mandatory : No

Default Value : N/A

COUNTRY

Country of the organization.
Type : String
Mandatory : No

Default Value : N/A

PASSWORD

Password for the certificate keystore.
Type : String
Mandatory : Yes

Default Value : N/A

VALIDITY

Validity period for the certificate.
Type : Integer
Mandatory : Yes

Default Value : N/A

VALIDITY_TYPE

Type of validity period.
Type : String
Mandatory : No

Default Value : N/A

ALG

Algorithm used for the key.
Type : String
Mandatory : No

Default Value : N/A

LEN

Length of the key in bits.
Type : Integer
Mandatory : No

Default Value : N/A

SIGALG

Signature algorithm for the certificate.
Type : String
Mandatory : No

Default Value : N/A

StoreType

Keystore type to store the certificate.
Type : String
Mandatory : No

Default Value : N/A

Sample Request

cURLPythonPowerShell
curl -X POST https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/api/pki/restapi/createCertificate -H "AUTHTOKEN:<<Authtoken-generated-from-PAM360>>" -H 'Content-Type: application/json' -d INPUT_DATA={"operation":{"Details":{"CNAME":"mytestcert","ALT_NAMES":"test","ORGUNIT":"zohocorp","ORG":"manageengine","LOCATION":"chennai","STATE":"Tamilnadu","COUNTRY":"IN","PASSWORD":"zohocorp","VALIDITY":"888","VALIDITY_TYPE":"days","ALG":"RSA","LEN":"4096","SIGALG":"SHA256","StoreType":"PKCS12"}}}	
import requests

url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/api/pki/restapi/createCertificate"

data = {
	"INPUT_DATA": '{"operation":{"Details":{"CNAME":"mytestcert","ALT_NAMES":"test","ORGUNIT":"zohocorp","ORG":"manageengine","LOCATION":"chennai","STATE":"Tamilnadu","COUNTRY":"IN","PASSWORD":"zohocorp","VALIDITY":"888","VALIDITY_TYPE":"days","ALG":"RSA","LEN":"4096","SIGALG":"SHA256","StoreType":"PKCS12"}}}'
}

headers = {
	"AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>"
}

response = requests.post(url, headers=headers, data=data, verify=True)

print("Response:", response.text)
# Define URL
$url = "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/api/pki/restapi/createCertificate"

# Headers with AUTHTOKEN
$headers = @{
	"AUTHTOKEN" = "<<Authtoken-generated-from-PAM360>>"; "Content-Type" = "application/x-www-form-urlencoded"
}

# Input JSON
$inputData = @{
	operation = @{
	Details = @{
	CNAME = "mytestcert"; ALT_NAMES = "testk,www.test.com"; ORGUNIT = "IT Department"; ORG = "Test Organization"; LOCATION = "Chennai"; STATE = "Tamil Nadu"; COUNTRY = "IN"; PASSWORD = "SecurePassword123"; VALIDITY = "365"; VALIDITY_TYPE = "days"; ALG = "RSA"; LEN = "2048";SIGALG = "SHA256"; StoreType = "PKCS12"
	}
	}
} | ConvertTo-Json -Compress

# Encode as query parameter
$params = @{ INPUT_DATA = $inputData }

# Create SSL Certificate
$response = Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body $params
$response | ConvertTo-Json -Depth 5   

Sample Response

{
	"result": {
		"message": "Certificate saved successfully",
		"status": "Success"
	},
	"name": "CreateCertificate",
	"details": [
		{
			"SSL_RESOURCEID": 304
		}
	],
	"totalRows": 1
}



Top