Twilio - Notify
POST
CreateBinding
{{baseUrl}}/v1/Services/:ServiceSid/Bindings
QUERY PARAMS
ServiceSid
BODY formUrlEncoded
Address
BindingType
CredentialSid
Endpoint
Identity
NotificationProtocolVersion
Tag
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:ServiceSid/Bindings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Services/:ServiceSid/Bindings" {:form-params {:Address ""
:BindingType ""
:CredentialSid ""
:Endpoint ""
:Identity ""
:NotificationProtocolVersion ""
:Tag ""}})
require "http/client"
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag="
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/Services/:ServiceSid/Bindings"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "Address", "" },
{ "BindingType", "" },
{ "CredentialSid", "" },
{ "Endpoint", "" },
{ "Identity", "" },
{ "NotificationProtocolVersion", "" },
{ "Tag", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:ServiceSid/Bindings");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
payload := strings.NewReader("Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Services/:ServiceSid/Bindings HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 90
Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:ServiceSid/Bindings"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.header("content-type", "application/x-www-form-urlencoded")
.body("Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=")
.asString();
const data = 'Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=';
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/Services/:ServiceSid/Bindings');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('Address', '');
encodedParams.set('BindingType', '');
encodedParams.set('CredentialSid', '');
encodedParams.set('Endpoint', '');
encodedParams.set('Identity', '');
encodedParams.set('NotificationProtocolVersion', '');
encodedParams.set('Tag', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
Address: '',
BindingType: '',
CredentialSid: '',
Endpoint: '',
Identity: '',
NotificationProtocolVersion: '',
Tag: ''
})
};
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/Services/:ServiceSid/Bindings',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
Address: '',
BindingType: '',
CredentialSid: '',
Endpoint: '',
Identity: '',
NotificationProtocolVersion: '',
Tag: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:ServiceSid/Bindings',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
Address: '',
BindingType: '',
CredentialSid: '',
Endpoint: '',
Identity: '',
NotificationProtocolVersion: '',
Tag: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
Address: '',
BindingType: '',
CredentialSid: '',
Endpoint: '',
Identity: '',
NotificationProtocolVersion: '',
Tag: ''
}
};
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/Services/:ServiceSid/Bindings');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
Address: '',
BindingType: '',
CredentialSid: '',
Endpoint: '',
Identity: '',
NotificationProtocolVersion: '',
Tag: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('Address', '');
encodedParams.set('BindingType', '');
encodedParams.set('CredentialSid', '');
encodedParams.set('Endpoint', '');
encodedParams.set('Identity', '');
encodedParams.set('NotificationProtocolVersion', '');
encodedParams.set('Tag', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('Address', '');
encodedParams.set('BindingType', '');
encodedParams.set('CredentialSid', '');
encodedParams.set('Endpoint', '');
encodedParams.set('Identity', '');
encodedParams.set('NotificationProtocolVersion', '');
encodedParams.set('Tag', '');
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"Address=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&BindingType=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&CredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Endpoint=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Identity=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&NotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Tag=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Services/:ServiceSid/Bindings"]
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/Services/:ServiceSid/Bindings" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:ServiceSid/Bindings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Services/:ServiceSid/Bindings', [
'form_params' => [
'Address' => '',
'BindingType' => '',
'CredentialSid' => '',
'Endpoint' => '',
'Identity' => '',
'NotificationProtocolVersion' => '',
'Tag' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'Address' => '',
'BindingType' => '',
'CredentialSid' => '',
'Endpoint' => '',
'Identity' => '',
'NotificationProtocolVersion' => '',
'Tag' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'Address' => '',
'BindingType' => '',
'CredentialSid' => '',
'Endpoint' => '',
'Identity' => '',
'NotificationProtocolVersion' => '',
'Tag' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Services/:ServiceSid/Bindings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
payload = {
"Address": "",
"BindingType": "",
"CredentialSid": "",
"Endpoint": "",
"Identity": "",
"NotificationProtocolVersion": "",
"Tag": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
payload <- "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:Address => "",
:BindingType => "",
:CredentialSid => "",
:Endpoint => "",
:Identity => "",
:NotificationProtocolVersion => "",
:Tag => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Services/:ServiceSid/Bindings') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings";
let payload = json!({
"Address": "",
"BindingType": "",
"CredentialSid": "",
"Endpoint": "",
"Identity": "",
"NotificationProtocolVersion": "",
"Tag": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Services/:ServiceSid/Bindings \
--header 'content-type: application/x-www-form-urlencoded' \
--data Address= \
--data BindingType= \
--data CredentialSid= \
--data Endpoint= \
--data Identity= \
--data NotificationProtocolVersion= \
--data Tag=
http --form POST {{baseUrl}}/v1/Services/:ServiceSid/Bindings \
content-type:application/x-www-form-urlencoded \
Address='' \
BindingType='' \
CredentialSid='' \
Endpoint='' \
Identity='' \
NotificationProtocolVersion='' \
Tag=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'Address=&BindingType=&CredentialSid=&Endpoint=&Identity=&NotificationProtocolVersion=&Tag=' \
--output-document \
- {{baseUrl}}/v1/Services/:ServiceSid/Bindings
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "Address=".data(using: String.Encoding.utf8)!)
postData.append("&BindingType=".data(using: String.Encoding.utf8)!)
postData.append("&CredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&Endpoint=".data(using: String.Encoding.utf8)!)
postData.append("&Identity=".data(using: String.Encoding.utf8)!)
postData.append("&NotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&Tag=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:ServiceSid/Bindings")! 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
CreateCredential
{{baseUrl}}/v1/Credentials
BODY formUrlEncoded
ApiKey
Certificate
FriendlyName
PrivateKey
Sandbox
Secret
Type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Credentials");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Credentials" {:form-params {:ApiKey ""
:Certificate ""
:FriendlyName ""
:PrivateKey ""
:Sandbox ""
:Secret ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/v1/Credentials"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type="
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/Credentials"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "ApiKey", "" },
{ "Certificate", "" },
{ "FriendlyName", "" },
{ "PrivateKey", "" },
{ "Sandbox", "" },
{ "Secret", "" },
{ "Type", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Credentials");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Credentials"
payload := strings.NewReader("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Credentials HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 69
ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Credentials")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Credentials"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Credentials")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Credentials")
.header("content-type", "application/x-www-form-urlencoded")
.body("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=")
.asString();
const data = 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=';
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/Credentials');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
encodedParams.set('Type', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Credentials';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: '',
Type: ''
})
};
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/Credentials',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: '',
Type: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Credentials")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Credentials',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: '',
Type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: '',
Type: ''
}
};
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/Credentials');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: '',
Type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
encodedParams.set('Type', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
encodedParams.set('Type', '');
const url = '{{baseUrl}}/v1/Credentials';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"ApiKey=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Certificate=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FriendlyName=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&PrivateKey=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Sandbox=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Secret=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Type=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Credentials"]
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/Credentials" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Credentials', [
'form_params' => [
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => '',
'Type' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Credentials');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => '',
'Type' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Credentials');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Credentials' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Credentials' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Credentials", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Credentials"
payload = {
"ApiKey": "",
"Certificate": "",
"FriendlyName": "",
"PrivateKey": "",
"Sandbox": "",
"Secret": "",
"Type": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Credentials"
payload <- "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:ApiKey => "",
:Certificate => "",
:FriendlyName => "",
:PrivateKey => "",
:Sandbox => "",
:Secret => "",
:Type => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Credentials') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Credentials";
let payload = json!({
"ApiKey": "",
"Certificate": "",
"FriendlyName": "",
"PrivateKey": "",
"Sandbox": "",
"Secret": "",
"Type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Credentials \
--header 'content-type: application/x-www-form-urlencoded' \
--data ApiKey= \
--data Certificate= \
--data FriendlyName= \
--data PrivateKey= \
--data Sandbox= \
--data Secret= \
--data Type=
http --form POST {{baseUrl}}/v1/Credentials \
content-type:application/x-www-form-urlencoded \
ApiKey='' \
Certificate='' \
FriendlyName='' \
PrivateKey='' \
Sandbox='' \
Secret='' \
Type=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=&Type=' \
--output-document \
- {{baseUrl}}/v1/Credentials
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "ApiKey=".data(using: String.Encoding.utf8)!)
postData.append("&Certificate=".data(using: String.Encoding.utf8)!)
postData.append("&FriendlyName=".data(using: String.Encoding.utf8)!)
postData.append("&PrivateKey=".data(using: String.Encoding.utf8)!)
postData.append("&Sandbox=".data(using: String.Encoding.utf8)!)
postData.append("&Secret=".data(using: String.Encoding.utf8)!)
postData.append("&Type=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Credentials")! 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
CreateNotification
{{baseUrl}}/v1/Services/:ServiceSid/Notifications
QUERY PARAMS
ServiceSid
BODY formUrlEncoded
Action
Alexa
Apn
Body
Data
DeliveryCallbackUrl
FacebookMessenger
Fcm
Gcm
Identity
Priority
Segment
Sms
Sound
Tag
Title
ToBinding
Ttl
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:ServiceSid/Notifications");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Services/:ServiceSid/Notifications" {:form-params {:Action ""
:Alexa ""
:Apn ""
:Body ""
:Data ""
:DeliveryCallbackUrl ""
:FacebookMessenger ""
:Fcm ""
:Gcm ""
:Identity ""
:Priority ""
:Segment ""
:Sms ""
:Sound ""
:Tag ""
:Title ""
:ToBinding ""
:Ttl ""}})
require "http/client"
url = "{{baseUrl}}/v1/Services/:ServiceSid/Notifications"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl="
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/Services/:ServiceSid/Notifications"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "Action", "" },
{ "Alexa", "" },
{ "Apn", "" },
{ "Body", "" },
{ "Data", "" },
{ "DeliveryCallbackUrl", "" },
{ "FacebookMessenger", "" },
{ "Fcm", "" },
{ "Gcm", "" },
{ "Identity", "" },
{ "Priority", "" },
{ "Segment", "" },
{ "Sms", "" },
{ "Sound", "" },
{ "Tag", "" },
{ "Title", "" },
{ "ToBinding", "" },
{ "Ttl", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:ServiceSid/Notifications");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:ServiceSid/Notifications"
payload := strings.NewReader("Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Services/:ServiceSid/Notifications HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 150
Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Services/:ServiceSid/Notifications")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:ServiceSid/Notifications"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Notifications")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Services/:ServiceSid/Notifications")
.header("content-type", "application/x-www-form-urlencoded")
.body("Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=")
.asString();
const data = 'Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=';
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/Services/:ServiceSid/Notifications');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('Action', '');
encodedParams.set('Alexa', '');
encodedParams.set('Apn', '');
encodedParams.set('Body', '');
encodedParams.set('Data', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessenger', '');
encodedParams.set('Fcm', '');
encodedParams.set('Gcm', '');
encodedParams.set('Identity', '');
encodedParams.set('Priority', '');
encodedParams.set('Segment', '');
encodedParams.set('Sms', '');
encodedParams.set('Sound', '');
encodedParams.set('Tag', '');
encodedParams.set('Title', '');
encodedParams.set('ToBinding', '');
encodedParams.set('Ttl', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Notifications',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Notifications';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
Action: '',
Alexa: '',
Apn: '',
Body: '',
Data: '',
DeliveryCallbackUrl: '',
FacebookMessenger: '',
Fcm: '',
Gcm: '',
Identity: '',
Priority: '',
Segment: '',
Sms: '',
Sound: '',
Tag: '',
Title: '',
ToBinding: '',
Ttl: ''
})
};
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/Services/:ServiceSid/Notifications',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
Action: '',
Alexa: '',
Apn: '',
Body: '',
Data: '',
DeliveryCallbackUrl: '',
FacebookMessenger: '',
Fcm: '',
Gcm: '',
Identity: '',
Priority: '',
Segment: '',
Sms: '',
Sound: '',
Tag: '',
Title: '',
ToBinding: '',
Ttl: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Notifications")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:ServiceSid/Notifications',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
Action: '',
Alexa: '',
Apn: '',
Body: '',
Data: '',
DeliveryCallbackUrl: '',
FacebookMessenger: '',
Fcm: '',
Gcm: '',
Identity: '',
Priority: '',
Segment: '',
Sms: '',
Sound: '',
Tag: '',
Title: '',
ToBinding: '',
Ttl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Notifications',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
Action: '',
Alexa: '',
Apn: '',
Body: '',
Data: '',
DeliveryCallbackUrl: '',
FacebookMessenger: '',
Fcm: '',
Gcm: '',
Identity: '',
Priority: '',
Segment: '',
Sms: '',
Sound: '',
Tag: '',
Title: '',
ToBinding: '',
Ttl: ''
}
};
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/Services/:ServiceSid/Notifications');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
Action: '',
Alexa: '',
Apn: '',
Body: '',
Data: '',
DeliveryCallbackUrl: '',
FacebookMessenger: '',
Fcm: '',
Gcm: '',
Identity: '',
Priority: '',
Segment: '',
Sms: '',
Sound: '',
Tag: '',
Title: '',
ToBinding: '',
Ttl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('Action', '');
encodedParams.set('Alexa', '');
encodedParams.set('Apn', '');
encodedParams.set('Body', '');
encodedParams.set('Data', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessenger', '');
encodedParams.set('Fcm', '');
encodedParams.set('Gcm', '');
encodedParams.set('Identity', '');
encodedParams.set('Priority', '');
encodedParams.set('Segment', '');
encodedParams.set('Sms', '');
encodedParams.set('Sound', '');
encodedParams.set('Tag', '');
encodedParams.set('Title', '');
encodedParams.set('ToBinding', '');
encodedParams.set('Ttl', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Notifications',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('Action', '');
encodedParams.set('Alexa', '');
encodedParams.set('Apn', '');
encodedParams.set('Body', '');
encodedParams.set('Data', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessenger', '');
encodedParams.set('Fcm', '');
encodedParams.set('Gcm', '');
encodedParams.set('Identity', '');
encodedParams.set('Priority', '');
encodedParams.set('Segment', '');
encodedParams.set('Sms', '');
encodedParams.set('Sound', '');
encodedParams.set('Tag', '');
encodedParams.set('Title', '');
encodedParams.set('ToBinding', '');
encodedParams.set('Ttl', '');
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Notifications';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"Action=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Alexa=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Apn=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Body=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Data=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DeliveryCallbackUrl=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FacebookMessenger=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Fcm=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Gcm=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Identity=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Priority=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Segment=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Sms=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Sound=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Tag=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Title=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&ToBinding=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Ttl=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Services/:ServiceSid/Notifications"]
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/Services/:ServiceSid/Notifications" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:ServiceSid/Notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Services/:ServiceSid/Notifications', [
'form_params' => [
'Action' => '',
'Alexa' => '',
'Apn' => '',
'Body' => '',
'Data' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessenger' => '',
'Fcm' => '',
'Gcm' => '',
'Identity' => '',
'Priority' => '',
'Segment' => '',
'Sms' => '',
'Sound' => '',
'Tag' => '',
'Title' => '',
'ToBinding' => '',
'Ttl' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:ServiceSid/Notifications');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'Action' => '',
'Alexa' => '',
'Apn' => '',
'Body' => '',
'Data' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessenger' => '',
'Fcm' => '',
'Gcm' => '',
'Identity' => '',
'Priority' => '',
'Segment' => '',
'Sms' => '',
'Sound' => '',
'Tag' => '',
'Title' => '',
'ToBinding' => '',
'Ttl' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'Action' => '',
'Alexa' => '',
'Apn' => '',
'Body' => '',
'Data' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessenger' => '',
'Fcm' => '',
'Gcm' => '',
'Identity' => '',
'Priority' => '',
'Segment' => '',
'Sms' => '',
'Sound' => '',
'Tag' => '',
'Title' => '',
'ToBinding' => '',
'Ttl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Services/:ServiceSid/Notifications');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Notifications' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Notifications' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Services/:ServiceSid/Notifications", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:ServiceSid/Notifications"
payload = {
"Action": "",
"Alexa": "",
"Apn": "",
"Body": "",
"Data": "",
"DeliveryCallbackUrl": "",
"FacebookMessenger": "",
"Fcm": "",
"Gcm": "",
"Identity": "",
"Priority": "",
"Segment": "",
"Sms": "",
"Sound": "",
"Tag": "",
"Title": "",
"ToBinding": "",
"Ttl": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:ServiceSid/Notifications"
payload <- "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:ServiceSid/Notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:Action => "",
:Alexa => "",
:Apn => "",
:Body => "",
:Data => "",
:DeliveryCallbackUrl => "",
:FacebookMessenger => "",
:Fcm => "",
:Gcm => "",
:Identity => "",
:Priority => "",
:Segment => "",
:Sms => "",
:Sound => "",
:Tag => "",
:Title => "",
:ToBinding => "",
:Ttl => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Services/:ServiceSid/Notifications') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:ServiceSid/Notifications";
let payload = json!({
"Action": "",
"Alexa": "",
"Apn": "",
"Body": "",
"Data": "",
"DeliveryCallbackUrl": "",
"FacebookMessenger": "",
"Fcm": "",
"Gcm": "",
"Identity": "",
"Priority": "",
"Segment": "",
"Sms": "",
"Sound": "",
"Tag": "",
"Title": "",
"ToBinding": "",
"Ttl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Services/:ServiceSid/Notifications \
--header 'content-type: application/x-www-form-urlencoded' \
--data Action= \
--data Alexa= \
--data Apn= \
--data Body= \
--data Data= \
--data DeliveryCallbackUrl= \
--data FacebookMessenger= \
--data Fcm= \
--data Gcm= \
--data Identity= \
--data Priority= \
--data Segment= \
--data Sms= \
--data Sound= \
--data Tag= \
--data Title= \
--data ToBinding= \
--data Ttl=
http --form POST {{baseUrl}}/v1/Services/:ServiceSid/Notifications \
content-type:application/x-www-form-urlencoded \
Action='' \
Alexa='' \
Apn='' \
Body='' \
Data='' \
DeliveryCallbackUrl='' \
FacebookMessenger='' \
Fcm='' \
Gcm='' \
Identity='' \
Priority='' \
Segment='' \
Sms='' \
Sound='' \
Tag='' \
Title='' \
ToBinding='' \
Ttl=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'Action=&Alexa=&Apn=&Body=&Data=&DeliveryCallbackUrl=&FacebookMessenger=&Fcm=&Gcm=&Identity=&Priority=&Segment=&Sms=&Sound=&Tag=&Title=&ToBinding=&Ttl=' \
--output-document \
- {{baseUrl}}/v1/Services/:ServiceSid/Notifications
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "Action=".data(using: String.Encoding.utf8)!)
postData.append("&Alexa=".data(using: String.Encoding.utf8)!)
postData.append("&Apn=".data(using: String.Encoding.utf8)!)
postData.append("&Body=".data(using: String.Encoding.utf8)!)
postData.append("&Data=".data(using: String.Encoding.utf8)!)
postData.append("&DeliveryCallbackUrl=".data(using: String.Encoding.utf8)!)
postData.append("&FacebookMessenger=".data(using: String.Encoding.utf8)!)
postData.append("&Fcm=".data(using: String.Encoding.utf8)!)
postData.append("&Gcm=".data(using: String.Encoding.utf8)!)
postData.append("&Identity=".data(using: String.Encoding.utf8)!)
postData.append("&Priority=".data(using: String.Encoding.utf8)!)
postData.append("&Segment=".data(using: String.Encoding.utf8)!)
postData.append("&Sms=".data(using: String.Encoding.utf8)!)
postData.append("&Sound=".data(using: String.Encoding.utf8)!)
postData.append("&Tag=".data(using: String.Encoding.utf8)!)
postData.append("&Title=".data(using: String.Encoding.utf8)!)
postData.append("&ToBinding=".data(using: String.Encoding.utf8)!)
postData.append("&Ttl=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:ServiceSid/Notifications")! 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
CreateService
{{baseUrl}}/v1/Services
BODY formUrlEncoded
AlexaSkillId
ApnCredentialSid
DefaultAlexaNotificationProtocolVersion
DefaultApnNotificationProtocolVersion
DefaultFcmNotificationProtocolVersion
DefaultGcmNotificationProtocolVersion
DeliveryCallbackEnabled
DeliveryCallbackUrl
FacebookMessengerPageId
FcmCredentialSid
FriendlyName
GcmCredentialSid
LogEnabled
MessagingServiceSid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Services" {:form-params {:AlexaSkillId ""
:ApnCredentialSid ""
:DefaultAlexaNotificationProtocolVersion ""
:DefaultApnNotificationProtocolVersion ""
:DefaultFcmNotificationProtocolVersion ""
:DefaultGcmNotificationProtocolVersion ""
:DeliveryCallbackEnabled ""
:DeliveryCallbackUrl ""
:FacebookMessengerPageId ""
:FcmCredentialSid ""
:FriendlyName ""
:GcmCredentialSid ""
:LogEnabled ""
:MessagingServiceSid ""}})
require "http/client"
url = "{{baseUrl}}/v1/Services"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
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/Services"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "AlexaSkillId", "" },
{ "ApnCredentialSid", "" },
{ "DefaultAlexaNotificationProtocolVersion", "" },
{ "DefaultApnNotificationProtocolVersion", "" },
{ "DefaultFcmNotificationProtocolVersion", "" },
{ "DefaultGcmNotificationProtocolVersion", "" },
{ "DeliveryCallbackEnabled", "" },
{ "DeliveryCallbackUrl", "" },
{ "FacebookMessengerPageId", "" },
{ "FcmCredentialSid", "" },
{ "FriendlyName", "" },
{ "GcmCredentialSid", "" },
{ "LogEnabled", "" },
{ "MessagingServiceSid", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services"
payload := strings.NewReader("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Services HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 343
AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Services")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Services")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Services")
.header("content-type", "application/x-www-form-urlencoded")
.body("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
.asString();
const data = 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=';
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/Services');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
})
};
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/Services',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}
};
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/Services');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const url = '{{baseUrl}}/v1/Services';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"AlexaSkillId=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&ApnCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultAlexaNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultApnNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultFcmNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultGcmNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DeliveryCallbackEnabled=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DeliveryCallbackUrl=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FacebookMessengerPageId=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FcmCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FriendlyName=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&GcmCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&LogEnabled=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&MessagingServiceSid=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Services"]
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/Services" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Services', [
'form_params' => [
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Services');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Services", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services"
payload = {
"AlexaSkillId": "",
"ApnCredentialSid": "",
"DefaultAlexaNotificationProtocolVersion": "",
"DefaultApnNotificationProtocolVersion": "",
"DefaultFcmNotificationProtocolVersion": "",
"DefaultGcmNotificationProtocolVersion": "",
"DeliveryCallbackEnabled": "",
"DeliveryCallbackUrl": "",
"FacebookMessengerPageId": "",
"FcmCredentialSid": "",
"FriendlyName": "",
"GcmCredentialSid": "",
"LogEnabled": "",
"MessagingServiceSid": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services"
payload <- "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:AlexaSkillId => "",
:ApnCredentialSid => "",
:DefaultAlexaNotificationProtocolVersion => "",
:DefaultApnNotificationProtocolVersion => "",
:DefaultFcmNotificationProtocolVersion => "",
:DefaultGcmNotificationProtocolVersion => "",
:DeliveryCallbackEnabled => "",
:DeliveryCallbackUrl => "",
:FacebookMessengerPageId => "",
:FcmCredentialSid => "",
:FriendlyName => "",
:GcmCredentialSid => "",
:LogEnabled => "",
:MessagingServiceSid => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Services') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services";
let payload = json!({
"AlexaSkillId": "",
"ApnCredentialSid": "",
"DefaultAlexaNotificationProtocolVersion": "",
"DefaultApnNotificationProtocolVersion": "",
"DefaultFcmNotificationProtocolVersion": "",
"DefaultGcmNotificationProtocolVersion": "",
"DeliveryCallbackEnabled": "",
"DeliveryCallbackUrl": "",
"FacebookMessengerPageId": "",
"FcmCredentialSid": "",
"FriendlyName": "",
"GcmCredentialSid": "",
"LogEnabled": "",
"MessagingServiceSid": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Services \
--header 'content-type: application/x-www-form-urlencoded' \
--data AlexaSkillId= \
--data ApnCredentialSid= \
--data DefaultAlexaNotificationProtocolVersion= \
--data DefaultApnNotificationProtocolVersion= \
--data DefaultFcmNotificationProtocolVersion= \
--data DefaultGcmNotificationProtocolVersion= \
--data DeliveryCallbackEnabled= \
--data DeliveryCallbackUrl= \
--data FacebookMessengerPageId= \
--data FcmCredentialSid= \
--data FriendlyName= \
--data GcmCredentialSid= \
--data LogEnabled= \
--data MessagingServiceSid=
http --form POST {{baseUrl}}/v1/Services \
content-type:application/x-www-form-urlencoded \
AlexaSkillId='' \
ApnCredentialSid='' \
DefaultAlexaNotificationProtocolVersion='' \
DefaultApnNotificationProtocolVersion='' \
DefaultFcmNotificationProtocolVersion='' \
DefaultGcmNotificationProtocolVersion='' \
DeliveryCallbackEnabled='' \
DeliveryCallbackUrl='' \
FacebookMessengerPageId='' \
FcmCredentialSid='' \
FriendlyName='' \
GcmCredentialSid='' \
LogEnabled='' \
MessagingServiceSid=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=' \
--output-document \
- {{baseUrl}}/v1/Services
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "AlexaSkillId=".data(using: String.Encoding.utf8)!)
postData.append("&ApnCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultAlexaNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultApnNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultFcmNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultGcmNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DeliveryCallbackEnabled=".data(using: String.Encoding.utf8)!)
postData.append("&DeliveryCallbackUrl=".data(using: String.Encoding.utf8)!)
postData.append("&FacebookMessengerPageId=".data(using: String.Encoding.utf8)!)
postData.append("&FcmCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&FriendlyName=".data(using: String.Encoding.utf8)!)
postData.append("&GcmCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&LogEnabled=".data(using: String.Encoding.utf8)!)
postData.append("&MessagingServiceSid=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services")! 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
DeleteBinding
{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
QUERY PARAMS
ServiceSid
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
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/Services/:ServiceSid/Bindings/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
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/Services/:ServiceSid/Bindings/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"))
.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/Services/:ServiceSid/Bindings/:Sid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.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/Services/:ServiceSid/Bindings/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid';
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/Services/:ServiceSid/Bindings/:Sid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.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/Services/:ServiceSid/Bindings/:Sid',
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/Services/:ServiceSid/Bindings/:Sid'
};
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/Services/:ServiceSid/Bindings/:Sid');
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/Services/:ServiceSid/Bindings/:Sid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid';
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/Services/:ServiceSid/Bindings/:Sid"]
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/Services/:ServiceSid/Bindings/:Sid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid",
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/Services/:ServiceSid/Bindings/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/Services/:ServiceSid/Bindings/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
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/Services/:ServiceSid/Bindings/:Sid') 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/Services/:ServiceSid/Bindings/:Sid";
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/Services/:ServiceSid/Bindings/:Sid
http DELETE {{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")! 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
DeleteCredential
{{baseUrl}}/v1/Credentials/:Sid
QUERY PARAMS
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Credentials/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/Credentials/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Credentials/:Sid"
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/Credentials/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Credentials/:Sid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Credentials/:Sid"
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/Credentials/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/Credentials/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Credentials/:Sid"))
.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/Credentials/:Sid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/Credentials/:Sid")
.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/Credentials/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/Credentials/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Credentials/:Sid';
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/Credentials/:Sid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Credentials/:Sid")
.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/Credentials/:Sid',
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/Credentials/:Sid'};
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/Credentials/:Sid');
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/Credentials/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Credentials/:Sid';
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/Credentials/:Sid"]
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/Credentials/:Sid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Credentials/:Sid",
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/Credentials/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/Credentials/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Credentials/:Sid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Credentials/:Sid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Credentials/:Sid")
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/Credentials/:Sid') 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/Credentials/:Sid";
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/Credentials/:Sid
http DELETE {{baseUrl}}/v1/Credentials/:Sid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/Credentials/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Credentials/:Sid")! 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
DeleteService
{{baseUrl}}/v1/Services/:Sid
QUERY PARAMS
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/Services/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Services/:Sid"
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/Services/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:Sid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:Sid"
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/Services/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/Services/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:Sid"))
.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/Services/:Sid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/Services/:Sid")
.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/Services/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/Services/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:Sid';
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/Services/:Sid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:Sid")
.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/Services/:Sid',
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/Services/:Sid'};
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/Services/:Sid');
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/Services/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services/:Sid';
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/Services/:Sid"]
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/Services/:Sid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:Sid",
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/Services/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:Sid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:Sid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/Services/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:Sid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:Sid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:Sid")
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/Services/:Sid') 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/Services/:Sid";
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/Services/:Sid
http DELETE {{baseUrl}}/v1/Services/:Sid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/Services/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:Sid")! 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
FetchBinding
{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
QUERY PARAMS
ServiceSid
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
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/Services/:ServiceSid/Bindings/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
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/Services/:ServiceSid/Bindings/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"))
.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/Services/:ServiceSid/Bindings/:Sid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.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/Services/:ServiceSid/Bindings/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid';
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/Services/:ServiceSid/Bindings/:Sid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:ServiceSid/Bindings/:Sid',
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/Services/:ServiceSid/Bindings/:Sid'
};
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/Services/:ServiceSid/Bindings/:Sid');
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/Services/:ServiceSid/Bindings/:Sid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid';
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/Services/:ServiceSid/Bindings/:Sid"]
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/Services/:ServiceSid/Bindings/:Sid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid",
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/Services/:ServiceSid/Bindings/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Services/:ServiceSid/Bindings/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")
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/Services/:ServiceSid/Bindings/:Sid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid";
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/Services/:ServiceSid/Bindings/:Sid
http GET {{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:ServiceSid/Bindings/:Sid")! 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
FetchCredential
{{baseUrl}}/v1/Credentials/:Sid
QUERY PARAMS
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Credentials/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Credentials/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Credentials/:Sid"
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/Credentials/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Credentials/:Sid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Credentials/:Sid"
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/Credentials/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Credentials/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Credentials/:Sid"))
.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/Credentials/:Sid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Credentials/:Sid")
.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/Credentials/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/Credentials/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Credentials/:Sid';
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/Credentials/:Sid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Credentials/:Sid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Credentials/:Sid',
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/Credentials/:Sid'};
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/Credentials/:Sid');
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/Credentials/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Credentials/:Sid';
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/Credentials/:Sid"]
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/Credentials/:Sid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Credentials/:Sid",
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/Credentials/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Credentials/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Credentials/:Sid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Credentials/:Sid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Credentials/:Sid")
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/Credentials/:Sid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Credentials/:Sid";
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/Credentials/:Sid
http GET {{baseUrl}}/v1/Credentials/:Sid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Credentials/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Credentials/:Sid")! 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
FetchService
{{baseUrl}}/v1/Services/:Sid
QUERY PARAMS
Sid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:Sid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Services/:Sid")
require "http/client"
url = "{{baseUrl}}/v1/Services/:Sid"
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/Services/:Sid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:Sid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:Sid"
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/Services/:Sid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Services/:Sid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:Sid"))
.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/Services/:Sid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Services/:Sid")
.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/Services/:Sid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/Services/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:Sid';
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/Services/:Sid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:Sid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:Sid',
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/Services/:Sid'};
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/Services/:Sid');
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/Services/:Sid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services/:Sid';
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/Services/:Sid"]
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/Services/:Sid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:Sid",
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/Services/:Sid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:Sid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:Sid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Services/:Sid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:Sid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:Sid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:Sid")
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/Services/:Sid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:Sid";
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/Services/:Sid
http GET {{baseUrl}}/v1/Services/:Sid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Services/:Sid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:Sid")! 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
ListBinding
{{baseUrl}}/v1/Services/:ServiceSid/Bindings
QUERY PARAMS
ServiceSid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:ServiceSid/Bindings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
require "http/client"
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
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/Services/:ServiceSid/Bindings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:ServiceSid/Bindings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
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/Services/:ServiceSid/Bindings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:ServiceSid/Bindings"))
.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/Services/:ServiceSid/Bindings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.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/Services/:ServiceSid/Bindings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/Services/:ServiceSid/Bindings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings';
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/Services/:ServiceSid/Bindings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:ServiceSid/Bindings',
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/Services/:ServiceSid/Bindings'
};
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/Services/:ServiceSid/Bindings');
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/Services/:ServiceSid/Bindings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services/:ServiceSid/Bindings';
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/Services/:ServiceSid/Bindings"]
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/Services/:ServiceSid/Bindings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:ServiceSid/Bindings",
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/Services/:ServiceSid/Bindings');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services/:ServiceSid/Bindings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:ServiceSid/Bindings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Services/:ServiceSid/Bindings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:ServiceSid/Bindings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:ServiceSid/Bindings")
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/Services/:ServiceSid/Bindings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:ServiceSid/Bindings";
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/Services/:ServiceSid/Bindings
http GET {{baseUrl}}/v1/Services/:ServiceSid/Bindings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Services/:ServiceSid/Bindings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:ServiceSid/Bindings")! 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
ListCredential
{{baseUrl}}/v1/Credentials
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Credentials");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Credentials")
require "http/client"
url = "{{baseUrl}}/v1/Credentials"
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/Credentials"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Credentials");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Credentials"
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/Credentials HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Credentials")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Credentials"))
.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/Credentials")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Credentials")
.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/Credentials');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/Credentials'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Credentials';
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/Credentials',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Credentials")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Credentials',
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/Credentials'};
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/Credentials');
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/Credentials'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Credentials';
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/Credentials"]
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/Credentials" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Credentials",
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/Credentials');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Credentials');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Credentials');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Credentials' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Credentials' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Credentials")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Credentials"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Credentials"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Credentials")
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/Credentials') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Credentials";
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/Credentials
http GET {{baseUrl}}/v1/Credentials
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Credentials
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Credentials")! 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
ListService
{{baseUrl}}/v1/Services
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/Services")
require "http/client"
url = "{{baseUrl}}/v1/Services"
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/Services"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services"
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/Services HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/Services")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services"))
.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/Services")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/Services")
.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/Services');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/Services'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services';
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/Services',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services',
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/Services'};
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/Services');
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/Services'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/Services';
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/Services"]
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/Services" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services",
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/Services');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/Services');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/Services")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services")
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/Services') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services";
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/Services
http GET {{baseUrl}}/v1/Services
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/Services
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services")! 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
UpdateCredential
{{baseUrl}}/v1/Credentials/:Sid
QUERY PARAMS
Sid
BODY formUrlEncoded
ApiKey
Certificate
FriendlyName
PrivateKey
Sandbox
Secret
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Credentials/:Sid");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Credentials/:Sid" {:form-params {:ApiKey ""
:Certificate ""
:FriendlyName ""
:PrivateKey ""
:Sandbox ""
:Secret ""}})
require "http/client"
url = "{{baseUrl}}/v1/Credentials/:Sid"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret="
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/Credentials/:Sid"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "ApiKey", "" },
{ "Certificate", "" },
{ "FriendlyName", "" },
{ "PrivateKey", "" },
{ "Sandbox", "" },
{ "Secret", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Credentials/:Sid");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Credentials/:Sid"
payload := strings.NewReader("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Credentials/:Sid HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 63
ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Credentials/:Sid")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Credentials/:Sid"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Credentials/:Sid")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Credentials/:Sid")
.header("content-type", "application/x-www-form-urlencoded")
.body("ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=")
.asString();
const data = 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=';
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/Credentials/:Sid');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Credentials/:Sid';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: ''
})
};
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/Credentials/:Sid',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Credentials/:Sid")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Credentials/:Sid',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: ''
}
};
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/Credentials/:Sid');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
ApiKey: '',
Certificate: '',
FriendlyName: '',
PrivateKey: '',
Sandbox: '',
Secret: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Credentials/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('ApiKey', '');
encodedParams.set('Certificate', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('PrivateKey', '');
encodedParams.set('Sandbox', '');
encodedParams.set('Secret', '');
const url = '{{baseUrl}}/v1/Credentials/:Sid';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"ApiKey=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Certificate=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FriendlyName=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&PrivateKey=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Sandbox=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Secret=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Credentials/:Sid"]
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/Credentials/:Sid" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Credentials/:Sid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Credentials/:Sid', [
'form_params' => [
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'ApiKey' => '',
'Certificate' => '',
'FriendlyName' => '',
'PrivateKey' => '',
'Sandbox' => '',
'Secret' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Credentials/:Sid');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Credentials/:Sid' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Credentials/:Sid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Credentials/:Sid"
payload = {
"ApiKey": "",
"Certificate": "",
"FriendlyName": "",
"PrivateKey": "",
"Sandbox": "",
"Secret": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Credentials/:Sid"
payload <- "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Credentials/:Sid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:ApiKey => "",
:Certificate => "",
:FriendlyName => "",
:PrivateKey => "",
:Sandbox => "",
:Secret => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Credentials/:Sid') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Credentials/:Sid";
let payload = json!({
"ApiKey": "",
"Certificate": "",
"FriendlyName": "",
"PrivateKey": "",
"Sandbox": "",
"Secret": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Credentials/:Sid \
--header 'content-type: application/x-www-form-urlencoded' \
--data ApiKey= \
--data Certificate= \
--data FriendlyName= \
--data PrivateKey= \
--data Sandbox= \
--data Secret=
http --form POST {{baseUrl}}/v1/Credentials/:Sid \
content-type:application/x-www-form-urlencoded \
ApiKey='' \
Certificate='' \
FriendlyName='' \
PrivateKey='' \
Sandbox='' \
Secret=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'ApiKey=&Certificate=&FriendlyName=&PrivateKey=&Sandbox=&Secret=' \
--output-document \
- {{baseUrl}}/v1/Credentials/:Sid
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "ApiKey=".data(using: String.Encoding.utf8)!)
postData.append("&Certificate=".data(using: String.Encoding.utf8)!)
postData.append("&FriendlyName=".data(using: String.Encoding.utf8)!)
postData.append("&PrivateKey=".data(using: String.Encoding.utf8)!)
postData.append("&Sandbox=".data(using: String.Encoding.utf8)!)
postData.append("&Secret=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Credentials/:Sid")! 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
UpdateService
{{baseUrl}}/v1/Services/:Sid
QUERY PARAMS
Sid
BODY formUrlEncoded
AlexaSkillId
ApnCredentialSid
DefaultAlexaNotificationProtocolVersion
DefaultApnNotificationProtocolVersion
DefaultFcmNotificationProtocolVersion
DefaultGcmNotificationProtocolVersion
DeliveryCallbackEnabled
DeliveryCallbackUrl
FacebookMessengerPageId
FcmCredentialSid
FriendlyName
GcmCredentialSid
LogEnabled
MessagingServiceSid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/Services/:Sid");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/Services/:Sid" {:form-params {:AlexaSkillId ""
:ApnCredentialSid ""
:DefaultAlexaNotificationProtocolVersion ""
:DefaultApnNotificationProtocolVersion ""
:DefaultFcmNotificationProtocolVersion ""
:DefaultGcmNotificationProtocolVersion ""
:DeliveryCallbackEnabled ""
:DeliveryCallbackUrl ""
:FacebookMessengerPageId ""
:FcmCredentialSid ""
:FriendlyName ""
:GcmCredentialSid ""
:LogEnabled ""
:MessagingServiceSid ""}})
require "http/client"
url = "{{baseUrl}}/v1/Services/:Sid"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
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/Services/:Sid"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "AlexaSkillId", "" },
{ "ApnCredentialSid", "" },
{ "DefaultAlexaNotificationProtocolVersion", "" },
{ "DefaultApnNotificationProtocolVersion", "" },
{ "DefaultFcmNotificationProtocolVersion", "" },
{ "DefaultGcmNotificationProtocolVersion", "" },
{ "DeliveryCallbackEnabled", "" },
{ "DeliveryCallbackUrl", "" },
{ "FacebookMessengerPageId", "" },
{ "FcmCredentialSid", "" },
{ "FriendlyName", "" },
{ "GcmCredentialSid", "" },
{ "LogEnabled", "" },
{ "MessagingServiceSid", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/Services/:Sid");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/Services/:Sid"
payload := strings.NewReader("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/Services/:Sid HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 343
AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/Services/:Sid")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/Services/:Sid"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/Services/:Sid")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/Services/:Sid")
.header("content-type", "application/x-www-form-urlencoded")
.body("AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
.asString();
const data = 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=';
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/Services/:Sid');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/Services/:Sid';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
})
};
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/Services/:Sid',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=")
val request = Request.Builder()
.url("{{baseUrl}}/v1/Services/:Sid")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/Services/:Sid',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
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(qs.stringify({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
}
};
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/Services/:Sid');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
AlexaSkillId: '',
ApnCredentialSid: '',
DefaultAlexaNotificationProtocolVersion: '',
DefaultApnNotificationProtocolVersion: '',
DefaultFcmNotificationProtocolVersion: '',
DefaultGcmNotificationProtocolVersion: '',
DeliveryCallbackEnabled: '',
DeliveryCallbackUrl: '',
FacebookMessengerPageId: '',
FcmCredentialSid: '',
FriendlyName: '',
GcmCredentialSid: '',
LogEnabled: '',
MessagingServiceSid: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/Services/:Sid',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('AlexaSkillId', '');
encodedParams.set('ApnCredentialSid', '');
encodedParams.set('DefaultAlexaNotificationProtocolVersion', '');
encodedParams.set('DefaultApnNotificationProtocolVersion', '');
encodedParams.set('DefaultFcmNotificationProtocolVersion', '');
encodedParams.set('DefaultGcmNotificationProtocolVersion', '');
encodedParams.set('DeliveryCallbackEnabled', '');
encodedParams.set('DeliveryCallbackUrl', '');
encodedParams.set('FacebookMessengerPageId', '');
encodedParams.set('FcmCredentialSid', '');
encodedParams.set('FriendlyName', '');
encodedParams.set('GcmCredentialSid', '');
encodedParams.set('LogEnabled', '');
encodedParams.set('MessagingServiceSid', '');
const url = '{{baseUrl}}/v1/Services/:Sid';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
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/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"AlexaSkillId=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&ApnCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultAlexaNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultApnNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultFcmNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DefaultGcmNotificationProtocolVersion=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DeliveryCallbackEnabled=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&DeliveryCallbackUrl=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FacebookMessengerPageId=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FcmCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&FriendlyName=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&GcmCredentialSid=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&LogEnabled=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&MessagingServiceSid=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/Services/:Sid"]
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/Services/:Sid" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/Services/:Sid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/Services/:Sid', [
'form_params' => [
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'AlexaSkillId' => '',
'ApnCredentialSid' => '',
'DefaultAlexaNotificationProtocolVersion' => '',
'DefaultApnNotificationProtocolVersion' => '',
'DefaultFcmNotificationProtocolVersion' => '',
'DefaultGcmNotificationProtocolVersion' => '',
'DeliveryCallbackEnabled' => '',
'DeliveryCallbackUrl' => '',
'FacebookMessengerPageId' => '',
'FcmCredentialSid' => '',
'FriendlyName' => '',
'GcmCredentialSid' => '',
'LogEnabled' => '',
'MessagingServiceSid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/Services/:Sid');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/Services/:Sid' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/Services/:Sid' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/v1/Services/:Sid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/Services/:Sid"
payload = {
"AlexaSkillId": "",
"ApnCredentialSid": "",
"DefaultAlexaNotificationProtocolVersion": "",
"DefaultApnNotificationProtocolVersion": "",
"DefaultFcmNotificationProtocolVersion": "",
"DefaultGcmNotificationProtocolVersion": "",
"DeliveryCallbackEnabled": "",
"DeliveryCallbackUrl": "",
"FacebookMessengerPageId": "",
"FcmCredentialSid": "",
"FriendlyName": "",
"GcmCredentialSid": "",
"LogEnabled": "",
"MessagingServiceSid": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/Services/:Sid"
payload <- "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/Services/:Sid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:AlexaSkillId => "",
:ApnCredentialSid => "",
:DefaultAlexaNotificationProtocolVersion => "",
:DefaultApnNotificationProtocolVersion => "",
:DefaultFcmNotificationProtocolVersion => "",
:DefaultGcmNotificationProtocolVersion => "",
:DeliveryCallbackEnabled => "",
:DeliveryCallbackUrl => "",
:FacebookMessengerPageId => "",
:FcmCredentialSid => "",
:FriendlyName => "",
:GcmCredentialSid => "",
:LogEnabled => "",
:MessagingServiceSid => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/v1/Services/:Sid') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/Services/:Sid";
let payload = json!({
"AlexaSkillId": "",
"ApnCredentialSid": "",
"DefaultAlexaNotificationProtocolVersion": "",
"DefaultApnNotificationProtocolVersion": "",
"DefaultFcmNotificationProtocolVersion": "",
"DefaultGcmNotificationProtocolVersion": "",
"DeliveryCallbackEnabled": "",
"DeliveryCallbackUrl": "",
"FacebookMessengerPageId": "",
"FcmCredentialSid": "",
"FriendlyName": "",
"GcmCredentialSid": "",
"LogEnabled": "",
"MessagingServiceSid": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/Services/:Sid \
--header 'content-type: application/x-www-form-urlencoded' \
--data AlexaSkillId= \
--data ApnCredentialSid= \
--data DefaultAlexaNotificationProtocolVersion= \
--data DefaultApnNotificationProtocolVersion= \
--data DefaultFcmNotificationProtocolVersion= \
--data DefaultGcmNotificationProtocolVersion= \
--data DeliveryCallbackEnabled= \
--data DeliveryCallbackUrl= \
--data FacebookMessengerPageId= \
--data FcmCredentialSid= \
--data FriendlyName= \
--data GcmCredentialSid= \
--data LogEnabled= \
--data MessagingServiceSid=
http --form POST {{baseUrl}}/v1/Services/:Sid \
content-type:application/x-www-form-urlencoded \
AlexaSkillId='' \
ApnCredentialSid='' \
DefaultAlexaNotificationProtocolVersion='' \
DefaultApnNotificationProtocolVersion='' \
DefaultFcmNotificationProtocolVersion='' \
DefaultGcmNotificationProtocolVersion='' \
DeliveryCallbackEnabled='' \
DeliveryCallbackUrl='' \
FacebookMessengerPageId='' \
FcmCredentialSid='' \
FriendlyName='' \
GcmCredentialSid='' \
LogEnabled='' \
MessagingServiceSid=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'AlexaSkillId=&ApnCredentialSid=&DefaultAlexaNotificationProtocolVersion=&DefaultApnNotificationProtocolVersion=&DefaultFcmNotificationProtocolVersion=&DefaultGcmNotificationProtocolVersion=&DeliveryCallbackEnabled=&DeliveryCallbackUrl=&FacebookMessengerPageId=&FcmCredentialSid=&FriendlyName=&GcmCredentialSid=&LogEnabled=&MessagingServiceSid=' \
--output-document \
- {{baseUrl}}/v1/Services/:Sid
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "AlexaSkillId=".data(using: String.Encoding.utf8)!)
postData.append("&ApnCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultAlexaNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultApnNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultFcmNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DefaultGcmNotificationProtocolVersion=".data(using: String.Encoding.utf8)!)
postData.append("&DeliveryCallbackEnabled=".data(using: String.Encoding.utf8)!)
postData.append("&DeliveryCallbackUrl=".data(using: String.Encoding.utf8)!)
postData.append("&FacebookMessengerPageId=".data(using: String.Encoding.utf8)!)
postData.append("&FcmCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&FriendlyName=".data(using: String.Encoding.utf8)!)
postData.append("&GcmCredentialSid=".data(using: String.Encoding.utf8)!)
postData.append("&LogEnabled=".data(using: String.Encoding.utf8)!)
postData.append("&MessagingServiceSid=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/Services/:Sid")! 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()