Skip to content

SSL Certificate API

Your Certificates

This section describes API methods for creating, deleting and configuring your SSL certificates.

Get certificates list

List of all the certificates receiving:

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/certificate/

  • Method: GET
  • Headers: CDN-AUTH-TOKEN
  • Response Data Type: JSON Object

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Array JSON Certificates info or error
503 None None Service Unavailable

Returned JSON parameters in data:

"comment": "",  - string
"end": 1529999541,  - timestamp
"cn": "*.cdnvideo.ru",  - string
"seq": 1,  - int (uid)
"start": 1430804260, - timestamp 
"alt": "*.cdnvideo.ru, cdnvideo.ru",  - string
"issuer": "Go Daddy Secure Certificate Authority - G2" - string

Possible API Response Codes:

Status Code Status message
454 Record not found in database
455 Not Allowed
550 Internal Server Error

Request example

curl -H 'cdn-auth-token:cdn2_LVJJRIUUTVFI75MVDD5Y48PD211EXU'  https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/

Successful response example

 {"status": 0, "message": "", "data": [{"comment": "", "end": 1529999541, "cn": "*.cdnvideo.ru", "seq": 1, "start": 1430804260, "alt": "*.cdnvideo.ru, cdnvideo.ru", "issuer": "Go Daddy Secure Certificate Authority - G2"}]}

Unsuccessful response example

{"status": 454, "message": "Record not found in database"}

Get certificate by ID

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/certificate/<certificate_seq>

  • Method: GET
  • Headers: CDN-AUTH-TOKEN
  • Response Data Type: JSON Object

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Object JSON Certificate info or error
503 None None Service Unavailable

Returned JSON parameters in data:

"comment": "",  - string
"end": 1529999541,  - timestamp
"cn": "*.cdnvideo.ru",  - string
"seq": 1,  - int (uid)
"start": 1430804260, - timestamp 
"alt": "*.cdnvideo.ru, cdnvideo.ru",  - string
"issuer": "Go Daddy Secure Certificate Authority - G2" - string

Possible API Response Codes:

Status Code Status message
454 Record not found in database
455 Not Allowed
550 Internal Server Error

Request example

curl -H 'cdn-auth-token:cdn2_LVJJRIUUTVFI75MVDD5Y48PD211EXU'  https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1/

Successful response example

 {"status": 0, "message": "", "data": {"comment": "", "end": 1529999541, "cn": "*.cdnvideo.ru", "seq": 1, "start": 1430804260, "alt": "*.cdnvideo.ru, cdnvideo.ru", "issuer": "Go Daddy Secure Certificate Authority - G2"}}

Unsuccessful response example

{"status": 454, "message": "Record not found in database"}

Create certificate

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/certificate/

  • Method: POST
  • Headers: CDN-AUTH-TOKEN
  • Request Data: JSON with certificate data
  • Response Data Type: JSON Object

Request data description:

Parameter name Value Type Required
certificate Text Yes
private_key Text Yes
comment Text No

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Object JSON Created or error
503 None None Service Unavailable

Returned JSON parameters in data:

"seq": 1,  - int (uid)

Possible API Response Codes:

Status Code Status message
450 Invalid request
455 Not Allowed
459 Certificate already exist, use PATCH to update certificate
471 Invalid certificate
472 Invalid private key
473 Private key does not match certificate
474 Certificate is expired
475 Root certificate is not found in system trusted certificates
476 One of certificates is not signed by previous certificate in chain
550 Internal Server Error

Request example

curl -X POST -d '{
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIMvzCCC6egAwIBAgISBDOHrUbe+jaL2W0x4w3T5YuBMA0GCSqGSIb3DQEBCwUA\n-----END CERTIFICATE-----",
    "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDQtDgBy3kRiv2\n-----END PRIVATE KEY-----"}'
-H 'cdn-auth-token:cdn2_LVJJRIUUTVFI75MVDD5Y48PD211EXU'
'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/'

Successful response example

{
  "status": 0,
  "message": "ok",
  "data": {
    "seq": 2
  }
}

Unsuccessful response example

{"status": 459, "message": "Certificate already exist, use PATCH to update certificate"}

Update certificate

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/certificate/<certificate_seq>

  • Method: PATCH
  • Headers: CDN-AUTH-TOKEN
  • Request Data: JSON with new certificate data
  • Response Data Type: JSON Object

Request data description:

Parameter name Value Type Required
certificate Text Yes
private_key Text No
comment Text No

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Object JSON Updated or error
503 None None Service Unavailable

Returned JSON parameters in data:

"seq": 1,  - int (uid)

Possible API Response Codes:

Status Code Status message
450 Invalid request
454 Record not found in database
455 Not Allowed
471 Invalid certificate
472 Invalid private key
473 Private key does not match certificate
474 Certificate is expired
475 Root certificate is not found in system trusted certificates
476 One of certificates is not signed by previous certificate in chain
550 Internal Server Error

