Generate a certificate signing request for a certificate-record
/rest/{version}/configuration/certificates/generateRequest
Request
-
version:
REST API version string.
Available values: v1.2
-
reGenerate(optional):
Flag to indicate whether to regenerate CSR or not
-
recordName:
Name of the certificate-record.
-
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
403 Response
404 Response
423 Response
Examples
Example of Accessing the API with cURL
The following example shows how to generate a Certificate Signing Request by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X PUT \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates/generateRequest?recordName=rest-server"
Example of Accessing the API with Python
The following example shows how to generate a Certificate Signing Request 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
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
url = "https://" + sbcip + "/rest/v1.2/configuration/certificates/generateRequest?recordName=rest-server"
resp = requests.put(url, headers=headers)
Example of the Response Headers
The following shows an example of the response headers.
HTTP/1.1 200
Server: nginx/1.14.1
Date: Mon, 14 Sep 2020 10:25:14 GMT
Content-Type: application/xml
Transfer-Encoding: chunked
Connection: keep-alive
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>
<CertificateRequest>
<recordName>rest-server</recordName>
<certificateSignedRequest>-----BEGIN CERTIFICATE REQUEST-----
MIIC1jCCAb4CAQAwXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1BMRMwEQYDVQQH
J8pdaZzWTddSXOUMHftzx6Ix04xzYtp8NGuZ3GgB5FQbRMG2RW7sdWcvH4uUzMVm
2XfiMqWb6MnvCnk2nwGbJahV1D0/unm3QygAY8Riqua8UXevXY3p2uli4cKqrVj7
OZNU1UiS0ylVlxahxww0YPjyfWdeNKa183KQJMkd4m7f609AfUnz97teDLFMHzDP
HauJyrq7DG5YmbmTAgMBAAGgMzAxBgkqhkiG9w0BCQ4xJDAiMAsGA1UdDwQEAwIF
ZVJlc3RTZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDo6k9j
EwpCdXJsaW5ndG9uMRQwEgYDVQQKEwtFbmdpbmVlcmluZzEXMBUGA1UEAxMOQWNt
Lk5mt/o9W7vUv38efGki8vHQIso6aZsfAcoagUejLSYy3HzXV8+ngfDQ8coUsE0D
kkhSK15DXufIJblCk25KWbeJiI413BDavNi+48WvDisKdszYZm/g45nKp4I/X3JJ
y/yqfrtrQauVidznodCsVbk+hbAcjg39bp1mWADZqdX4eUoiL+yBk7HHNrqrRpb8
IrT+OnjSiBhyqqmMkvRSpV5tomRK+VTwa9Xz50d9FTIZBPEe+gHTWiXHg1Dq9Rqb
MBjJVsVTyP0Whf6xZsRIaq5C/Ko0y3olTulyyigsXbYV7twBUwDw578DiGZ0uLXg
tkRO/9eGrpT7RFMc79gr6qnIZuorYI0FSi7ZDxXtl4fCuV5A1E4Au+gCM1s6Q50i
oDATBgNVHSUEDDAKBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEA5wGtzGCR
e2vZqH1MWal54Yr4VwTLybija8AYkEiRPlm78go4YaNWrcKjTS7vSmZQgKziArom
8JWD3ValiNBIog==
-----END CERTIFICATE REQUEST-----
</certificateSignedRequest>
</CertificateRequest>
</data>
<messages/>
<links/>
</response>