Certificate API
Get a console API token
Get one from the console: https://console.bitiful.com/apiToken
List certificates
No parameters.
Example request:
curl -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cert/list"Get certificate content
Best practice
Run the get certificate content API on a schedule in your own infrastructure and combine it with your deployment scripts to automatically apply the latest domain certificates everywhere.
No parameters.
Example request:
curl -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cert/data/<cert_name>/content"Example response:
// curl -H "Authorization: {API-Token}" "https://api.bitiful.com/cert/data/usercontents.somecdn.com-rsa-auto/content"
{
"crt": "-----BEGIN CERTIFICATE-----\n<certificate content>\n-----END CERTIFICATE-----",
"key": "-----BEGIN PRIVATE KEY-----\n<private key content>\n-----END PRIVATE KEY-----",
"auto": true //whether this is an auto certificate
}In workflows that fetch certificates automatically, put proper safeguards in place to prevent your API token from leaking.
Add a certificate
Example request:
curl --request POST 'https://api.bitiful.com/cert/add' \
-H 'Authorization: {API Token from: https://console.bitiful.com/apiToken}' \
-H 'Content-Type: application/json' \
--data-raw '{
"cert_name": "certificate name",
"cert_private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
"cert_content": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
}'