Request example

curl -X PATCH -d '{
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIMvzCCC6egAwIBAgISBDOHrUbe+jaL2W0x4w3T5YuBMA0GCSqGSIb3DQEBCwUA\n-----END CERTIFICATE-----",
    "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDQtDgBy3kRiv2\n-----END PRIVATE KEY-----",
    "comment": "new comment"}'
-H 'cdn-auth-token:cdn2_LVJJRIUUTVFI75MVDD5Y48PD211EXU'
'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1'

Successful response example

{
  "status": 0,
  "message": "ok",
  "data": {
    "seq": 2
  }
}

Unsuccessful response example

{"status": 471, "message": "Invalid certificate"}

Delete certificate

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/certificate/<certificate_seq>

  • Method: DELETE
  • Headers: CDN-AUTH-TOKEN
  • Response Data Type: JSON Object

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Object JSON Deleted or error
503 None None Service Unavailable

Returned JSON parameters in data:

"seq": 1,  - int (uid)

Possible API Response Codes:

Status Code Status message
450 Invalid request
454 Record not found in database
455 Not Allowed
550 Internal Server Error

Request example

curl -X DELETE
-H 'cdn-auth-token:cdn2_LVJJRIUUTVFI75MVDD5Y48PD211EXU'
'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1'

Successful response example

{
  "status": 0,
  "message": "ok",
  "data": {
    "seq": 2
  }
}

Unsuccessful response example

{"status": 454, "message": "Record not found in database"}

Let’s Encrypt certificates

We also provide an opportunity of generating Let`s Encrypt certificates. You may find more details on the project here.

Get creation status

Getting the Status of Certificate Creation (Only when the Resource is Mentioned).

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/letsencrypt/<resource_id>/

  • Method: GET
  • Headers: CDN-AUTH-TOKEN
  • Response Data Type: JSON Object

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string, data: type JSON Object JSON Creation status or error
503 None None Service Unavailable

Returned JSON parameters in data:

task_status: string
("no"/"accepted"/"processed"/"failed")

Possible API Response Codes:

Status Code Status message
0 Success
450 Invalid Request
454 Record not found in database (about resource)
455 Not Allowed
550 Internal Server Error

Request example

curl -H 'cdn-auth-token: cdn2_N9ACH044XB11MTTD3HF7E7VQ1N95IK'
https://api.cdnvideo.ru/app/ssl/v1/account/cpfgdakp/letsencrypt/lajjncnn6d

Successful response example

 {
   "status": 0,
   "message": "Success",
   "data": {
     "task_status": "accepted"
   }
 }

Unsuccessful response example

{"status": 450, "message": "Invalid Request"}

Create certificate

Creating a Let's Encrypt certificate for resource, using HTTP-01 challenge.

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/letsencrypt/<resource_id>/

  • Method: POST
  • Headers: CDN-AUTH-TOKEN
  • Response Data Type: JSON Object

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string JSON Created or error
503 None None Service Unavailable

Possible API Response Codes:

Status Code Status message
0 Success
450 Invalid request
454 Record not found in database (about resource)
455 Not Allowed
479 Main domain already in use
489 Task already exist
550 Internal Server Error

Request example

curl -X POST
-H 'cdn-auth-token: cdn2_N9ACH044XB11MTTD3HF7E7VQ1N95IK'
https://api.cdnvideo.ru/app/ssl/v1/account/cpfgdakp/letsencrypt/lajjncnn6d

Successful response example

{"status": 0, "message": "Success"}

Unsuccessful response example

{"status": 450, "message": "Invalid Request"}

Create wildcard certificate

URL: https://api.cdnvideo.ru/app/ssl/v1/account/<your_account_name>/letsencrypt/

  • Method: POST
  • Headers: CDN-AUTH-TOKEN
  • Request Data: JSON with domains
  • Response Data Type: JSON Object

Request data description:

Parameter name Value Type Required
domains List of strings Yes

Possible HTTP Response Codes:

Status Code Response Data Response Format Description
200 status: type int, message: type string JSON Created or error
503 None None Service Unavailable

Possible API Response Codes:

Status Code Status message
0 Success
450 Invalid request
454 Record not found in database (about resource)
455 Not Allowed
479 Main domain already in use
480 DNS settings are incorrect
489 Task already exist
550 Internal Server Error

Request example

curl -X POST -d '{"domains": ["*.d.example.com"]}'
-H 'cdn-auth-token: cdn2_N9ACH044XB11MTTD3HF7E7VQ1N95IK'
https://api.cdnvideo.ru/app/ssl/v1/account/cpfgdakp/letsencrypt/

Successful response example

 {"status": 0, "message": "Success"}

Unsuccessful response example

 {"status": 480, "message": "DNS settings are incorrect"}