Amazon Pinpoint SMS and Voice Service
POST
CreateConfigurationSet
{{baseUrl}}/v1/sms-voice/configuration-sets
BODY json
{
"ConfigurationSetName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ConfigurationSetName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sms-voice/configuration-sets" {:content-type :json
:form-params {:ConfigurationSetName ""}})
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ConfigurationSetName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets"),
Content = new StringContent("{\n \"ConfigurationSetName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ConfigurationSetName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets"
payload := strings.NewReader("{\n \"ConfigurationSetName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sms-voice/configuration-sets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"ConfigurationSetName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sms-voice/configuration-sets")
.setHeader("content-type", "application/json")
.setBody("{\n \"ConfigurationSetName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ConfigurationSetName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ConfigurationSetName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sms-voice/configuration-sets")
.header("content-type", "application/json")
.body("{\n \"ConfigurationSetName\": \"\"\n}")
.asString();
const data = JSON.stringify({
ConfigurationSetName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets',
headers: {'content-type': 'application/json'},
data: {ConfigurationSetName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ConfigurationSetName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ConfigurationSetName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ConfigurationSetName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ConfigurationSetName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets',
headers: {'content-type': 'application/json'},
body: {ConfigurationSetName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ConfigurationSetName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets',
headers: {'content-type': 'application/json'},
data: {ConfigurationSetName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ConfigurationSetName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ConfigurationSetName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ConfigurationSetName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ConfigurationSetName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets', [
'body' => '{
"ConfigurationSetName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ConfigurationSetName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ConfigurationSetName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ConfigurationSetName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ConfigurationSetName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ConfigurationSetName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sms-voice/configuration-sets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets"
payload = { "ConfigurationSetName": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets"
payload <- "{\n \"ConfigurationSetName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ConfigurationSetName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sms-voice/configuration-sets') do |req|
req.body = "{\n \"ConfigurationSetName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets";
let payload = json!({"ConfigurationSetName": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sms-voice/configuration-sets \
--header 'content-type: application/json' \
--data '{
"ConfigurationSetName": ""
}'
echo '{
"ConfigurationSetName": ""
}' | \
http POST {{baseUrl}}/v1/sms-voice/configuration-sets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ConfigurationSetName": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ConfigurationSetName": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateConfigurationSetEventDestination
{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
QUERY PARAMS
ConfigurationSetName
BODY json
{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations" {:content-type :json
:form-params {:EventDestination {:CloudWatchLogsDestination {:IamRoleArn ""
:LogGroupArn ""}
:Enabled ""
:KinesisFirehoseDestination {:DeliveryStreamArn ""
:IamRoleArn ""}
:MatchingEventTypes []
:SnsDestination {:TopicArn ""}}
:EventDestinationName ""}})
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"),
Content = new StringContent("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
payload := strings.NewReader("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 348
{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.setHeader("content-type", "application/json")
.setBody("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.header("content-type", "application/json")
.body("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}")
.asString();
const data = JSON.stringify({
EventDestination: {
CloudWatchLogsDestination: {
IamRoleArn: '',
LogGroupArn: ''
},
Enabled: '',
KinesisFirehoseDestination: {
DeliveryStreamArn: '',
IamRoleArn: ''
},
MatchingEventTypes: [],
SnsDestination: {
TopicArn: ''
}
},
EventDestinationName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
headers: {'content-type': 'application/json'},
data: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
},
EventDestinationName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"EventDestination":{"CloudWatchLogsDestination":{"IamRoleArn":"","LogGroupArn":""},"Enabled":"","KinesisFirehoseDestination":{"DeliveryStreamArn":"","IamRoleArn":""},"MatchingEventTypes":[],"SnsDestination":{"TopicArn":""}},"EventDestinationName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "EventDestination": {\n "CloudWatchLogsDestination": {\n "IamRoleArn": "",\n "LogGroupArn": ""\n },\n "Enabled": "",\n "KinesisFirehoseDestination": {\n "DeliveryStreamArn": "",\n "IamRoleArn": ""\n },\n "MatchingEventTypes": [],\n "SnsDestination": {\n "TopicArn": ""\n }\n },\n "EventDestinationName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
},
EventDestinationName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
headers: {'content-type': 'application/json'},
body: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
},
EventDestinationName: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
EventDestination: {
CloudWatchLogsDestination: {
IamRoleArn: '',
LogGroupArn: ''
},
Enabled: '',
KinesisFirehoseDestination: {
DeliveryStreamArn: '',
IamRoleArn: ''
},
MatchingEventTypes: [],
SnsDestination: {
TopicArn: ''
}
},
EventDestinationName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
headers: {'content-type': 'application/json'},
data: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
},
EventDestinationName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"EventDestination":{"CloudWatchLogsDestination":{"IamRoleArn":"","LogGroupArn":""},"Enabled":"","KinesisFirehoseDestination":{"DeliveryStreamArn":"","IamRoleArn":""},"MatchingEventTypes":[],"SnsDestination":{"TopicArn":""}},"EventDestinationName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EventDestination": @{ @"CloudWatchLogsDestination": @{ @"IamRoleArn": @"", @"LogGroupArn": @"" }, @"Enabled": @"", @"KinesisFirehoseDestination": @{ @"DeliveryStreamArn": @"", @"IamRoleArn": @"" }, @"MatchingEventTypes": @[ ], @"SnsDestination": @{ @"TopicArn": @"" } },
@"EventDestinationName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
],
'EventDestinationName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations', [
'body' => '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
],
'EventDestinationName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
],
'EventDestinationName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
payload = {
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": { "TopicArn": "" }
},
"EventDestinationName": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
payload <- "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations') do |req|
req.body = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n },\n \"EventDestinationName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations";
let payload = json!({
"EventDestination": json!({
"CloudWatchLogsDestination": json!({
"IamRoleArn": "",
"LogGroupArn": ""
}),
"Enabled": "",
"KinesisFirehoseDestination": json!({
"DeliveryStreamArn": "",
"IamRoleArn": ""
}),
"MatchingEventTypes": (),
"SnsDestination": json!({"TopicArn": ""})
}),
"EventDestinationName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations \
--header 'content-type: application/json' \
--data '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}'
echo '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
},
"EventDestinationName": ""
}' | \
http POST {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "EventDestination": {\n "CloudWatchLogsDestination": {\n "IamRoleArn": "",\n "LogGroupArn": ""\n },\n "Enabled": "",\n "KinesisFirehoseDestination": {\n "DeliveryStreamArn": "",\n "IamRoleArn": ""\n },\n "MatchingEventTypes": [],\n "SnsDestination": {\n "TopicArn": ""\n }\n },\n "EventDestinationName": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"EventDestination": [
"CloudWatchLogsDestination": [
"IamRoleArn": "",
"LogGroupArn": ""
],
"Enabled": "",
"KinesisFirehoseDestination": [
"DeliveryStreamArn": "",
"IamRoleArn": ""
],
"MatchingEventTypes": [],
"SnsDestination": ["TopicArn": ""]
],
"EventDestinationName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
DeleteConfigurationSet
{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName
QUERY PARAMS
ConfigurationSetName
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName
http DELETE {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
DeleteConfigurationSetEventDestination
{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
QUERY PARAMS
ConfigurationSetName
EventDestinationName
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
http DELETE {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
GetConfigurationSetEventDestinations
{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
QUERY PARAMS
ConfigurationSetName
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
http GET {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ListConfigurationSets
{{baseUrl}}/v1/sms-voice/configuration-sets
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/sms-voice/configuration-sets")
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/sms-voice/configuration-sets HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/sms-voice/configuration-sets")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/sms-voice/configuration-sets")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/sms-voice/configuration-sets');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/sms-voice/configuration-sets")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/sms-voice/configuration-sets') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/sms-voice/configuration-sets
http GET {{baseUrl}}/v1/sms-voice/configuration-sets
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
SendVoiceMessage
{{baseUrl}}/v1/sms-voice/voice/message
BODY json
{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/voice/message");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sms-voice/voice/message" {:content-type :json
:form-params {:CallerId ""
:ConfigurationSetName ""
:Content {:CallInstructionsMessage {:Text ""}
:PlainTextMessage {:LanguageCode ""
:Text ""
:VoiceId ""}
:SSMLMessage {:LanguageCode ""
:Text ""
:VoiceId ""}}
:DestinationPhoneNumber ""
:OriginationPhoneNumber ""}})
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/voice/message"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/voice/message"),
Content = new StringContent("{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/voice/message");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/voice/message"
payload := strings.NewReader("{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sms-voice/voice/message HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 379
{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sms-voice/voice/message")
.setHeader("content-type", "application/json")
.setBody("{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/voice/message"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/voice/message")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sms-voice/voice/message")
.header("content-type", "application/json")
.body("{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}")
.asString();
const data = JSON.stringify({
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {
Text: ''
},
PlainTextMessage: {
LanguageCode: '',
Text: '',
VoiceId: ''
},
SSMLMessage: {
LanguageCode: '',
Text: '',
VoiceId: ''
}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sms-voice/voice/message');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/voice/message',
headers: {'content-type': 'application/json'},
data: {
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {Text: ''},
PlainTextMessage: {LanguageCode: '', Text: '', VoiceId: ''},
SSMLMessage: {LanguageCode: '', Text: '', VoiceId: ''}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/voice/message';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"CallerId":"","ConfigurationSetName":"","Content":{"CallInstructionsMessage":{"Text":""},"PlainTextMessage":{"LanguageCode":"","Text":"","VoiceId":""},"SSMLMessage":{"LanguageCode":"","Text":"","VoiceId":""}},"DestinationPhoneNumber":"","OriginationPhoneNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/voice/message',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "CallerId": "",\n "ConfigurationSetName": "",\n "Content": {\n "CallInstructionsMessage": {\n "Text": ""\n },\n "PlainTextMessage": {\n "LanguageCode": "",\n "Text": "",\n "VoiceId": ""\n },\n "SSMLMessage": {\n "LanguageCode": "",\n "Text": "",\n "VoiceId": ""\n }\n },\n "DestinationPhoneNumber": "",\n "OriginationPhoneNumber": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/voice/message")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/voice/message',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {Text: ''},
PlainTextMessage: {LanguageCode: '', Text: '', VoiceId: ''},
SSMLMessage: {LanguageCode: '', Text: '', VoiceId: ''}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/voice/message',
headers: {'content-type': 'application/json'},
body: {
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {Text: ''},
PlainTextMessage: {LanguageCode: '', Text: '', VoiceId: ''},
SSMLMessage: {LanguageCode: '', Text: '', VoiceId: ''}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sms-voice/voice/message');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {
Text: ''
},
PlainTextMessage: {
LanguageCode: '',
Text: '',
VoiceId: ''
},
SSMLMessage: {
LanguageCode: '',
Text: '',
VoiceId: ''
}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sms-voice/voice/message',
headers: {'content-type': 'application/json'},
data: {
CallerId: '',
ConfigurationSetName: '',
Content: {
CallInstructionsMessage: {Text: ''},
PlainTextMessage: {LanguageCode: '', Text: '', VoiceId: ''},
SSMLMessage: {LanguageCode: '', Text: '', VoiceId: ''}
},
DestinationPhoneNumber: '',
OriginationPhoneNumber: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/voice/message';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"CallerId":"","ConfigurationSetName":"","Content":{"CallInstructionsMessage":{"Text":""},"PlainTextMessage":{"LanguageCode":"","Text":"","VoiceId":""},"SSMLMessage":{"LanguageCode":"","Text":"","VoiceId":""}},"DestinationPhoneNumber":"","OriginationPhoneNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"CallerId": @"",
@"ConfigurationSetName": @"",
@"Content": @{ @"CallInstructionsMessage": @{ @"Text": @"" }, @"PlainTextMessage": @{ @"LanguageCode": @"", @"Text": @"", @"VoiceId": @"" }, @"SSMLMessage": @{ @"LanguageCode": @"", @"Text": @"", @"VoiceId": @"" } },
@"DestinationPhoneNumber": @"",
@"OriginationPhoneNumber": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/voice/message"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/voice/message" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/voice/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'CallerId' => '',
'ConfigurationSetName' => '',
'Content' => [
'CallInstructionsMessage' => [
'Text' => ''
],
'PlainTextMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
],
'SSMLMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
]
],
'DestinationPhoneNumber' => '',
'OriginationPhoneNumber' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/sms-voice/voice/message', [
'body' => '{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/voice/message');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CallerId' => '',
'ConfigurationSetName' => '',
'Content' => [
'CallInstructionsMessage' => [
'Text' => ''
],
'PlainTextMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
],
'SSMLMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
]
],
'DestinationPhoneNumber' => '',
'OriginationPhoneNumber' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CallerId' => '',
'ConfigurationSetName' => '',
'Content' => [
'CallInstructionsMessage' => [
'Text' => ''
],
'PlainTextMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
],
'SSMLMessage' => [
'LanguageCode' => '',
'Text' => '',
'VoiceId' => ''
]
],
'DestinationPhoneNumber' => '',
'OriginationPhoneNumber' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sms-voice/voice/message');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/voice/message' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/voice/message' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sms-voice/voice/message", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/voice/message"
payload = {
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": { "Text": "" },
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/voice/message"
payload <- "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/voice/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sms-voice/voice/message') do |req|
req.body = "{\n \"CallerId\": \"\",\n \"ConfigurationSetName\": \"\",\n \"Content\": {\n \"CallInstructionsMessage\": {\n \"Text\": \"\"\n },\n \"PlainTextMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n },\n \"SSMLMessage\": {\n \"LanguageCode\": \"\",\n \"Text\": \"\",\n \"VoiceId\": \"\"\n }\n },\n \"DestinationPhoneNumber\": \"\",\n \"OriginationPhoneNumber\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/voice/message";
let payload = json!({
"CallerId": "",
"ConfigurationSetName": "",
"Content": json!({
"CallInstructionsMessage": json!({"Text": ""}),
"PlainTextMessage": json!({
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}),
"SSMLMessage": json!({
"LanguageCode": "",
"Text": "",
"VoiceId": ""
})
}),
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sms-voice/voice/message \
--header 'content-type: application/json' \
--data '{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}'
echo '{
"CallerId": "",
"ConfigurationSetName": "",
"Content": {
"CallInstructionsMessage": {
"Text": ""
},
"PlainTextMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
},
"SSMLMessage": {
"LanguageCode": "",
"Text": "",
"VoiceId": ""
}
},
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
}' | \
http POST {{baseUrl}}/v1/sms-voice/voice/message \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "CallerId": "",\n "ConfigurationSetName": "",\n "Content": {\n "CallInstructionsMessage": {\n "Text": ""\n },\n "PlainTextMessage": {\n "LanguageCode": "",\n "Text": "",\n "VoiceId": ""\n },\n "SSMLMessage": {\n "LanguageCode": "",\n "Text": "",\n "VoiceId": ""\n }\n },\n "DestinationPhoneNumber": "",\n "OriginationPhoneNumber": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sms-voice/voice/message
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"CallerId": "",
"ConfigurationSetName": "",
"Content": [
"CallInstructionsMessage": ["Text": ""],
"PlainTextMessage": [
"LanguageCode": "",
"Text": "",
"VoiceId": ""
],
"SSMLMessage": [
"LanguageCode": "",
"Text": "",
"VoiceId": ""
]
],
"DestinationPhoneNumber": "",
"OriginationPhoneNumber": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/voice/message")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
UpdateConfigurationSetEventDestination
{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
QUERY PARAMS
ConfigurationSetName
EventDestinationName
BODY json
{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName" {:content-type :json
:form-params {:EventDestination {:CloudWatchLogsDestination {:IamRoleArn ""
:LogGroupArn ""}
:Enabled ""
:KinesisFirehoseDestination {:DeliveryStreamArn ""
:IamRoleArn ""}
:MatchingEventTypes []
:SnsDestination {:TopicArn ""}}}})
require "http/client"
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"),
Content = new StringContent("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
payload := strings.NewReader("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 318
{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.setHeader("content-type", "application/json")
.setBody("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.header("content-type", "application/json")
.body("{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
EventDestination: {
CloudWatchLogsDestination: {
IamRoleArn: '',
LogGroupArn: ''
},
Enabled: '',
KinesisFirehoseDestination: {
DeliveryStreamArn: '',
IamRoleArn: ''
},
MatchingEventTypes: [],
SnsDestination: {
TopicArn: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
headers: {'content-type': 'application/json'},
data: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"EventDestination":{"CloudWatchLogsDestination":{"IamRoleArn":"","LogGroupArn":""},"Enabled":"","KinesisFirehoseDestination":{"DeliveryStreamArn":"","IamRoleArn":""},"MatchingEventTypes":[],"SnsDestination":{"TopicArn":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "EventDestination": {\n "CloudWatchLogsDestination": {\n "IamRoleArn": "",\n "LogGroupArn": ""\n },\n "Enabled": "",\n "KinesisFirehoseDestination": {\n "DeliveryStreamArn": "",\n "IamRoleArn": ""\n },\n "MatchingEventTypes": [],\n "SnsDestination": {\n "TopicArn": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
headers: {'content-type': 'application/json'},
body: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
EventDestination: {
CloudWatchLogsDestination: {
IamRoleArn: '',
LogGroupArn: ''
},
Enabled: '',
KinesisFirehoseDestination: {
DeliveryStreamArn: '',
IamRoleArn: ''
},
MatchingEventTypes: [],
SnsDestination: {
TopicArn: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName',
headers: {'content-type': 'application/json'},
data: {
EventDestination: {
CloudWatchLogsDestination: {IamRoleArn: '', LogGroupArn: ''},
Enabled: '',
KinesisFirehoseDestination: {DeliveryStreamArn: '', IamRoleArn: ''},
MatchingEventTypes: [],
SnsDestination: {TopicArn: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"EventDestination":{"CloudWatchLogsDestination":{"IamRoleArn":"","LogGroupArn":""},"Enabled":"","KinesisFirehoseDestination":{"DeliveryStreamArn":"","IamRoleArn":""},"MatchingEventTypes":[],"SnsDestination":{"TopicArn":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EventDestination": @{ @"CloudWatchLogsDestination": @{ @"IamRoleArn": @"", @"LogGroupArn": @"" }, @"Enabled": @"", @"KinesisFirehoseDestination": @{ @"DeliveryStreamArn": @"", @"IamRoleArn": @"" }, @"MatchingEventTypes": @[ ], @"SnsDestination": @{ @"TopicArn": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName', [
'body' => '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EventDestination' => [
'CloudWatchLogsDestination' => [
'IamRoleArn' => '',
'LogGroupArn' => ''
],
'Enabled' => '',
'KinesisFirehoseDestination' => [
'DeliveryStreamArn' => '',
'IamRoleArn' => ''
],
'MatchingEventTypes' => [
],
'SnsDestination' => [
'TopicArn' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
payload = { "EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": { "TopicArn": "" }
} }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName"
payload <- "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName') do |req|
req.body = "{\n \"EventDestination\": {\n \"CloudWatchLogsDestination\": {\n \"IamRoleArn\": \"\",\n \"LogGroupArn\": \"\"\n },\n \"Enabled\": \"\",\n \"KinesisFirehoseDestination\": {\n \"DeliveryStreamArn\": \"\",\n \"IamRoleArn\": \"\"\n },\n \"MatchingEventTypes\": [],\n \"SnsDestination\": {\n \"TopicArn\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName";
let payload = json!({"EventDestination": json!({
"CloudWatchLogsDestination": json!({
"IamRoleArn": "",
"LogGroupArn": ""
}),
"Enabled": "",
"KinesisFirehoseDestination": json!({
"DeliveryStreamArn": "",
"IamRoleArn": ""
}),
"MatchingEventTypes": (),
"SnsDestination": json!({"TopicArn": ""})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName \
--header 'content-type: application/json' \
--data '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}'
echo '{
"EventDestination": {
"CloudWatchLogsDestination": {
"IamRoleArn": "",
"LogGroupArn": ""
},
"Enabled": "",
"KinesisFirehoseDestination": {
"DeliveryStreamArn": "",
"IamRoleArn": ""
},
"MatchingEventTypes": [],
"SnsDestination": {
"TopicArn": ""
}
}
}' | \
http PUT {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "EventDestination": {\n "CloudWatchLogsDestination": {\n "IamRoleArn": "",\n "LogGroupArn": ""\n },\n "Enabled": "",\n "KinesisFirehoseDestination": {\n "DeliveryStreamArn": "",\n "IamRoleArn": ""\n },\n "MatchingEventTypes": [],\n "SnsDestination": {\n "TopicArn": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["EventDestination": [
"CloudWatchLogsDestination": [
"IamRoleArn": "",
"LogGroupArn": ""
],
"Enabled": "",
"KinesisFirehoseDestination": [
"DeliveryStreamArn": "",
"IamRoleArn": ""
],
"MatchingEventTypes": [],
"SnsDestination": ["TopicArn": ""]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sms-voice/configuration-sets/:ConfigurationSetName/event-destinations/:EventDestinationName")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()