Creates an Upload request
Creates a new Upload request to Microsoft teams with the included phone numbers. Only one of civic_address_id or location_id must be provided, not both. The maximum allowed phone numbers for the numbers_ids array is 1000.
POST
/
external_connections
/
{id}
/
uploads
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const upload = await client.externalConnections.uploads.create('1293384261075731499', {
number_ids: [
'3920457616934164700',
'3920457616934164701',
'3920457616934164702',
'3920457616934164703',
],
});
console.log(upload.ticket_id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
upload = client.external_connections.uploads.create(
id="1293384261075731499",
number_ids=["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"],
)
print(upload.ticket_id)
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"),
)
upload, err := client.ExternalConnections.Uploads.New(
context.TODO(),
"1293384261075731499",
telnyx.ExternalConnectionUploadNewParams{
NumberIDs: []string{"3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", upload.TicketID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateParams;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateResponse;
import java.util.List;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
UploadCreateParams params = UploadCreateParams.builder()
.id("1293384261075731499")
.numberIds(List.of(
"3920457616934164700",
"3920457616934164701",
"3920457616934164702",
"3920457616934164703"
))
.build();
UploadCreateResponse upload = client.externalConnections().uploads().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
upload = telnyx.external_connections.uploads.create(
"1293384261075731499",
number_ids: ["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"]
)
puts(upload)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$upload = $client->externalConnections->uploads->create(
'1293384261075731499',
numberIDs: [
'3920457616934164700',
'3920457616934164701',
'3920457616934164702',
'3920457616934164703',
],
additionalUsages: ['calling_user_assignment'],
civicAddressID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
locationID: '67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2',
usage: 'first_party_app_assignment',
);
var_dump($upload);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx external-connections:uploads create \
--api-key 'My API Key' \
--id 1293384261075731499 \
--number-id "'3920457616934164700'" \
--number-id "'3920457616934164701'" \
--number-id "'3920457616934164702'" \
--number-id "'3920457616934164703'"curl --request POST \
--url https://api.telnyx.com/v2/external_connections/{id}/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number_ids": [
"3920457616934164700",
"3920457616934164701",
"3920457616934164702",
"3920457616934164703"
],
"usage": "first_party_app_assignment",
"location_id": "67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2"
}
'{
"success": true,
"ticket_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}Authorizations
Body
application/json
Parameters that can be set when creating an Upload request.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const upload = await client.externalConnections.uploads.create('1293384261075731499', {
number_ids: [
'3920457616934164700',
'3920457616934164701',
'3920457616934164702',
'3920457616934164703',
],
});
console.log(upload.ticket_id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
upload = client.external_connections.uploads.create(
id="1293384261075731499",
number_ids=["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"],
)
print(upload.ticket_id)
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"),
)
upload, err := client.ExternalConnections.Uploads.New(
context.TODO(),
"1293384261075731499",
telnyx.ExternalConnectionUploadNewParams{
NumberIDs: []string{"3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", upload.TicketID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateParams;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateResponse;
import java.util.List;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
UploadCreateParams params = UploadCreateParams.builder()
.id("1293384261075731499")
.numberIds(List.of(
"3920457616934164700",
"3920457616934164701",
"3920457616934164702",
"3920457616934164703"
))
.build();
UploadCreateResponse upload = client.externalConnections().uploads().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
upload = telnyx.external_connections.uploads.create(
"1293384261075731499",
number_ids: ["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"]
)
puts(upload)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$upload = $client->externalConnections->uploads->create(
'1293384261075731499',
numberIDs: [
'3920457616934164700',
'3920457616934164701',
'3920457616934164702',
'3920457616934164703',
],
additionalUsages: ['calling_user_assignment'],
civicAddressID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
locationID: '67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2',
usage: 'first_party_app_assignment',
);
var_dump($upload);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx external-connections:uploads create \
--api-key 'My API Key' \
--id 1293384261075731499 \
--number-id "'3920457616934164700'" \
--number-id "'3920457616934164701'" \
--number-id "'3920457616934164702'" \
--number-id "'3920457616934164703'"curl --request POST \
--url https://api.telnyx.com/v2/external_connections/{id}/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number_ids": [
"3920457616934164700",
"3920457616934164701",
"3920457616934164702",
"3920457616934164703"
],
"usage": "first_party_app_assignment",
"location_id": "67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2"
}
'{
"success": true,
"ticket_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}