Update a location's static emergency address
Update the static emergency address assigned to a specific location of an external connection.
PATCH
/
external_connections
/
{id}
/
locations
/
{location_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.externalConnections.updateLocation(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
static_emergency_address_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
},
);
console.log(response.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
)
response = client.external_connections.update_location(
location_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
static_emergency_address_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.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"),
)
response, err := client.ExternalConnections.UpdateLocation(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.ExternalConnectionUpdateLocationParams{
ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
StaticEmergencyAddressID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.externalconnections.ExternalConnectionUpdateLocationParams;
import com.telnyx.sdk.models.externalconnections.ExternalConnectionUpdateLocationResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ExternalConnectionUpdateLocationParams params = ExternalConnectionUpdateLocationParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.locationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.staticEmergencyAddressId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build();
ExternalConnectionUpdateLocationResponse response = client.externalConnections().updateLocation(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.external_connections.update_location(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
static_emergency_address_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
)
puts(response)<?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 {
$response = $client->externalConnections->updateLocation(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
staticEmergencyAddressID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx external-connections update-location \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--location-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--static-emergency-address-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request PATCH \
--url https://api.telnyx.com/v2/external_connections/{id}/locations/{location_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"static_emergency_address_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'{
"data": {
"location_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"static_emergency_address_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"accepted_address_suggestions": false
}
}{
"data": {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"static_emergency_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_address_suggestions": true
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The server understood the syntax of the request but was unable to process the instructions."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the external connection
The ID of the location to update
Body
application/json
A new static emergency address ID to update the location with
Response
Location successfully updated with no associated orders to process
Show child attributes
Show child attributes
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 response = await client.externalConnections.updateLocation(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
static_emergency_address_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
},
);
console.log(response.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
)
response = client.external_connections.update_location(
location_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
static_emergency_address_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.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"),
)
response, err := client.ExternalConnections.UpdateLocation(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.ExternalConnectionUpdateLocationParams{
ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
StaticEmergencyAddressID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.externalconnections.ExternalConnectionUpdateLocationParams;
import com.telnyx.sdk.models.externalconnections.ExternalConnectionUpdateLocationResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ExternalConnectionUpdateLocationParams params = ExternalConnectionUpdateLocationParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.locationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.staticEmergencyAddressId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build();
ExternalConnectionUpdateLocationResponse response = client.externalConnections().updateLocation(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.external_connections.update_location(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
static_emergency_address_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
)
puts(response)<?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 {
$response = $client->externalConnections->updateLocation(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
staticEmergencyAddressID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx external-connections update-location \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--location-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--static-emergency-address-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request PATCH \
--url https://api.telnyx.com/v2/external_connections/{id}/locations/{location_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"static_emergency_address_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'{
"data": {
"location_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"static_emergency_address_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"accepted_address_suggestions": false
}
}{
"data": {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"static_emergency_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_address_suggestions": true
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The server understood the syntax of the request but was unable to process the instructions."
}
]
}