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 |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | OK |
454 | Record not found in database |
455 | Not Allowed |
550 | Internal Server Error |
Returned JSON parameters in data elements:
"comment": "july_23", - string "end_timestamp": 1689570782, - timestamp "cn": "*.cdnvideo.ru", - string "seq": 1, - int (uid) "start_timestamp": 1655269983, - timestamp "alt": "*.cdnvideo.ru, cdnvideo.ru", - string "issuer": "Go Daddy Secure Certificate Authority - G2", - string "start_iso8601": "2022-06-15T05:13:03Z", - string "end_iso8601": "2023-07-17T05:13:02Z" - string
Request example
curl -H "CDN-AUTH-TOKEN: $TOKEN" https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/
Successful response example
{"status": 0, "message": "", "data": [{"comment": "july_23", "end_timestamp": 1689570782, "cn": "*.cdnvideo.ru", "seq": 1, "start_timestamp": 1655269983, "alt": "*.cdnvideo.ru, cdnvideo.ru", "issuer": "Go Daddy Secure Certificate Authority - G2", "start_iso8601": "2022-06-15T05:13:03Z", "end_iso8601": "2023-07-17T05:13:02Z"}]}
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 query-parameters:
Name | Purpose | Required |
---|---|---|
details | Getting additional information on certificate chain | No |
Possible HTTP Response Codes:
Status Code | Response Data | Response Format | Description |
---|---|---|---|
200 | status: type int, message: type string, data: type JSON Array | JSON | Certificate info or error |
503 | None | None | Service Unavailable |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | OK |
454 | Record not found in database |
455 | Not Allowed |
550 | Internal Server Error |
Returned JSON parameters in data elements:
"comment": "july_23", - string "end_timestamp": 1689570782, - timestamp "cn": "*.cdnvideo.ru", - string "seq": 1, - int (uid) "start_timestamp": 1655269983, - timestamp "alt": "*.cdnvideo.ru, cdnvideo.ru", - string "issuer": "Go Daddy Secure Certificate Authority - G2", - string "start_iso8601": "2022-06-15T05:13:03Z", - string "end_iso8601": "2023-07-17T05:13:02Z", - string "chain_info": [], - JSON Array of JSON objects *
* only in response to request with query-parameter 'details'
Returned JSON parameters in data.chain_info elements:
"end_timestamp": 1689570782, - timestamp "subject_CN": "*.cdnvideo.ru", - string "start_timestamp": 1655269983, - timestamp "issuer_CN": "GlobalSign GCC R3 DV TLS CA 2020", - string "start_iso8601": "2022-06-15T05:13:03Z", - string "end_iso8601": "2023-07-17T05:13:02Z", - string "fingerprint": "22:C2:D3:6B:6B:EE:AF:D3:1C:61:0A:0A:87:D4:92:F4:83:BE:9B:6A", - string "serial": "42:D5:2A:6F:9A:D9:E9:D0:49:D7:74:77" - string
Request example
curl -H "CDN-AUTH-TOKEN: $TOKEN" https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1/
Successful response example
{"status": 0, "message": "", "data": [{"comment": "july_23", "end_timestamp": 1689570782, "cn": "*.cdnvideo.ru", "seq": 1, "start_timestamp": 1655269983, "alt": "*.cdnvideo.ru, cdnvideo.ru", "issuer": "Go Daddy Secure Certificate Authority - G2", "start_iso8601": "2022-06-15T05:13:03Z", "end_iso8601": "2023-07-17T05:13:02Z"}]}
Unsuccessful response example
{"status": 454, "message": "Record not found in database"}
Request example with additional info about the chain
curl -H "CDN-AUTH-TOKEN: $TOKEN" https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1/?details
Successful response example
{"status": 0, "message": "", "data": [{"comment": "july_23", "end_timestamp": 1689570782, "cn": "*.cdnvideo.ru", "seq": 1, "start_timestamp": 1655269983, "alt": "*.cdnvideo.ru, cdnvideo.ru", "issuer": "GlobalSign GCC R3 DV TLS CA 2020", "start_iso8601": "2022-06-15T05:13:03Z", "end_iso8601": "2023-07-17T05:13:02Z", "chain_info": [{"start_timestamp": 1655269983, "end_iso8601": "2023-07-17T05:13:02Z", "start_iso8601": "2022-06-15T05:13:03Z", "subject_CN": "*.cdnvideo.ru", "fingerprint": "22:C2:D3:6B:6B:EE:AF:D3:1C:61:0A:0A:87:D4:92:F4:83:BE:9B:6A", "issuer_CN": "GlobalSign GCC R3 DV TLS CA 2020", "serial": "42:D5:2A:6F:9A:D9:E9:D0:49:D7:74:77", "end_timestamp": 1689570782}, {"start_timestamp": 1595883600, "end_iso8601": "2029-03-18T00:00:00Z", "start_iso8601": "2020-07-28T00:00:00Z", "subject_CN": "GlobalSign GCC R3 DV TLS CA 2020", "fingerprint": "1C:61:0A:0A:87:D4:92:F4:83:22:C2:AF:D3:BE:9B:6A:D3:6B:6B:EE", "issuer_CN": "GlobalSign", "serial": "77:BD:0E:07:42:D5:D9:E9:D0:49:D7:74:D0:2A:6F:9A", "end_timestamp": 1868475600}, {"start_timestamp": 1237359600, "end_iso8601": "2029-03-18T10:00:00Z", "start_iso8601": "2009-03-18T10:00:00Z", "subject_CN": "GlobalSign", "fingerprint": "D6:9B:56:11:48:F0:1C:77:C5:45:78:C1:09:26:DF:5B:85:69:76:AD", "issuer_CN": "GlobalSign", "serial": "04:00:00:00:00:01:21:58:53:08:A2", "end_timestamp": 1868511600}]}]}
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 | Yes |
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 |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | cert saved |
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 |
477 | Certificate has N invalid line(s) |
478 | Cert chain error: Two or more certificates have the same subject |
479 | Cert chain error: Too many certificates have the same issuer |
550 | Internal Server Error |
Returned JSON parameters in data:
"seq": 1, - int (uid)
Request example
curl -X POST -d '{"comment": "new comment", \ "certificate": "-----BEGIN CERTIFICATE-----\nMIIMvzCCC6egAwIBAgISBDOHrUbe+jaL2W0x4w3T5YuBMA0GCSqGSIb3DQEBCwUA\n-----END CERTIFICATE-----", \ "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDQtDgBy3kRiv2\n-----END PRIVATE KEY-----"}' \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/'
Successful response example
{ "status": 0, "message": "cert saved", "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 | No |
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 |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | cert updated |
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 |
477 | Certificate has N invalid line(s) |
550 | Internal Server Error |
Returned JSON parameters in data:
"seq": 1, - int (uid)
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: $TOKEN" \ 'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1'
Successful response example
{ "status": 0, "message": "cert updated", "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 |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | cert deleted |
450 | Invalid request |
454 | Record not found in database |
455 | Not Allowed |
550 | Internal Server Error |
Returned JSON parameters in data:
"seq": 1, - int (uid)
Request example
curl -X DELETE \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/ssl/v1/account/zpylkbwv/certificate/1'
Successful response example
{ "status": 0, "message": "cert deleted", "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 |
Possible API Response Codes in status:
Status Code | Status message |
---|---|
0 | Success |
450 | Invalid Request |
454 | Record not found in database (about resource) |
455 | Not Allowed |
550 | Internal Server Error |
Returned JSON parameters in data:
task_status: string ("no"/"accepted"/"processed"/"failed")
Request example
curl -H "CDN-AUTH-TOKEN: $TOKEN" \ 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.
Attention!
In the settings of your DNS you need to create a record: cdn.yourdomain.com IN CNAME cdndomain.a.trbcdn.net.
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 in status:
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 \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 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
Attention!
In the settings of your DNS you need to create a record: _acme-challenge.yourdomain.com IN CNAME _acme-challenge.cdnabtv.net.
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 in status:
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: $TOKEN" \ 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"}