Import a CA-signed certificate
/rest/{version}/configuration/certificates/import
Request
-
version:
REST API version string.
Available values: v1.2
-
Authorization:
The value in the Authorization header must be the string "
Bearer {access token}
", where{access token}
is a valid, unexpired token received in response to a prior/rest/{version}/auth/token
request.
Response
200 Response
400 Response
401 Response
404 Response
423 Response
Examples
Example of Accessing the API with cURL
The following example shows how to import a certificate by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X PUT \
-d@request.xml \
--header "Content: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates/import"
The following shows an example of the contents of the request.xml
file sent as the request body.
<?xml version="1.0" encoding="UTF-8"?>
<ImportCertificate>
<recordName>rest-server</recordName>
<format>x509</format>
<certificateRequest>-----BEGIN CERTIFICATE-----
MIIFOjCCAyKgAwIBAgIBFDANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UEBhMCVVMx
CzAJBgNVBAgMAk1BMRMwEQYDVQQHDApCdXJsaW5ndG9uMRQwEgYDVQQKDAtFbmdp
AAOCAQ8AMIIBCgKCAQEA6OpPYyfKXWmc1k3XUlzlDB37c8eiMdOMc2LafDRrmdxo
bmVlcmluZzEXMBUGA1UEAwwOQWNtZSBQYWNrZXQgTUExITAfBgkqhkiG9w0BCQEW
MTFaMEkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJNQTEUMBIGA1UEChMLRW5naW5l
EmxhcnJ5LmVAb3JhY2xlLmNvbTAeFw0yMDA5MTQxNDQ1MTFaFw0yNTA5MTQxNDQ1
ZXJpbmcxFzAVBgNVBAMTDkFjbWVSZXN0U2VydmVyMIIBIjANBgkqhkiG9w0BAQEF
oy0mMtx811fPp4Hw0PHKFLBNAzmTVNVIktMpVZcWoccMNGD48n1nXjSmtfNykCTJ
AeRUG0TBtkVu7HVnLx+LlMzFZi5OZrf6PVu71L9/HnxpIvLx0CLKOmmbHwHKGoFH
YqrmvFF3r12N6drpYuHCqq1Y+5JIUiteQ17nyCW5QpNu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DsDbBwKbXYivyIhfrwjKWFiCtXI7le4RfbNTKSKbZdqFHdkMX/qEj
PI+CGBKyPYOXe90XoX9djrIaLJsbikUsZpr3YRqIiYFJA2MHHgrrnbNFJLvScziB
-----END CERTIFICATE-----</certificateRequest>
</ImportCertificate>
Example of Accessing the API with Python
The following example shows how to import a certificate by submitting a PUT request on the REST resource using Python. This example assumes you have a valid token stored in the token
variable. For an example of authenticating with Python, see Authenticate.
import requests
from lxml import etree
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
data = etree.tostring(etree.parse("request.xml"), xml_declaration=True, encoding='utf-8')
url = "https://" + sbcip + "/rest/v1.2/configuration/certificates/import"
resp = requests.put(url, headers=headers, data=data)
Example of the Response Body
The following example shows the contents of the response body in XML format.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<data>
<ImportCertificate>
<recordName>rest-server</recordName>
</ImportCertificate>
</data>
<messages/>
<links/>
</response>