Add SSL Certificate
Uploads an SSL certificate and its matching secret so that you can use Telnyx’s storage as your CDN.
PUT
/
storage
/
buckets
/
{bucketName}
/
ssl_certificate
JavaScript
import fs from 'fs';
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const sslCertificate = await client.storage.buckets.sslCertificate.create('');
console.log(sslCertificate.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
ssl_certificate = client.storage.buckets.ssl_certificate.create(
bucket_name="",
)
print(ssl_certificate.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
sslCertificate, err := client.Storage.Buckets.SslCertificate.New(
context.TODO(),
"",
telnyx.StorageBucketSslCertificateNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", sslCertificate.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.storage.buckets.sslcertificate.SslCertificateCreateParams;
import com.telnyx.sdk.models.storage.buckets.sslcertificate.SslCertificateCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SslCertificateCreateResponse sslCertificate = client.storage().buckets().sslCertificate().create("");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
ssl_certificate = telnyx.storage.buckets.ssl_certificate.create("")
puts(ssl_certificate)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\FileParam;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$sslCertificate = $client->storage->buckets->sslCertificate->create(
'',
certificate: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
privateKey: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
);
var_dump($sslCertificate);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:buckets:ssl-certificate create \
--api-key 'My API Key' \
--bucket-name ''curl --request PUT \
--url https://api.telnyx.com/v2/storage/buckets/{bucketName}/ssl_certificate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form certificate='@example-file' \
--form private_key='@example-file'{
"data": {
"id": "<string>",
"issued_to": {
"common_name": "<string>",
"organization": "<string>",
"organization_unit": "<string>"
},
"issued_by": {
"common_name": "<string>",
"organization": "<string>",
"organization_unit": "<string>"
},
"valid_from": "2020-01-01T00:00:00Z",
"valid_to": "2020-01-01T00:00:00Z",
"created_at": "2020-01-01T00:00:00Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The name of the bucket
Response
SSL Certificate Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import fs from 'fs';
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const sslCertificate = await client.storage.buckets.sslCertificate.create('');
console.log(sslCertificate.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
ssl_certificate = client.storage.buckets.ssl_certificate.create(
bucket_name="",
)
print(ssl_certificate.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
sslCertificate, err := client.Storage.Buckets.SslCertificate.New(
context.TODO(),
"",
telnyx.StorageBucketSslCertificateNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", sslCertificate.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.storage.buckets.sslcertificate.SslCertificateCreateParams;
import com.telnyx.sdk.models.storage.buckets.sslcertificate.SslCertificateCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SslCertificateCreateResponse sslCertificate = client.storage().buckets().sslCertificate().create("");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
ssl_certificate = telnyx.storage.buckets.ssl_certificate.create("")
puts(ssl_certificate)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\FileParam;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$sslCertificate = $client->storage->buckets->sslCertificate->create(
'',
certificate: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
privateKey: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
);
var_dump($sslCertificate);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:buckets:ssl-certificate create \
--api-key 'My API Key' \
--bucket-name ''curl --request PUT \
--url https://api.telnyx.com/v2/storage/buckets/{bucketName}/ssl_certificate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form certificate='@example-file' \
--form private_key='@example-file'{
"data": {
"id": "<string>",
"issued_to": {
"common_name": "<string>",
"organization": "<string>",
"organization_unit": "<string>"
},
"issued_by": {
"common_name": "<string>",
"organization": "<string>",
"organization_unit": "<string>"
},
"valid_from": "2020-01-01T00:00:00Z",
"valid_to": "2020-01-01T00:00:00Z",
"created_at": "2020-01-01T00:00:00Z"
}
}