Meraki Dashboard API
POST
Create an action batch
{{baseUrl}}/organizations/:organizationId/actionBatches
QUERY PARAMS
organizationId
BODY json
{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/actionBatches");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/actionBatches" {:content-type :json
:form-params {:actions [{:body {}
:operation ""
:resource ""}]
:confirmed false
:synchronous false}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/actionBatches"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/actionBatches"),
Content = new StringContent("{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/actionBatches");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/actionBatches"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/actionBatches HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 142
{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/actionBatches")
.setHeader("content-type", "application/json")
.setBody("{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/actionBatches"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/actionBatches")
.header("content-type", "application/json")
.body("{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}")
.asString();
const data = JSON.stringify({
actions: [
{
body: {},
operation: '',
resource: ''
}
],
confirmed: false,
synchronous: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/actionBatches');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches',
headers: {'content-type': 'application/json'},
data: {
actions: [{body: {}, operation: '', resource: ''}],
confirmed: false,
synchronous: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"body":{},"operation":"","resource":""}],"confirmed":false,"synchronous":false}'
};
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}}/organizations/:organizationId/actionBatches',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actions": [\n {\n "body": {},\n "operation": "",\n "resource": ""\n }\n ],\n "confirmed": false,\n "synchronous": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/actionBatches',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
actions: [{body: {}, operation: '', resource: ''}],
confirmed: false,
synchronous: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches',
headers: {'content-type': 'application/json'},
body: {
actions: [{body: {}, operation: '', resource: ''}],
confirmed: false,
synchronous: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/actionBatches');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actions: [
{
body: {},
operation: '',
resource: ''
}
],
confirmed: false,
synchronous: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches',
headers: {'content-type': 'application/json'},
data: {
actions: [{body: {}, operation: '', resource: ''}],
confirmed: false,
synchronous: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"body":{},"operation":"","resource":""}],"confirmed":false,"synchronous":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"actions": @[ @{ @"body": @{ }, @"operation": @"", @"resource": @"" } ],
@"confirmed": @NO,
@"synchronous": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/actionBatches"]
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}}/organizations/:organizationId/actionBatches" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/actionBatches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'actions' => [
[
'body' => [
],
'operation' => '',
'resource' => ''
]
],
'confirmed' => null,
'synchronous' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/actionBatches', [
'body' => '{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/actionBatches');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actions' => [
[
'body' => [
],
'operation' => '',
'resource' => ''
]
],
'confirmed' => null,
'synchronous' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actions' => [
[
'body' => [
],
'operation' => '',
'resource' => ''
]
],
'confirmed' => null,
'synchronous' => null
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/actionBatches');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/actionBatches", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/actionBatches"
payload = {
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": False,
"synchronous": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/actionBatches"
payload <- "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/actionBatches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/actionBatches') do |req|
req.body = "{\n \"actions\": [\n {\n \"body\": {},\n \"operation\": \"\",\n \"resource\": \"\"\n }\n ],\n \"confirmed\": false,\n \"synchronous\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/actionBatches";
let payload = json!({
"actions": (
json!({
"body": json!({}),
"operation": "",
"resource": ""
})
),
"confirmed": false,
"synchronous": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/actionBatches \
--header 'content-type: application/json' \
--data '{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}'
echo '{
"actions": [
{
"body": {},
"operation": "",
"resource": ""
}
],
"confirmed": false,
"synchronous": false
}' | \
http POST {{baseUrl}}/organizations/:organizationId/actionBatches \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "actions": [\n {\n "body": {},\n "operation": "",\n "resource": ""\n }\n ],\n "confirmed": false,\n "synchronous": false\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/actionBatches
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actions": [
[
"body": [],
"operation": "",
"resource": ""
]
],
"confirmed": false,
"synchronous": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/actionBatches")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"actions": [
{
"body": {
"name": "Group 1"
},
"operation": "create",
"resource": "/networks/L_XXXXX/groupPolicies"
}
],
"confirmed": true,
"id": "123",
"organizationId": "2930418",
"status": {
"completed": true,
"createdResources": [
{
"id": 100,
"uri": "/networks/L_XXXXX/groupPolicies/100"
}
],
"errors": [],
"failed": false
},
"synchronous": false
}
DELETE
Delete an action batch
{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId
QUERY PARAMS
organizationId
actionBatchId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
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}}/organizations/:organizationId/actionBatches/:actionBatchId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
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/organizations/:organizationId/actionBatches/:actionBatchId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"))
.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}}/organizations/:organizationId/actionBatches/:actionBatchId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.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}}/organizations/:organizationId/actionBatches/:actionBatchId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId';
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}}/organizations/:organizationId/actionBatches/:actionBatchId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/actionBatches/:actionBatchId',
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}}/organizations/:organizationId/actionBatches/:actionBatchId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
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}}/organizations/:organizationId/actionBatches/:actionBatchId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId';
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}}/organizations/:organizationId/actionBatches/:actionBatchId"]
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}}/organizations/:organizationId/actionBatches/:actionBatchId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId",
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}}/organizations/:organizationId/actionBatches/:actionBatchId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationId/actionBatches/:actionBatchId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
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/organizations/:organizationId/actionBatches/:actionBatchId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId";
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}}/organizations/:organizationId/actionBatches/:actionBatchId
http DELETE {{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")! 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
Return the list of action batches in the organization
{{baseUrl}}/organizations/:organizationId/actionBatches
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/actionBatches");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/actionBatches")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/actionBatches"
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}}/organizations/:organizationId/actionBatches"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/actionBatches");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/actionBatches"
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/organizations/:organizationId/actionBatches HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/actionBatches")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/actionBatches"))
.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}}/organizations/:organizationId/actionBatches")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/actionBatches")
.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}}/organizations/:organizationId/actionBatches');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches';
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}}/organizations/:organizationId/actionBatches',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/actionBatches',
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}}/organizations/:organizationId/actionBatches'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/actionBatches');
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}}/organizations/:organizationId/actionBatches'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches';
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}}/organizations/:organizationId/actionBatches"]
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}}/organizations/:organizationId/actionBatches" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/actionBatches",
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}}/organizations/:organizationId/actionBatches');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/actionBatches');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/actionBatches');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/actionBatches")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/actionBatches"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/actionBatches"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/actionBatches")
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/organizations/:organizationId/actionBatches') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/actionBatches";
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}}/organizations/:organizationId/actionBatches
http GET {{baseUrl}}/organizations/:organizationId/actionBatches
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/actionBatches
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/actionBatches")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"actions": [
{
"body": {
"name": "Group 1"
},
"operation": "create",
"resource": "/networks/L_XXXXX/groupPolicies"
}
],
"confirmed": true,
"id": "123",
"organizationId": "2930418",
"status": {
"completed": true,
"createdResources": [
{
"id": 100,
"uri": "/networks/L_XXXXX/groupPolicies/100"
}
],
"errors": [],
"failed": false
},
"synchronous": false
}
]
PUT
Update an action batch
{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId
QUERY PARAMS
organizationId
actionBatchId
BODY json
{
"confirmed": false,
"synchronous": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"confirmed\": false,\n \"synchronous\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId" {:content-type :json
:form-params {:confirmed false
:synchronous false}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"confirmed\": false,\n \"synchronous\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"),
Content = new StringContent("{\n \"confirmed\": false,\n \"synchronous\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"confirmed\": false,\n \"synchronous\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
payload := strings.NewReader("{\n \"confirmed\": false,\n \"synchronous\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/actionBatches/:actionBatchId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 48
{
"confirmed": false,
"synchronous": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.setHeader("content-type", "application/json")
.setBody("{\n \"confirmed\": false,\n \"synchronous\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"confirmed\": false,\n \"synchronous\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"confirmed\": false,\n \"synchronous\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.header("content-type", "application/json")
.body("{\n \"confirmed\": false,\n \"synchronous\": false\n}")
.asString();
const data = JSON.stringify({
confirmed: false,
synchronous: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId',
headers: {'content-type': 'application/json'},
data: {confirmed: false, synchronous: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"confirmed":false,"synchronous":false}'
};
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}}/organizations/:organizationId/actionBatches/:actionBatchId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "confirmed": false,\n "synchronous": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"confirmed\": false,\n \"synchronous\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/actionBatches/:actionBatchId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({confirmed: false, synchronous: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId',
headers: {'content-type': 'application/json'},
body: {confirmed: false, synchronous: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
confirmed: false,
synchronous: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId',
headers: {'content-type': 'application/json'},
data: {confirmed: false, synchronous: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"confirmed":false,"synchronous":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"confirmed": @NO,
@"synchronous": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"confirmed\": false,\n \"synchronous\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'confirmed' => null,
'synchronous' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId', [
'body' => '{
"confirmed": false,
"synchronous": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'confirmed' => null,
'synchronous' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'confirmed' => null,
'synchronous' => null
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"confirmed": false,
"synchronous": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"confirmed": false,
"synchronous": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"confirmed\": false,\n \"synchronous\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/actionBatches/:actionBatchId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
payload = {
"confirmed": False,
"synchronous": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId"
payload <- "{\n \"confirmed\": false,\n \"synchronous\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"confirmed\": false,\n \"synchronous\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/actionBatches/:actionBatchId') do |req|
req.body = "{\n \"confirmed\": false,\n \"synchronous\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId";
let payload = json!({
"confirmed": false,
"synchronous": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId \
--header 'content-type: application/json' \
--data '{
"confirmed": false,
"synchronous": false
}'
echo '{
"confirmed": false,
"synchronous": false
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "confirmed": false,\n "synchronous": false\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"confirmed": false,
"synchronous": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/actionBatches/:actionBatchId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"actions": [
{
"body": {
"name": "Group 1"
},
"operation": "create",
"resource": "/networks/L_XXXXX/groupPolicies"
}
],
"confirmed": true,
"id": "123",
"organizationId": "2930418",
"status": {
"completed": false,
"createdResources": [],
"errors": [],
"failed": false
},
"synchronous": false
}
POST
Create a new dashboard administrator
{{baseUrl}}/organizations/:organizationId/admins
QUERY PARAMS
organizationId
BODY json
{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/admins");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/admins" {:content-type :json
:form-params {:authenticationMethod ""
:email ""
:name ""
:networks [{:access ""
:id ""}]
:orgAccess ""
:tags [{:access ""
:tag ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/admins"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/admins"),
Content = new StringContent("{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/admins");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/admins"
payload := strings.NewReader("{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/admins HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 213
{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/admins")
.setHeader("content-type", "application/json")
.setBody("{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/admins"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/admins")
.header("content-type", "application/json")
.body("{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
authenticationMethod: '',
email: '',
name: '',
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
tags: [
{
access: '',
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}}/organizations/:organizationId/admins');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/admins',
headers: {'content-type': 'application/json'},
data: {
authenticationMethod: '',
email: '',
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/admins';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticationMethod":"","email":"","name":"","networks":[{"access":"","id":""}],"orgAccess":"","tags":[{"access":"","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}}/organizations/:organizationId/admins',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "authenticationMethod": "",\n "email": "",\n "name": "",\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/admins',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
authenticationMethod: '',
email: '',
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/admins',
headers: {'content-type': 'application/json'},
body: {
authenticationMethod: '',
email: '',
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/admins');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
authenticationMethod: '',
email: '',
name: '',
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
tags: [
{
access: '',
tag: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/admins',
headers: {'content-type': 'application/json'},
data: {
authenticationMethod: '',
email: '',
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/admins';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticationMethod":"","email":"","name":"","networks":[{"access":"","id":""}],"orgAccess":"","tags":[{"access":"","tag":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"authenticationMethod": @"",
@"email": @"",
@"name": @"",
@"networks": @[ @{ @"access": @"", @"id": @"" } ],
@"orgAccess": @"",
@"tags": @[ @{ @"access": @"", @"tag": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/admins"]
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}}/organizations/:organizationId/admins" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/admins",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'authenticationMethod' => '',
'email' => '',
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/admins', [
'body' => '{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/admins');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authenticationMethod' => '',
'email' => '',
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authenticationMethod' => '',
'email' => '',
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/admins');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/admins' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/admins' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/admins", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/admins"
payload = {
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/admins"
payload <- "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/admins")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/admins') do |req|
req.body = "{\n \"authenticationMethod\": \"\",\n \"email\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/admins";
let payload = json!({
"authenticationMethod": "",
"email": "",
"name": "",
"networks": (
json!({
"access": "",
"id": ""
})
),
"orgAccess": "",
"tags": (
json!({
"access": "",
"tag": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/admins \
--header 'content-type: application/json' \
--data '{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
echo '{
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}' | \
http POST {{baseUrl}}/organizations/:organizationId/admins \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "authenticationMethod": "",\n "email": "",\n "name": "",\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/admins
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"authenticationMethod": "",
"email": "",
"name": "",
"networks": [
[
"access": "",
"id": ""
]
],
"orgAccess": "",
"tags": [
[
"access": "",
"tag": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/admins")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accountStatus": "ok",
"authenticationMethod": "Email",
"email": "miles@meraki.com",
"hasApiKey": true,
"id": "212406",
"lastActive": 1526087474,
"name": "Miles Meraki",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"tags": [
{
"access": "read-only",
"tag": "west"
}
],
"twoFactorAuthEnabled": false
}
GET
List the dashboard administrators in this organization
{{baseUrl}}/organizations/:organizationId/admins
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/admins");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/admins")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/admins"
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}}/organizations/:organizationId/admins"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/admins");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/admins"
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/organizations/:organizationId/admins HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/admins")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/admins"))
.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}}/organizations/:organizationId/admins")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/admins")
.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}}/organizations/:organizationId/admins');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/admins'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/admins';
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}}/organizations/:organizationId/admins',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/admins',
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}}/organizations/:organizationId/admins'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/admins');
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}}/organizations/:organizationId/admins'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/admins';
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}}/organizations/:organizationId/admins"]
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}}/organizations/:organizationId/admins" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/admins",
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}}/organizations/:organizationId/admins');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/admins');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/admins');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/admins' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/admins' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/admins")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/admins"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/admins"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/admins")
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/organizations/:organizationId/admins') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/admins";
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}}/organizations/:organizationId/admins
http GET {{baseUrl}}/organizations/:organizationId/admins
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/admins
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/admins")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"accountStatus": "ok",
"authenticationMethod": "Email",
"email": "miles@meraki.com",
"hasApiKey": true,
"id": "212406",
"lastActive": 1526087474,
"name": "Miles Meraki",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"tags": [
{
"access": "read-only",
"tag": "west"
}
],
"twoFactorAuthEnabled": false
}
]
DELETE
Revoke all access for a dashboard administrator within this organization
{{baseUrl}}/organizations/:organizationId/admins/:adminId
QUERY PARAMS
organizationId
adminId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/admins/:adminId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationId/admins/:adminId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
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}}/organizations/:organizationId/admins/:adminId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/admins/:adminId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
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/organizations/:organizationId/admins/:adminId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/admins/:adminId"))
.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}}/organizations/:organizationId/admins/:adminId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.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}}/organizations/:organizationId/admins/:adminId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationId/admins/:adminId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/admins/:adminId';
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}}/organizations/:organizationId/admins/:adminId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/admins/:adminId',
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}}/organizations/:organizationId/admins/:adminId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationId/admins/:adminId');
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}}/organizations/:organizationId/admins/:adminId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/admins/:adminId';
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}}/organizations/:organizationId/admins/:adminId"]
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}}/organizations/:organizationId/admins/:adminId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/admins/:adminId",
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}}/organizations/:organizationId/admins/:adminId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/admins/:adminId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/admins/:adminId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/admins/:adminId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/admins/:adminId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationId/admins/:adminId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
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/organizations/:organizationId/admins/:adminId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId";
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}}/organizations/:organizationId/admins/:adminId
http DELETE {{baseUrl}}/organizations/:organizationId/admins/:adminId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationId/admins/:adminId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/admins/:adminId")! 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()
PUT
Update an administrator
{{baseUrl}}/organizations/:organizationId/admins/:adminId
QUERY PARAMS
organizationId
adminId
BODY json
{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/admins/:adminId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/admins/:adminId" {:content-type :json
:form-params {:name ""
:networks [{:access ""
:id ""}]
:orgAccess ""
:tags [{:access ""
:tag ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/admins/:adminId"),
Content = new StringContent("{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/admins/:adminId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
payload := strings.NewReader("{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/admins/:adminId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 168
{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/admins/:adminId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
name: '',
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
tags: [
{
access: '',
tag: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/admins/:adminId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/admins/:adminId',
headers: {'content-type': 'application/json'},
data: {
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/admins/:adminId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","networks":[{"access":"","id":""}],"orgAccess":"","tags":[{"access":"","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}}/organizations/:organizationId/admins/:adminId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/admins/:adminId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/admins/:adminId',
headers: {'content-type': 'application/json'},
body: {
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/admins/:adminId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
tags: [
{
access: '',
tag: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/admins/:adminId',
headers: {'content-type': 'application/json'},
data: {
name: '',
networks: [{access: '', id: ''}],
orgAccess: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/admins/:adminId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","networks":[{"access":"","id":""}],"orgAccess":"","tags":[{"access":"","tag":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"networks": @[ @{ @"access": @"", @"id": @"" } ],
@"orgAccess": @"",
@"tags": @[ @{ @"access": @"", @"tag": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/admins/:adminId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/admins/:adminId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/admins/:adminId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/admins/:adminId', [
'body' => '{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/admins/:adminId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/admins/:adminId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/admins/:adminId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/admins/:adminId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/admins/:adminId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
payload = {
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/admins/:adminId"
payload <- "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/admins/:adminId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/admins/:adminId') do |req|
req.body = "{\n \"name\": \"\",\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/admins/:adminId";
let payload = json!({
"name": "",
"networks": (
json!({
"access": "",
"id": ""
})
),
"orgAccess": "",
"tags": (
json!({
"access": "",
"tag": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/admins/:adminId \
--header 'content-type: application/json' \
--data '{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
echo '{
"name": "",
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/admins/:adminId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/admins/:adminId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"networks": [
[
"access": "",
"id": ""
]
],
"orgAccess": "",
"tags": [
[
"access": "",
"tag": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/admins/:adminId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accountStatus": "ok",
"authenticationMethod": "Email",
"email": "miles@meraki.com",
"hasApiKey": true,
"id": "212406",
"lastActive": 1526087474,
"name": "Miles Meraki",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"tags": [
{
"access": "read-only",
"tag": "west"
}
],
"twoFactorAuthEnabled": false
}
GET
Return the alert configuration for this network
{{baseUrl}}/networks/:networkId/alertSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/alertSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/alertSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/alertSettings"
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}}/networks/:networkId/alertSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/alertSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/alertSettings"
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/networks/:networkId/alertSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/alertSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/alertSettings"))
.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}}/networks/:networkId/alertSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/alertSettings")
.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}}/networks/:networkId/alertSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/alertSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/alertSettings';
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}}/networks/:networkId/alertSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/alertSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/alertSettings',
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}}/networks/:networkId/alertSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/alertSettings');
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}}/networks/:networkId/alertSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/alertSettings';
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}}/networks/:networkId/alertSettings"]
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}}/networks/:networkId/alertSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/alertSettings",
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}}/networks/:networkId/alertSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/alertSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/alertSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/alertSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/alertSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/alertSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/alertSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/alertSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/alertSettings")
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/networks/:networkId/alertSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/alertSettings";
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}}/networks/:networkId/alertSettings
http GET {{baseUrl}}/networks/:networkId/alertSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/alertSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/alertSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [
"miles@meraki.com"
],
"httpServerIds": [
"aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
],
"snmp": false
},
"enabled": true,
"filters": {
"timeout": 60
},
"type": "gatewayDown"
}
],
"defaultDestinations": {
"allAdmins": true,
"emails": [
"miles@meraki.com"
],
"httpServerIds": [
"aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
],
"snmp": true
}
}
PUT
Update the alert configuration for this network
{{baseUrl}}/networks/:networkId/alertSettings
QUERY PARAMS
networkId
BODY json
{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/alertSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/alertSettings" {:content-type :json
:form-params {:alerts [{:alertDestinations {:allAdmins false
:emails []
:httpServerIds []
:snmp false}
:enabled false
:filters {}
:type ""}]
:defaultDestinations {:allAdmins false
:emails []
:httpServerIds []
:snmp false}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/alertSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/alertSettings"),
Content = new StringContent("{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/alertSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/alertSettings"
payload := strings.NewReader("{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/alertSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 351
{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/alertSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/alertSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/alertSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/alertSettings")
.header("content-type", "application/json")
.body("{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}")
.asString();
const data = JSON.stringify({
alerts: [
{
alertDestinations: {
allAdmins: false,
emails: [],
httpServerIds: [],
snmp: false
},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {
allAdmins: false,
emails: [],
httpServerIds: [],
snmp: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/alertSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/alertSettings',
headers: {'content-type': 'application/json'},
data: {
alerts: [
{
alertDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/alertSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"alerts":[{"alertDestinations":{"allAdmins":false,"emails":[],"httpServerIds":[],"snmp":false},"enabled":false,"filters":{},"type":""}],"defaultDestinations":{"allAdmins":false,"emails":[],"httpServerIds":[],"snmp":false}}'
};
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}}/networks/:networkId/alertSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alerts": [\n {\n "alertDestinations": {\n "allAdmins": false,\n "emails": [],\n "httpServerIds": [],\n "snmp": false\n },\n "enabled": false,\n "filters": {},\n "type": ""\n }\n ],\n "defaultDestinations": {\n "allAdmins": false,\n "emails": [],\n "httpServerIds": [],\n "snmp": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/alertSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/alertSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
alerts: [
{
alertDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/alertSettings',
headers: {'content-type': 'application/json'},
body: {
alerts: [
{
alertDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/alertSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alerts: [
{
alertDestinations: {
allAdmins: false,
emails: [],
httpServerIds: [],
snmp: false
},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {
allAdmins: false,
emails: [],
httpServerIds: [],
snmp: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/alertSettings',
headers: {'content-type': 'application/json'},
data: {
alerts: [
{
alertDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false},
enabled: false,
filters: {},
type: ''
}
],
defaultDestinations: {allAdmins: false, emails: [], httpServerIds: [], snmp: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/alertSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"alerts":[{"alertDestinations":{"allAdmins":false,"emails":[],"httpServerIds":[],"snmp":false},"enabled":false,"filters":{},"type":""}],"defaultDestinations":{"allAdmins":false,"emails":[],"httpServerIds":[],"snmp":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"alerts": @[ @{ @"alertDestinations": @{ @"allAdmins": @NO, @"emails": @[ ], @"httpServerIds": @[ ], @"snmp": @NO }, @"enabled": @NO, @"filters": @{ }, @"type": @"" } ],
@"defaultDestinations": @{ @"allAdmins": @NO, @"emails": @[ ], @"httpServerIds": @[ ], @"snmp": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/alertSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/alertSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/alertSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'alerts' => [
[
'alertDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
],
'enabled' => null,
'filters' => [
],
'type' => ''
]
],
'defaultDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/alertSettings', [
'body' => '{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/alertSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alerts' => [
[
'alertDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
],
'enabled' => null,
'filters' => [
],
'type' => ''
]
],
'defaultDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alerts' => [
[
'alertDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
],
'enabled' => null,
'filters' => [
],
'type' => ''
]
],
'defaultDestinations' => [
'allAdmins' => null,
'emails' => [
],
'httpServerIds' => [
],
'snmp' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/alertSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/alertSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/alertSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/alertSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/alertSettings"
payload = {
"alerts": [
{
"alertDestinations": {
"allAdmins": False,
"emails": [],
"httpServerIds": [],
"snmp": False
},
"enabled": False,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": False,
"emails": [],
"httpServerIds": [],
"snmp": False
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/alertSettings"
payload <- "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/alertSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/alertSettings') do |req|
req.body = "{\n \"alerts\": [\n {\n \"alertDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n },\n \"enabled\": false,\n \"filters\": {},\n \"type\": \"\"\n }\n ],\n \"defaultDestinations\": {\n \"allAdmins\": false,\n \"emails\": [],\n \"httpServerIds\": [],\n \"snmp\": false\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/alertSettings";
let payload = json!({
"alerts": (
json!({
"alertDestinations": json!({
"allAdmins": false,
"emails": (),
"httpServerIds": (),
"snmp": false
}),
"enabled": false,
"filters": json!({}),
"type": ""
})
),
"defaultDestinations": json!({
"allAdmins": false,
"emails": (),
"httpServerIds": (),
"snmp": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/alertSettings \
--header 'content-type: application/json' \
--data '{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}'
echo '{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
},
"enabled": false,
"filters": {},
"type": ""
}
],
"defaultDestinations": {
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/alertSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "alerts": [\n {\n "alertDestinations": {\n "allAdmins": false,\n "emails": [],\n "httpServerIds": [],\n "snmp": false\n },\n "enabled": false,\n "filters": {},\n "type": ""\n }\n ],\n "defaultDestinations": {\n "allAdmins": false,\n "emails": [],\n "httpServerIds": [],\n "snmp": false\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/alertSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alerts": [
[
"alertDestinations": [
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
],
"enabled": false,
"filters": [],
"type": ""
]
],
"defaultDestinations": [
"allAdmins": false,
"emails": [],
"httpServerIds": [],
"snmp": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/alertSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"alerts": [
{
"alertDestinations": {
"allAdmins": false,
"emails": [
"miles@meraki.com"
],
"httpServerIds": [
"aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
],
"snmp": false
},
"enabled": true,
"filters": {
"timeout": 60
},
"type": "gatewayDown"
}
],
"defaultDestinations": {
"allAdmins": true,
"emails": [
"miles@meraki.com"
],
"httpServerIds": [
"aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
],
"snmp": true
}
}
GET
List the API requests made by an organization
{{baseUrl}}/organizations/:organizationId/apiRequests
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/apiRequests");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/apiRequests")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/apiRequests"
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}}/organizations/:organizationId/apiRequests"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/apiRequests");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/apiRequests"
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/organizations/:organizationId/apiRequests HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/apiRequests")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/apiRequests"))
.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}}/organizations/:organizationId/apiRequests")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/apiRequests")
.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}}/organizations/:organizationId/apiRequests');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/apiRequests'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/apiRequests';
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}}/organizations/:organizationId/apiRequests',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/apiRequests")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/apiRequests',
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}}/organizations/:organizationId/apiRequests'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/apiRequests');
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}}/organizations/:organizationId/apiRequests'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/apiRequests';
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}}/organizations/:organizationId/apiRequests"]
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}}/organizations/:organizationId/apiRequests" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/apiRequests",
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}}/organizations/:organizationId/apiRequests');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/apiRequests');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/apiRequests');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/apiRequests' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/apiRequests' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/apiRequests")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/apiRequests"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/apiRequests"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/apiRequests")
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/organizations/:organizationId/apiRequests') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/apiRequests";
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}}/organizations/:organizationId/apiRequests
http GET {{baseUrl}}/organizations/:organizationId/apiRequests
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/apiRequests
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/apiRequests")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"adminId": "212406",
"host": "api.meraki.com",
"method": "GET",
"path": "/api/v0/organizations/33349/apiRequests",
"queryString": "timespan=604800",
"responseCode": 200,
"sourceIp": "123.123.123.1",
"ts": "2019-02-20T17:31:23Z",
"userAgent": "PostmanRuntime/7.6.0"
}
]
GET
Return an aggregated overview of API requests data
{{baseUrl}}/organizations/:organizationId/apiRequests/overview
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/apiRequests/overview");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/apiRequests/overview")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/apiRequests/overview"
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}}/organizations/:organizationId/apiRequests/overview"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/apiRequests/overview");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/apiRequests/overview"
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/organizations/:organizationId/apiRequests/overview HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/apiRequests/overview")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/apiRequests/overview"))
.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}}/organizations/:organizationId/apiRequests/overview")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/apiRequests/overview")
.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}}/organizations/:organizationId/apiRequests/overview');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/apiRequests/overview'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/apiRequests/overview';
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}}/organizations/:organizationId/apiRequests/overview',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/apiRequests/overview")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/apiRequests/overview',
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}}/organizations/:organizationId/apiRequests/overview'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/apiRequests/overview');
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}}/organizations/:organizationId/apiRequests/overview'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/apiRequests/overview';
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}}/organizations/:organizationId/apiRequests/overview"]
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}}/organizations/:organizationId/apiRequests/overview" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/apiRequests/overview",
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}}/organizations/:organizationId/apiRequests/overview');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/apiRequests/overview');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/apiRequests/overview');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/apiRequests/overview' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/apiRequests/overview' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/apiRequests/overview")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/apiRequests/overview"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/apiRequests/overview"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/apiRequests/overview")
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/organizations/:organizationId/apiRequests/overview') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/apiRequests/overview";
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}}/organizations/:organizationId/apiRequests/overview
http GET {{baseUrl}}/organizations/:organizationId/apiRequests/overview
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/apiRequests/overview
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/apiRequests/overview")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"responseCodeCounts": {
"200": 50000,
"201": 4000,
"204": 1000,
"400": 3500,
"404": 1500,
"429": 10000
}
}
GET
List the Bluetooth clients seen by APs in this network
{{baseUrl}}/networks/:networkId/bluetoothClients
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/bluetoothClients");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/bluetoothClients")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/bluetoothClients"
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}}/networks/:networkId/bluetoothClients"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/bluetoothClients");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/bluetoothClients"
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/networks/:networkId/bluetoothClients HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/bluetoothClients")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/bluetoothClients"))
.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}}/networks/:networkId/bluetoothClients")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/bluetoothClients")
.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}}/networks/:networkId/bluetoothClients');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/bluetoothClients'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/bluetoothClients';
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}}/networks/:networkId/bluetoothClients',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bluetoothClients")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/bluetoothClients',
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}}/networks/:networkId/bluetoothClients'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/bluetoothClients');
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}}/networks/:networkId/bluetoothClients'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/bluetoothClients';
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}}/networks/:networkId/bluetoothClients"]
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}}/networks/:networkId/bluetoothClients" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/bluetoothClients",
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}}/networks/:networkId/bluetoothClients');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/bluetoothClients');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/bluetoothClients');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/bluetoothClients' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/bluetoothClients' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/bluetoothClients")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/bluetoothClients"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/bluetoothClients"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/bluetoothClients")
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/networks/:networkId/bluetoothClients') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/bluetoothClients";
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}}/networks/:networkId/bluetoothClients
http GET {{baseUrl}}/networks/:networkId/bluetoothClients
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/bluetoothClients
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/bluetoothClients")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"deviceName": "Bose QuietComfort 35",
"id": "1284392014819",
"inSightAlert": false,
"lastSeen": 1526087474,
"mac": "22:33:44:55:66:77",
"manufacturer": "Bose",
"name": "Miles's phone",
"networkId": "N_24329156",
"outOfSightAlert": false,
"seenByDeviceMac": "00:11:22:33:44:55",
"tags": [
"tag1",
"tag2"
]
}
]
GET
Return a Bluetooth client
{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId
QUERY PARAMS
networkId
bluetoothClientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId"
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId"
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/networks/:networkId/bluetoothClients/:bluetoothClientId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId"))
.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}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
.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}}/networks/:networkId/bluetoothClients/:bluetoothClientId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId';
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/bluetoothClients/:bluetoothClientId',
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId');
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId';
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId"]
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId",
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/bluetoothClients/:bluetoothClientId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")
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/networks/:networkId/bluetoothClients/:bluetoothClientId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId";
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}}/networks/:networkId/bluetoothClients/:bluetoothClientId
http GET {{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/bluetoothClients/:bluetoothClientId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"deviceName": "Bose QuietComfort 35",
"id": "1284392014819",
"inSightAlert": false,
"lastSeen": 1526087474,
"mac": "22:33:44:55:66:77",
"manufacturer": "Bose",
"name": "Miles's phone",
"networkId": "N_24329156",
"outOfSightAlert": false,
"seenByDeviceMac": "00:11:22:33:44:55",
"tags": [
"tag1",
"tag2"
]
}
GET
Return the Bluetooth settings for a network. -a href=-https---documentation.meraki.com-MR-Bluetooth-Bluetooth_Low_Energy_(BLE)--Bluetooth settings--a- must be enabled on the network.
{{baseUrl}}/networks/:networkId/bluetoothSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/bluetoothSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/bluetoothSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/bluetoothSettings"
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}}/networks/:networkId/bluetoothSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/bluetoothSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/bluetoothSettings"
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/networks/:networkId/bluetoothSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/bluetoothSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/bluetoothSettings"))
.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}}/networks/:networkId/bluetoothSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/bluetoothSettings")
.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}}/networks/:networkId/bluetoothSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/bluetoothSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/bluetoothSettings';
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}}/networks/:networkId/bluetoothSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bluetoothSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/bluetoothSettings',
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}}/networks/:networkId/bluetoothSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/bluetoothSettings');
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}}/networks/:networkId/bluetoothSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/bluetoothSettings';
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}}/networks/:networkId/bluetoothSettings"]
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}}/networks/:networkId/bluetoothSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/bluetoothSettings",
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}}/networks/:networkId/bluetoothSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/bluetoothSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/bluetoothSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/bluetoothSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/bluetoothSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/bluetoothSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/bluetoothSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/bluetoothSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/bluetoothSettings")
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/networks/:networkId/bluetoothSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/bluetoothSettings";
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}}/networks/:networkId/bluetoothSettings
http GET {{baseUrl}}/networks/:networkId/bluetoothSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/bluetoothSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/bluetoothSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"advertisingEnabled": true,
"major": 1,
"majorMinorAssignmentMode": "Non-unique",
"minor": 1,
"scanningEnabled": true,
"uuid": "00000000-0000-0000-000-000000000000"
}
PUT
Update the Bluetooth settings for a network
{{baseUrl}}/networks/:networkId/bluetoothSettings
QUERY PARAMS
networkId
BODY json
{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/bluetoothSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/bluetoothSettings" {:content-type :json
:form-params {:advertisingEnabled false
:major 0
:majorMinorAssignmentMode ""
:minor 0
:scanningEnabled false
:uuid ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/bluetoothSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/bluetoothSettings"),
Content = new StringContent("{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/bluetoothSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/bluetoothSettings"
payload := strings.NewReader("{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/bluetoothSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 137
{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/bluetoothSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/bluetoothSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bluetoothSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/bluetoothSettings")
.header("content-type", "application/json")
.body("{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}")
.asString();
const data = JSON.stringify({
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/bluetoothSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/bluetoothSettings',
headers: {'content-type': 'application/json'},
data: {
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/bluetoothSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"advertisingEnabled":false,"major":0,"majorMinorAssignmentMode":"","minor":0,"scanningEnabled":false,"uuid":""}'
};
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}}/networks/:networkId/bluetoothSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "advertisingEnabled": false,\n "major": 0,\n "majorMinorAssignmentMode": "",\n "minor": 0,\n "scanningEnabled": false,\n "uuid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bluetoothSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/bluetoothSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/bluetoothSettings',
headers: {'content-type': 'application/json'},
body: {
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/bluetoothSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/bluetoothSettings',
headers: {'content-type': 'application/json'},
data: {
advertisingEnabled: false,
major: 0,
majorMinorAssignmentMode: '',
minor: 0,
scanningEnabled: false,
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/bluetoothSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"advertisingEnabled":false,"major":0,"majorMinorAssignmentMode":"","minor":0,"scanningEnabled":false,"uuid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"advertisingEnabled": @NO,
@"major": @0,
@"majorMinorAssignmentMode": @"",
@"minor": @0,
@"scanningEnabled": @NO,
@"uuid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/bluetoothSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/bluetoothSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/bluetoothSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'advertisingEnabled' => null,
'major' => 0,
'majorMinorAssignmentMode' => '',
'minor' => 0,
'scanningEnabled' => null,
'uuid' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/bluetoothSettings', [
'body' => '{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/bluetoothSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'advertisingEnabled' => null,
'major' => 0,
'majorMinorAssignmentMode' => '',
'minor' => 0,
'scanningEnabled' => null,
'uuid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'advertisingEnabled' => null,
'major' => 0,
'majorMinorAssignmentMode' => '',
'minor' => 0,
'scanningEnabled' => null,
'uuid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/bluetoothSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/bluetoothSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/bluetoothSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/bluetoothSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/bluetoothSettings"
payload = {
"advertisingEnabled": False,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": False,
"uuid": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/bluetoothSettings"
payload <- "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/bluetoothSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/bluetoothSettings') do |req|
req.body = "{\n \"advertisingEnabled\": false,\n \"major\": 0,\n \"majorMinorAssignmentMode\": \"\",\n \"minor\": 0,\n \"scanningEnabled\": false,\n \"uuid\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/bluetoothSettings";
let payload = json!({
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/bluetoothSettings \
--header 'content-type: application/json' \
--data '{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}'
echo '{
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/bluetoothSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "advertisingEnabled": false,\n "major": 0,\n "majorMinorAssignmentMode": "",\n "minor": 0,\n "scanningEnabled": false,\n "uuid": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/bluetoothSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"advertisingEnabled": false,
"major": 0,
"majorMinorAssignmentMode": "",
"minor": 0,
"scanningEnabled": false,
"uuid": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/bluetoothSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"advertisingEnabled": true,
"major": 1,
"majorMinorAssignmentMode": "Non-unique",
"minor": 1,
"scanningEnabled": true,
"uuid": "00000000-0000-0000-000-000000000000"
}
PUT
Update the bluetooth settings for a wireless device
{{baseUrl}}/devices/:serial/wireless/bluetooth/settings
QUERY PARAMS
serial
BODY json
{
"major": 0,
"minor": 0,
"uuid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings" {:content-type :json
:form-params {:major 0
:minor 0
:uuid ""}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"),
Content = new StringContent("{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"
payload := strings.NewReader("{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/devices/:serial/wireless/bluetooth/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"major": 0,
"minor": 0,
"uuid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")
.header("content-type", "application/json")
.body("{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}")
.asString();
const data = JSON.stringify({
major: 0,
minor: 0,
uuid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings',
headers: {'content-type': 'application/json'},
data: {major: 0, minor: 0, uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"major":0,"minor":0,"uuid":""}'
};
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}}/devices/:serial/wireless/bluetooth/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "major": 0,\n "minor": 0,\n "uuid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/wireless/bluetooth/settings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({major: 0, minor: 0, uuid: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings',
headers: {'content-type': 'application/json'},
body: {major: 0, minor: 0, uuid: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
major: 0,
minor: 0,
uuid: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings',
headers: {'content-type': 'application/json'},
data: {major: 0, minor: 0, uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"major":0,"minor":0,"uuid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"major": @0,
@"minor": @0,
@"uuid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/wireless/bluetooth/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'major' => 0,
'minor' => 0,
'uuid' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings', [
'body' => '{
"major": 0,
"minor": 0,
"uuid": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/wireless/bluetooth/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'major' => 0,
'minor' => 0,
'uuid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'major' => 0,
'minor' => 0,
'uuid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/wireless/bluetooth/settings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"major": 0,
"minor": 0,
"uuid": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/wireless/bluetooth/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"major": 0,
"minor": 0,
"uuid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/devices/:serial/wireless/bluetooth/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"
payload = {
"major": 0,
"minor": 0,
"uuid": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings"
payload <- "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/devices/:serial/wireless/bluetooth/settings') do |req|
req.body = "{\n \"major\": 0,\n \"minor\": 0,\n \"uuid\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings";
let payload = json!({
"major": 0,
"minor": 0,
"uuid": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/devices/:serial/wireless/bluetooth/settings \
--header 'content-type: application/json' \
--data '{
"major": 0,
"minor": 0,
"uuid": ""
}'
echo '{
"major": 0,
"minor": 0,
"uuid": ""
}' | \
http PUT {{baseUrl}}/devices/:serial/wireless/bluetooth/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "major": 0,\n "minor": 0,\n "uuid": ""\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/wireless/bluetooth/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"major": 0,
"minor": 0,
"uuid": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/wireless/bluetooth/settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"major": 13,
"minor": 125,
"uuid": "00000000-0000-0000-000-000000000000"
}
POST
Creates new quality retention profile for this network.
{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles
QUERY PARAMS
networkId
BODY json
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles" {:content-type :json
:form-params {:audioRecordingEnabled false
:cloudArchiveEnabled false
:maxRetentionDays 0
:motionBasedRetentionEnabled false
:motionDetectorVersion 0
:name ""
:restrictedBandwidthModeEnabled false
:scheduleId ""
:videoSettings {:MV12/MV22/MV72 {:quality ""
:resolution ""}
:MV12WE {:quality ""
:resolution ""}
:MV13 {:quality ""
:resolution ""}
:MV21/MV71 {:quality ""
:resolution ""}
:MV22X/MV72X {:quality ""
:resolution ""}
:MV32 {:quality ""
:resolution ""}
:MV33 {:quality ""
:resolution ""}
:MV52 {:quality ""
:resolution ""}
:MV63 {:quality ""
:resolution ""}
:MV63X {:quality ""
:resolution ""}
:MV93 {:quality ""
:resolution ""}
:MV93X {:quality ""
:resolution ""}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"),
Content = new StringContent("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
payload := strings.NewReader("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/camera/qualityRetentionProfiles HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1071
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.setHeader("content-type", "application/json")
.setBody("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.header("content-type", "application/json")
.body("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {
quality: '',
resolution: ''
},
MV12WE: {
quality: '',
resolution: ''
},
MV13: {
quality: '',
resolution: ''
},
'MV21/MV71': {
quality: '',
resolution: ''
},
'MV22X/MV72X': {
quality: '',
resolution: ''
},
MV32: {
quality: '',
resolution: ''
},
MV33: {
quality: '',
resolution: ''
},
MV52: {
quality: '',
resolution: ''
},
MV63: {
quality: '',
resolution: ''
},
MV63X: {
quality: '',
resolution: ''
},
MV93: {
quality: '',
resolution: ''
},
MV93X: {
quality: '',
resolution: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"cloudArchiveEnabled":false,"maxRetentionDays":0,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"name":"","restrictedBandwidthModeEnabled":false,"scheduleId":"","videoSettings":{"MV12/MV22/MV72":{"quality":"","resolution":""},"MV12WE":{"quality":"","resolution":""},"MV13":{"quality":"","resolution":""},"MV21/MV71":{"quality":"","resolution":""},"MV22X/MV72X":{"quality":"","resolution":""},"MV32":{"quality":"","resolution":""},"MV33":{"quality":"","resolution":""},"MV52":{"quality":"","resolution":""},"MV63":{"quality":"","resolution":""},"MV63X":{"quality":"","resolution":""},"MV93":{"quality":"","resolution":""},"MV93X":{"quality":"","resolution":""}}}'
};
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}}/networks/:networkId/camera/qualityRetentionProfiles',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "audioRecordingEnabled": false,\n "cloudArchiveEnabled": false,\n "maxRetentionDays": 0,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "name": "",\n "restrictedBandwidthModeEnabled": false,\n "scheduleId": "",\n "videoSettings": {\n "MV12/MV22/MV72": {\n "quality": "",\n "resolution": ""\n },\n "MV12WE": {\n "quality": "",\n "resolution": ""\n },\n "MV13": {\n "quality": "",\n "resolution": ""\n },\n "MV21/MV71": {\n "quality": "",\n "resolution": ""\n },\n "MV22X/MV72X": {\n "quality": "",\n "resolution": ""\n },\n "MV32": {\n "quality": "",\n "resolution": ""\n },\n "MV33": {\n "quality": "",\n "resolution": ""\n },\n "MV52": {\n "quality": "",\n "resolution": ""\n },\n "MV63": {\n "quality": "",\n "resolution": ""\n },\n "MV63X": {\n "quality": "",\n "resolution": ""\n },\n "MV93": {\n "quality": "",\n "resolution": ""\n },\n "MV93X": {\n "quality": "",\n "resolution": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/qualityRetentionProfiles',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles',
headers: {'content-type': 'application/json'},
body: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {
quality: '',
resolution: ''
},
MV12WE: {
quality: '',
resolution: ''
},
MV13: {
quality: '',
resolution: ''
},
'MV21/MV71': {
quality: '',
resolution: ''
},
'MV22X/MV72X': {
quality: '',
resolution: ''
},
MV32: {
quality: '',
resolution: ''
},
MV33: {
quality: '',
resolution: ''
},
MV52: {
quality: '',
resolution: ''
},
MV63: {
quality: '',
resolution: ''
},
MV63X: {
quality: '',
resolution: ''
},
MV93: {
quality: '',
resolution: ''
},
MV93X: {
quality: '',
resolution: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"cloudArchiveEnabled":false,"maxRetentionDays":0,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"name":"","restrictedBandwidthModeEnabled":false,"scheduleId":"","videoSettings":{"MV12/MV22/MV72":{"quality":"","resolution":""},"MV12WE":{"quality":"","resolution":""},"MV13":{"quality":"","resolution":""},"MV21/MV71":{"quality":"","resolution":""},"MV22X/MV72X":{"quality":"","resolution":""},"MV32":{"quality":"","resolution":""},"MV33":{"quality":"","resolution":""},"MV52":{"quality":"","resolution":""},"MV63":{"quality":"","resolution":""},"MV63X":{"quality":"","resolution":""},"MV93":{"quality":"","resolution":""},"MV93X":{"quality":"","resolution":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"audioRecordingEnabled": @NO,
@"cloudArchiveEnabled": @NO,
@"maxRetentionDays": @0,
@"motionBasedRetentionEnabled": @NO,
@"motionDetectorVersion": @0,
@"name": @"",
@"restrictedBandwidthModeEnabled": @NO,
@"scheduleId": @"",
@"videoSettings": @{ @"MV12/MV22/MV72": @{ @"quality": @"", @"resolution": @"" }, @"MV12WE": @{ @"quality": @"", @"resolution": @"" }, @"MV13": @{ @"quality": @"", @"resolution": @"" }, @"MV21/MV71": @{ @"quality": @"", @"resolution": @"" }, @"MV22X/MV72X": @{ @"quality": @"", @"resolution": @"" }, @"MV32": @{ @"quality": @"", @"resolution": @"" }, @"MV33": @{ @"quality": @"", @"resolution": @"" }, @"MV52": @{ @"quality": @"", @"resolution": @"" }, @"MV63": @{ @"quality": @"", @"resolution": @"" }, @"MV63X": @{ @"quality": @"", @"resolution": @"" }, @"MV93": @{ @"quality": @"", @"resolution": @"" }, @"MV93X": @{ @"quality": @"", @"resolution": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"]
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}}/networks/:networkId/camera/qualityRetentionProfiles" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles', [
'body' => '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/camera/qualityRetentionProfiles", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
payload = {
"audioRecordingEnabled": False,
"cloudArchiveEnabled": False,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": False,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": False,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
payload <- "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/camera/qualityRetentionProfiles') do |req|
req.body = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles";
let payload = json!({
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": json!({
"MV12/MV22/MV72": json!({
"quality": "",
"resolution": ""
}),
"MV12WE": json!({
"quality": "",
"resolution": ""
}),
"MV13": json!({
"quality": "",
"resolution": ""
}),
"MV21/MV71": json!({
"quality": "",
"resolution": ""
}),
"MV22X/MV72X": json!({
"quality": "",
"resolution": ""
}),
"MV32": json!({
"quality": "",
"resolution": ""
}),
"MV33": json!({
"quality": "",
"resolution": ""
}),
"MV52": json!({
"quality": "",
"resolution": ""
}),
"MV63": json!({
"quality": "",
"resolution": ""
}),
"MV63X": json!({
"quality": "",
"resolution": ""
}),
"MV93": json!({
"quality": "",
"resolution": ""
}),
"MV93X": json!({
"quality": "",
"resolution": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles \
--header 'content-type: application/json' \
--data '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
echo '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}' | \
http POST {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "audioRecordingEnabled": false,\n "cloudArchiveEnabled": false,\n "maxRetentionDays": 0,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "name": "",\n "restrictedBandwidthModeEnabled": false,\n "scheduleId": "",\n "videoSettings": {\n "MV12/MV22/MV72": {\n "quality": "",\n "resolution": ""\n },\n "MV12WE": {\n "quality": "",\n "resolution": ""\n },\n "MV13": {\n "quality": "",\n "resolution": ""\n },\n "MV21/MV71": {\n "quality": "",\n "resolution": ""\n },\n "MV22X/MV72X": {\n "quality": "",\n "resolution": ""\n },\n "MV32": {\n "quality": "",\n "resolution": ""\n },\n "MV33": {\n "quality": "",\n "resolution": ""\n },\n "MV52": {\n "quality": "",\n "resolution": ""\n },\n "MV63": {\n "quality": "",\n "resolution": ""\n },\n "MV63X": {\n "quality": "",\n "resolution": ""\n },\n "MV93": {\n "quality": "",\n "resolution": ""\n },\n "MV93X": {\n "quality": "",\n "resolution": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": [
"MV12/MV22/MV72": [
"quality": "",
"resolution": ""
],
"MV12WE": [
"quality": "",
"resolution": ""
],
"MV13": [
"quality": "",
"resolution": ""
],
"MV21/MV71": [
"quality": "",
"resolution": ""
],
"MV22X/MV72X": [
"quality": "",
"resolution": ""
],
"MV32": [
"quality": "",
"resolution": ""
],
"MV33": [
"quality": "",
"resolution": ""
],
"MV52": [
"quality": "",
"resolution": ""
],
"MV63": [
"quality": "",
"resolution": ""
],
"MV63X": [
"quality": "",
"resolution": ""
],
"MV93": [
"quality": "",
"resolution": ""
],
"MV93X": [
"quality": "",
"resolution": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"id": "1234",
"maxRetentionDays": 7,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"name": "Sample quality retention profile",
"networkId": "N_24329156",
"restrictedBandwidthModeEnabled": true,
"scheduleId": null,
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "High",
"resolution": "1920x1080"
},
"MV12WE": {
"quality": "High",
"resolution": "1920x1080"
},
"MV21/MV71": {
"quality": "High",
"resolution": "1280x720"
},
"MV32": {
"quality": "Enhanced",
"resolution": "1080x1080"
}
}
}
DELETE
Delete an existing quality retention profile for this network.
{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
QUERY PARAMS
networkId
qualityRetentionProfileId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
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/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"))
.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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"]
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId",
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
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/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId";
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
http DELETE {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")! 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
List the quality retention profiles for this network
{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
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}}/networks/:networkId/camera/qualityRetentionProfiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
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/networks/:networkId/camera/qualityRetentionProfiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"))
.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}}/networks/:networkId/camera/qualityRetentionProfiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.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}}/networks/:networkId/camera/qualityRetentionProfiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles';
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}}/networks/:networkId/camera/qualityRetentionProfiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/qualityRetentionProfiles',
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}}/networks/:networkId/camera/qualityRetentionProfiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
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}}/networks/:networkId/camera/qualityRetentionProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles';
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}}/networks/:networkId/camera/qualityRetentionProfiles"]
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}}/networks/:networkId/camera/qualityRetentionProfiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles",
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}}/networks/:networkId/camera/qualityRetentionProfiles');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/camera/qualityRetentionProfiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")
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/networks/:networkId/camera/qualityRetentionProfiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles";
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}}/networks/:networkId/camera/qualityRetentionProfiles
http GET {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"id": "1234",
"maxRetentionDays": 7,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"name": "Sample quality retention profile",
"networkId": "N_24329156",
"restrictedBandwidthModeEnabled": true,
"scheduleId": null,
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "High",
"resolution": "1920x1080"
},
"MV12WE": {
"quality": "High",
"resolution": "1920x1080"
},
"MV21/MV71": {
"quality": "High",
"resolution": "1280x720"
},
"MV32": {
"quality": "Enhanced",
"resolution": "1080x1080"
}
}
}
]
GET
Retrieve a single quality retention profile
{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
QUERY PARAMS
networkId
qualityRetentionProfileId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
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/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"))
.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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"]
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId",
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
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/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId";
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
http GET {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"id": "1234",
"maxRetentionDays": 7,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"name": "Sample quality retention profile",
"networkId": "N_24329156",
"restrictedBandwidthModeEnabled": true,
"scheduleId": null,
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "High",
"resolution": "1920x1080"
},
"MV12WE": {
"quality": "High",
"resolution": "1920x1080"
},
"MV21/MV71": {
"quality": "High",
"resolution": "1280x720"
},
"MV32": {
"quality": "Enhanced",
"resolution": "1080x1080"
}
}
}
PUT
Update an existing quality retention profile for this network.
{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
QUERY PARAMS
networkId
qualityRetentionProfileId
BODY json
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId" {:content-type :json
:form-params {:audioRecordingEnabled false
:cloudArchiveEnabled false
:maxRetentionDays 0
:motionBasedRetentionEnabled false
:motionDetectorVersion 0
:name ""
:restrictedBandwidthModeEnabled false
:scheduleId ""
:videoSettings {:MV12/MV22/MV72 {:quality ""
:resolution ""}
:MV12WE {:quality ""
:resolution ""}
:MV13 {:quality ""
:resolution ""}
:MV21/MV71 {:quality ""
:resolution ""}
:MV22X/MV72X {:quality ""
:resolution ""}
:MV32 {:quality ""
:resolution ""}
:MV33 {:quality ""
:resolution ""}
:MV52 {:quality ""
:resolution ""}
:MV63 {:quality ""
:resolution ""}
:MV63X {:quality ""
:resolution ""}
:MV93 {:quality ""
:resolution ""}
:MV93X {:quality ""
:resolution ""}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"),
Content = new StringContent("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
payload := strings.NewReader("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1071
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.setHeader("content-type", "application/json")
.setBody("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.header("content-type", "application/json")
.body("{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {
quality: '',
resolution: ''
},
MV12WE: {
quality: '',
resolution: ''
},
MV13: {
quality: '',
resolution: ''
},
'MV21/MV71': {
quality: '',
resolution: ''
},
'MV22X/MV72X': {
quality: '',
resolution: ''
},
MV32: {
quality: '',
resolution: ''
},
MV33: {
quality: '',
resolution: ''
},
MV52: {
quality: '',
resolution: ''
},
MV63: {
quality: '',
resolution: ''
},
MV63X: {
quality: '',
resolution: ''
},
MV93: {
quality: '',
resolution: ''
},
MV93X: {
quality: '',
resolution: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"cloudArchiveEnabled":false,"maxRetentionDays":0,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"name":"","restrictedBandwidthModeEnabled":false,"scheduleId":"","videoSettings":{"MV12/MV22/MV72":{"quality":"","resolution":""},"MV12WE":{"quality":"","resolution":""},"MV13":{"quality":"","resolution":""},"MV21/MV71":{"quality":"","resolution":""},"MV22X/MV72X":{"quality":"","resolution":""},"MV32":{"quality":"","resolution":""},"MV33":{"quality":"","resolution":""},"MV52":{"quality":"","resolution":""},"MV63":{"quality":"","resolution":""},"MV63X":{"quality":"","resolution":""},"MV93":{"quality":"","resolution":""},"MV93X":{"quality":"","resolution":""}}}'
};
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}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "audioRecordingEnabled": false,\n "cloudArchiveEnabled": false,\n "maxRetentionDays": 0,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "name": "",\n "restrictedBandwidthModeEnabled": false,\n "scheduleId": "",\n "videoSettings": {\n "MV12/MV22/MV72": {\n "quality": "",\n "resolution": ""\n },\n "MV12WE": {\n "quality": "",\n "resolution": ""\n },\n "MV13": {\n "quality": "",\n "resolution": ""\n },\n "MV21/MV71": {\n "quality": "",\n "resolution": ""\n },\n "MV22X/MV72X": {\n "quality": "",\n "resolution": ""\n },\n "MV32": {\n "quality": "",\n "resolution": ""\n },\n "MV33": {\n "quality": "",\n "resolution": ""\n },\n "MV52": {\n "quality": "",\n "resolution": ""\n },\n "MV63": {\n "quality": "",\n "resolution": ""\n },\n "MV63X": {\n "quality": "",\n "resolution": ""\n },\n "MV93": {\n "quality": "",\n "resolution": ""\n },\n "MV93X": {\n "quality": "",\n "resolution": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
headers: {'content-type': 'application/json'},
body: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {
quality: '',
resolution: ''
},
MV12WE: {
quality: '',
resolution: ''
},
MV13: {
quality: '',
resolution: ''
},
'MV21/MV71': {
quality: '',
resolution: ''
},
'MV22X/MV72X': {
quality: '',
resolution: ''
},
MV32: {
quality: '',
resolution: ''
},
MV33: {
quality: '',
resolution: ''
},
MV52: {
quality: '',
resolution: ''
},
MV63: {
quality: '',
resolution: ''
},
MV63X: {
quality: '',
resolution: ''
},
MV93: {
quality: '',
resolution: ''
},
MV93X: {
quality: '',
resolution: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
cloudArchiveEnabled: false,
maxRetentionDays: 0,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
name: '',
restrictedBandwidthModeEnabled: false,
scheduleId: '',
videoSettings: {
'MV12/MV22/MV72': {quality: '', resolution: ''},
MV12WE: {quality: '', resolution: ''},
MV13: {quality: '', resolution: ''},
'MV21/MV71': {quality: '', resolution: ''},
'MV22X/MV72X': {quality: '', resolution: ''},
MV32: {quality: '', resolution: ''},
MV33: {quality: '', resolution: ''},
MV52: {quality: '', resolution: ''},
MV63: {quality: '', resolution: ''},
MV63X: {quality: '', resolution: ''},
MV93: {quality: '', resolution: ''},
MV93X: {quality: '', resolution: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"cloudArchiveEnabled":false,"maxRetentionDays":0,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"name":"","restrictedBandwidthModeEnabled":false,"scheduleId":"","videoSettings":{"MV12/MV22/MV72":{"quality":"","resolution":""},"MV12WE":{"quality":"","resolution":""},"MV13":{"quality":"","resolution":""},"MV21/MV71":{"quality":"","resolution":""},"MV22X/MV72X":{"quality":"","resolution":""},"MV32":{"quality":"","resolution":""},"MV33":{"quality":"","resolution":""},"MV52":{"quality":"","resolution":""},"MV63":{"quality":"","resolution":""},"MV63X":{"quality":"","resolution":""},"MV93":{"quality":"","resolution":""},"MV93X":{"quality":"","resolution":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"audioRecordingEnabled": @NO,
@"cloudArchiveEnabled": @NO,
@"maxRetentionDays": @0,
@"motionBasedRetentionEnabled": @NO,
@"motionDetectorVersion": @0,
@"name": @"",
@"restrictedBandwidthModeEnabled": @NO,
@"scheduleId": @"",
@"videoSettings": @{ @"MV12/MV22/MV72": @{ @"quality": @"", @"resolution": @"" }, @"MV12WE": @{ @"quality": @"", @"resolution": @"" }, @"MV13": @{ @"quality": @"", @"resolution": @"" }, @"MV21/MV71": @{ @"quality": @"", @"resolution": @"" }, @"MV22X/MV72X": @{ @"quality": @"", @"resolution": @"" }, @"MV32": @{ @"quality": @"", @"resolution": @"" }, @"MV33": @{ @"quality": @"", @"resolution": @"" }, @"MV52": @{ @"quality": @"", @"resolution": @"" }, @"MV63": @{ @"quality": @"", @"resolution": @"" }, @"MV63X": @{ @"quality": @"", @"resolution": @"" }, @"MV93": @{ @"quality": @"", @"resolution": @"" }, @"MV93X": @{ @"quality": @"", @"resolution": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId', [
'body' => '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'audioRecordingEnabled' => null,
'cloudArchiveEnabled' => null,
'maxRetentionDays' => 0,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'name' => '',
'restrictedBandwidthModeEnabled' => null,
'scheduleId' => '',
'videoSettings' => [
'MV12/MV22/MV72' => [
'quality' => '',
'resolution' => ''
],
'MV12WE' => [
'quality' => '',
'resolution' => ''
],
'MV13' => [
'quality' => '',
'resolution' => ''
],
'MV21/MV71' => [
'quality' => '',
'resolution' => ''
],
'MV22X/MV72X' => [
'quality' => '',
'resolution' => ''
],
'MV32' => [
'quality' => '',
'resolution' => ''
],
'MV33' => [
'quality' => '',
'resolution' => ''
],
'MV52' => [
'quality' => '',
'resolution' => ''
],
'MV63' => [
'quality' => '',
'resolution' => ''
],
'MV63X' => [
'quality' => '',
'resolution' => ''
],
'MV93' => [
'quality' => '',
'resolution' => ''
],
'MV93X' => [
'quality' => '',
'resolution' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
payload = {
"audioRecordingEnabled": False,
"cloudArchiveEnabled": False,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": False,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": False,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId"
payload <- "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId') do |req|
req.body = "{\n \"audioRecordingEnabled\": false,\n \"cloudArchiveEnabled\": false,\n \"maxRetentionDays\": 0,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"name\": \"\",\n \"restrictedBandwidthModeEnabled\": false,\n \"scheduleId\": \"\",\n \"videoSettings\": {\n \"MV12/MV22/MV72\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV12WE\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV13\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV21/MV71\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV22X/MV72X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV32\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV33\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV52\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV63X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n },\n \"MV93X\": {\n \"quality\": \"\",\n \"resolution\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId";
let payload = json!({
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": json!({
"MV12/MV22/MV72": json!({
"quality": "",
"resolution": ""
}),
"MV12WE": json!({
"quality": "",
"resolution": ""
}),
"MV13": json!({
"quality": "",
"resolution": ""
}),
"MV21/MV71": json!({
"quality": "",
"resolution": ""
}),
"MV22X/MV72X": json!({
"quality": "",
"resolution": ""
}),
"MV32": json!({
"quality": "",
"resolution": ""
}),
"MV33": json!({
"quality": "",
"resolution": ""
}),
"MV52": json!({
"quality": "",
"resolution": ""
}),
"MV63": json!({
"quality": "",
"resolution": ""
}),
"MV63X": json!({
"quality": "",
"resolution": ""
}),
"MV93": json!({
"quality": "",
"resolution": ""
}),
"MV93X": json!({
"quality": "",
"resolution": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId \
--header 'content-type: application/json' \
--data '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}'
echo '{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "",
"resolution": ""
},
"MV12WE": {
"quality": "",
"resolution": ""
},
"MV13": {
"quality": "",
"resolution": ""
},
"MV21/MV71": {
"quality": "",
"resolution": ""
},
"MV22X/MV72X": {
"quality": "",
"resolution": ""
},
"MV32": {
"quality": "",
"resolution": ""
},
"MV33": {
"quality": "",
"resolution": ""
},
"MV52": {
"quality": "",
"resolution": ""
},
"MV63": {
"quality": "",
"resolution": ""
},
"MV63X": {
"quality": "",
"resolution": ""
},
"MV93": {
"quality": "",
"resolution": ""
},
"MV93X": {
"quality": "",
"resolution": ""
}
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "audioRecordingEnabled": false,\n "cloudArchiveEnabled": false,\n "maxRetentionDays": 0,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "name": "",\n "restrictedBandwidthModeEnabled": false,\n "scheduleId": "",\n "videoSettings": {\n "MV12/MV22/MV72": {\n "quality": "",\n "resolution": ""\n },\n "MV12WE": {\n "quality": "",\n "resolution": ""\n },\n "MV13": {\n "quality": "",\n "resolution": ""\n },\n "MV21/MV71": {\n "quality": "",\n "resolution": ""\n },\n "MV22X/MV72X": {\n "quality": "",\n "resolution": ""\n },\n "MV32": {\n "quality": "",\n "resolution": ""\n },\n "MV33": {\n "quality": "",\n "resolution": ""\n },\n "MV52": {\n "quality": "",\n "resolution": ""\n },\n "MV63": {\n "quality": "",\n "resolution": ""\n },\n "MV63X": {\n "quality": "",\n "resolution": ""\n },\n "MV93": {\n "quality": "",\n "resolution": ""\n },\n "MV93X": {\n "quality": "",\n "resolution": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"maxRetentionDays": 0,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"name": "",
"restrictedBandwidthModeEnabled": false,
"scheduleId": "",
"videoSettings": [
"MV12/MV22/MV72": [
"quality": "",
"resolution": ""
],
"MV12WE": [
"quality": "",
"resolution": ""
],
"MV13": [
"quality": "",
"resolution": ""
],
"MV21/MV71": [
"quality": "",
"resolution": ""
],
"MV22X/MV72X": [
"quality": "",
"resolution": ""
],
"MV32": [
"quality": "",
"resolution": ""
],
"MV33": [
"quality": "",
"resolution": ""
],
"MV52": [
"quality": "",
"resolution": ""
],
"MV63": [
"quality": "",
"resolution": ""
],
"MV63X": [
"quality": "",
"resolution": ""
],
"MV93": [
"quality": "",
"resolution": ""
],
"MV93X": [
"quality": "",
"resolution": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/qualityRetentionProfiles/:qualityRetentionProfileId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"audioRecordingEnabled": false,
"cloudArchiveEnabled": false,
"id": "1234",
"maxRetentionDays": 7,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"name": "Sample quality retention profile",
"networkId": "N_24329156",
"restrictedBandwidthModeEnabled": true,
"scheduleId": null,
"videoSettings": {
"MV12/MV22/MV72": {
"quality": "High",
"resolution": "1920x1080"
},
"MV12WE": {
"quality": "High",
"resolution": "1920x1080"
},
"MV21/MV71": {
"quality": "High",
"resolution": "1280x720"
},
"MV32": {
"quality": "Enhanced",
"resolution": "1080x1080"
}
}
}
POST
Generate a snapshot of what the camera sees at the specified time and return a link to that image.
{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot
QUERY PARAMS
networkId
serial
BODY json
{
"fullframe": false,
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot" {:content-type :json
:form-params {:fullframe false
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"),
Content = new StringContent("{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"
payload := strings.NewReader("{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/cameras/:serial/snapshot HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 43
{
"fullframe": false,
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")
.setHeader("content-type", "application/json")
.setBody("{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")
.header("content-type", "application/json")
.body("{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
fullframe: false,
timestamp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot',
headers: {'content-type': 'application/json'},
data: {fullframe: false, timestamp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"fullframe":false,"timestamp":""}'
};
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}}/networks/:networkId/cameras/:serial/snapshot',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "fullframe": false,\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/cameras/:serial/snapshot',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({fullframe: false, timestamp: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot',
headers: {'content-type': 'application/json'},
body: {fullframe: false, timestamp: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
fullframe: false,
timestamp: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot',
headers: {'content-type': 'application/json'},
data: {fullframe: false, timestamp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"fullframe":false,"timestamp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"fullframe": @NO,
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"]
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}}/networks/:networkId/cameras/:serial/snapshot" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fullframe' => null,
'timestamp' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot', [
'body' => '{
"fullframe": false,
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'fullframe' => null,
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'fullframe' => null,
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"fullframe": false,
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"fullframe": false,
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/cameras/:serial/snapshot", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"
payload = {
"fullframe": False,
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot"
payload <- "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/cameras/:serial/snapshot') do |req|
req.body = "{\n \"fullframe\": false,\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot";
let payload = json!({
"fullframe": false,
"timestamp": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/cameras/:serial/snapshot \
--header 'content-type: application/json' \
--data '{
"fullframe": false,
"timestamp": ""
}'
echo '{
"fullframe": false,
"timestamp": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/cameras/:serial/snapshot \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "fullframe": false,\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/cameras/:serial/snapshot
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"fullframe": false,
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/cameras/:serial/snapshot")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"expiry": "Access to the image will expire at 2018-12-11T03:12:39Z.",
"url": "https://spn4.meraki.com/stream/jpeg/snapshot/b2d123asdf423qd22d2"
}
GET
Returns a list of all camera recording schedules.
{{baseUrl}}/networks/:networkId/camera/schedules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/camera/schedules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/camera/schedules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/camera/schedules"
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}}/networks/:networkId/camera/schedules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/camera/schedules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/camera/schedules"
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/networks/:networkId/camera/schedules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/camera/schedules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/camera/schedules"))
.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}}/networks/:networkId/camera/schedules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/camera/schedules")
.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}}/networks/:networkId/camera/schedules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/camera/schedules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/camera/schedules';
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}}/networks/:networkId/camera/schedules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/camera/schedules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/camera/schedules',
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}}/networks/:networkId/camera/schedules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/camera/schedules');
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}}/networks/:networkId/camera/schedules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/camera/schedules';
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}}/networks/:networkId/camera/schedules"]
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}}/networks/:networkId/camera/schedules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/camera/schedules",
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}}/networks/:networkId/camera/schedules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/camera/schedules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/camera/schedules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/camera/schedules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/camera/schedules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/camera/schedules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/camera/schedules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/camera/schedules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/camera/schedules")
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/networks/:networkId/camera/schedules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/camera/schedules";
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}}/networks/:networkId/camera/schedules
http GET {{baseUrl}}/networks/:networkId/camera/schedules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/camera/schedules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/camera/schedules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "123",
"name": "Weekday schedule"
},
{
"id": "124",
"name": "Office hours"
}
]
GET
Returns quality and retention settings for the given camera
{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
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}}/devices/:serial/camera/qualityAndRetentionSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
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/devices/:serial/camera/qualityAndRetentionSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"))
.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}}/devices/:serial/camera/qualityAndRetentionSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.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}}/devices/:serial/camera/qualityAndRetentionSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings';
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}}/devices/:serial/camera/qualityAndRetentionSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/qualityAndRetentionSettings',
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}}/devices/:serial/camera/qualityAndRetentionSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
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}}/devices/:serial/camera/qualityAndRetentionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings';
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}}/devices/:serial/camera/qualityAndRetentionSettings"]
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}}/devices/:serial/camera/qualityAndRetentionSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings",
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}}/devices/:serial/camera/qualityAndRetentionSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/qualityAndRetentionSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
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/devices/:serial/camera/qualityAndRetentionSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings";
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}}/devices/:serial/camera/qualityAndRetentionSettings
http GET {{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"profileId": "1234",
"quality": "Standard",
"resolution": "1280x720",
"restrictedBandwidthModeEnabled": false
}
GET
Returns video link to the specified camera
{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink"
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}}/networks/:networkId/cameras/:serial/videoLink"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink"
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/networks/:networkId/cameras/:serial/videoLink HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink"))
.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}}/networks/:networkId/cameras/:serial/videoLink")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")
.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}}/networks/:networkId/cameras/:serial/videoLink');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink';
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}}/networks/:networkId/cameras/:serial/videoLink',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/cameras/:serial/videoLink',
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}}/networks/:networkId/cameras/:serial/videoLink'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink');
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}}/networks/:networkId/cameras/:serial/videoLink'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink';
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}}/networks/:networkId/cameras/:serial/videoLink"]
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}}/networks/:networkId/cameras/:serial/videoLink" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink",
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}}/networks/:networkId/cameras/:serial/videoLink');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/cameras/:serial/videoLink")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")
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/networks/:networkId/cameras/:serial/videoLink') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink";
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}}/networks/:networkId/cameras/:serial/videoLink
http GET {{baseUrl}}/networks/:networkId/cameras/:serial/videoLink
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/cameras/:serial/videoLink
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/cameras/:serial/videoLink")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"url": "https://nxx.meraki.com/office-cameras/n/bs0a1k/manage/nodes/new_list/29048243992402?timestamp=1535732570077"
}
GET
Returns video settings for the given camera
{{baseUrl}}/devices/:serial/camera/video/settings
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/video/settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/video/settings")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/video/settings"
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}}/devices/:serial/camera/video/settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/video/settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/video/settings"
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/devices/:serial/camera/video/settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/video/settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/video/settings"))
.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}}/devices/:serial/camera/video/settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/video/settings")
.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}}/devices/:serial/camera/video/settings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/video/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/video/settings';
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}}/devices/:serial/camera/video/settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/video/settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/video/settings',
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}}/devices/:serial/camera/video/settings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/video/settings');
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}}/devices/:serial/camera/video/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/video/settings';
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}}/devices/:serial/camera/video/settings"]
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}}/devices/:serial/camera/video/settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/video/settings",
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}}/devices/:serial/camera/video/settings');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/video/settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/video/settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/video/settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/video/settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/video/settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/video/settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/video/settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/video/settings")
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/devices/:serial/camera/video/settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/video/settings";
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}}/devices/:serial/camera/video/settings
http GET {{baseUrl}}/devices/:serial/camera/video/settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/video/settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/video/settings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"externalRtspEnabled": true,
"rtspUrl": "rtsp://10.0.0.1:9000/live"
}
PUT
Update quality and retention settings for the given camera
{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings
QUERY PARAMS
serial
BODY json
{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings" {:content-type :json
:form-params {:audioRecordingEnabled false
:motionBasedRetentionEnabled false
:motionDetectorVersion 0
:profileId ""
:quality ""
:resolution ""
:restrictedBandwidthModeEnabled false}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"),
Content = new StringContent("{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
payload := strings.NewReader("{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/devices/:serial/camera/qualityAndRetentionSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 205
{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.header("content-type", "application/json")
.body("{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}")
.asString();
const data = JSON.stringify({
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"profileId":"","quality":"","resolution":"","restrictedBandwidthModeEnabled":false}'
};
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}}/devices/:serial/camera/qualityAndRetentionSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "audioRecordingEnabled": false,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "profileId": "",\n "quality": "",\n "resolution": "",\n "restrictedBandwidthModeEnabled": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/qualityAndRetentionSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings',
headers: {'content-type': 'application/json'},
body: {
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings',
headers: {'content-type': 'application/json'},
data: {
audioRecordingEnabled: false,
motionBasedRetentionEnabled: false,
motionDetectorVersion: 0,
profileId: '',
quality: '',
resolution: '',
restrictedBandwidthModeEnabled: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"audioRecordingEnabled":false,"motionBasedRetentionEnabled":false,"motionDetectorVersion":0,"profileId":"","quality":"","resolution":"","restrictedBandwidthModeEnabled":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"audioRecordingEnabled": @NO,
@"motionBasedRetentionEnabled": @NO,
@"motionDetectorVersion": @0,
@"profileId": @"",
@"quality": @"",
@"resolution": @"",
@"restrictedBandwidthModeEnabled": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'audioRecordingEnabled' => null,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'profileId' => '',
'quality' => '',
'resolution' => '',
'restrictedBandwidthModeEnabled' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings', [
'body' => '{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'audioRecordingEnabled' => null,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'profileId' => '',
'quality' => '',
'resolution' => '',
'restrictedBandwidthModeEnabled' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'audioRecordingEnabled' => null,
'motionBasedRetentionEnabled' => null,
'motionDetectorVersion' => 0,
'profileId' => '',
'quality' => '',
'resolution' => '',
'restrictedBandwidthModeEnabled' => null
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/devices/:serial/camera/qualityAndRetentionSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
payload = {
"audioRecordingEnabled": False,
"motionBasedRetentionEnabled": False,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings"
payload <- "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/devices/:serial/camera/qualityAndRetentionSettings') do |req|
req.body = "{\n \"audioRecordingEnabled\": false,\n \"motionBasedRetentionEnabled\": false,\n \"motionDetectorVersion\": 0,\n \"profileId\": \"\",\n \"quality\": \"\",\n \"resolution\": \"\",\n \"restrictedBandwidthModeEnabled\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings";
let payload = json!({
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings \
--header 'content-type: application/json' \
--data '{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}'
echo '{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
}' | \
http PUT {{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "audioRecordingEnabled": false,\n "motionBasedRetentionEnabled": false,\n "motionDetectorVersion": 0,\n "profileId": "",\n "quality": "",\n "resolution": "",\n "restrictedBandwidthModeEnabled": false\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 0,
"profileId": "",
"quality": "",
"resolution": "",
"restrictedBandwidthModeEnabled": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/qualityAndRetentionSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"audioRecordingEnabled": false,
"motionBasedRetentionEnabled": false,
"motionDetectorVersion": 2,
"profileId": "1234",
"quality": "Standard",
"resolution": "1280x720",
"restrictedBandwidthModeEnabled": false
}
PUT
Update video settings for the given camera
{{baseUrl}}/devices/:serial/camera/video/settings
QUERY PARAMS
serial
BODY json
{
"externalRtspEnabled": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/video/settings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"externalRtspEnabled\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/devices/:serial/camera/video/settings" {:content-type :json
:form-params {:externalRtspEnabled false}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/video/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"externalRtspEnabled\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/camera/video/settings"),
Content = new StringContent("{\n \"externalRtspEnabled\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/video/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"externalRtspEnabled\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/video/settings"
payload := strings.NewReader("{\n \"externalRtspEnabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/devices/:serial/camera/video/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"externalRtspEnabled": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/devices/:serial/camera/video/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"externalRtspEnabled\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/video/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"externalRtspEnabled\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"externalRtspEnabled\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/video/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/devices/:serial/camera/video/settings")
.header("content-type", "application/json")
.body("{\n \"externalRtspEnabled\": false\n}")
.asString();
const data = JSON.stringify({
externalRtspEnabled: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/devices/:serial/camera/video/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/video/settings',
headers: {'content-type': 'application/json'},
data: {externalRtspEnabled: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/video/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"externalRtspEnabled":false}'
};
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}}/devices/:serial/camera/video/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "externalRtspEnabled": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"externalRtspEnabled\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/video/settings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/video/settings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({externalRtspEnabled: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/video/settings',
headers: {'content-type': 'application/json'},
body: {externalRtspEnabled: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/devices/:serial/camera/video/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
externalRtspEnabled: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/camera/video/settings',
headers: {'content-type': 'application/json'},
data: {externalRtspEnabled: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/video/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"externalRtspEnabled":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"externalRtspEnabled": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/camera/video/settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices/:serial/camera/video/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"externalRtspEnabled\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/video/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'externalRtspEnabled' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/devices/:serial/camera/video/settings', [
'body' => '{
"externalRtspEnabled": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/video/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'externalRtspEnabled' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'externalRtspEnabled' => null
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/camera/video/settings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/video/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"externalRtspEnabled": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/video/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"externalRtspEnabled": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"externalRtspEnabled\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/devices/:serial/camera/video/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/video/settings"
payload = { "externalRtspEnabled": False }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/video/settings"
payload <- "{\n \"externalRtspEnabled\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/video/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"externalRtspEnabled\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/devices/:serial/camera/video/settings') do |req|
req.body = "{\n \"externalRtspEnabled\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/video/settings";
let payload = json!({"externalRtspEnabled": false});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/devices/:serial/camera/video/settings \
--header 'content-type: application/json' \
--data '{
"externalRtspEnabled": false
}'
echo '{
"externalRtspEnabled": false
}' | \
http PUT {{baseUrl}}/devices/:serial/camera/video/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "externalRtspEnabled": false\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/camera/video/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["externalRtspEnabled": false] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/video/settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"externalRtspEnabled": true,
"rtspUrl": "rtsp://10.0.0.1:9000/live"
}
GET
View the Change Log for your organization
{{baseUrl}}/organizations/:organizationId/configurationChanges
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/configurationChanges");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/configurationChanges")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/configurationChanges"
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}}/organizations/:organizationId/configurationChanges"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/configurationChanges");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/configurationChanges"
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/organizations/:organizationId/configurationChanges HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/configurationChanges")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/configurationChanges"))
.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}}/organizations/:organizationId/configurationChanges")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/configurationChanges")
.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}}/organizations/:organizationId/configurationChanges');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/configurationChanges'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/configurationChanges';
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}}/organizations/:organizationId/configurationChanges',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/configurationChanges")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/configurationChanges',
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}}/organizations/:organizationId/configurationChanges'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/configurationChanges');
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}}/organizations/:organizationId/configurationChanges'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/configurationChanges';
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}}/organizations/:organizationId/configurationChanges"]
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}}/organizations/:organizationId/configurationChanges" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/configurationChanges",
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}}/organizations/:organizationId/configurationChanges');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/configurationChanges');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/configurationChanges');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/configurationChanges' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/configurationChanges' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/configurationChanges")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/configurationChanges"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/configurationChanges"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/configurationChanges")
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/organizations/:organizationId/configurationChanges') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/configurationChanges";
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}}/organizations/:organizationId/configurationChanges
http GET {{baseUrl}}/organizations/:organizationId/configurationChanges
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/configurationChanges
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/configurationChanges")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"adminEmail": "miles@meraki.com",
"adminId": "212406",
"adminName": "Miles Meraki",
"label": "PUT /api/v1/organizations/2930418",
"newValue": "{\"id\":\"2930418\",\"name\":\"My organization changed\",\"url\":\"https://dashboard.meraki.com/o/VjjsAd/manage/organization/overview\"}",
"oldValue": "{\"id\":\"2930418\",\"name\":\"My organization\",\"url\":\"https://dashboard.meraki.com/o/VjjsAd/manage/organization/overview\"}",
"page": "via API",
"ts": "2018-02-11T00:00:00.090210Z"
}
]
GET
List the clients of a device, up to a maximum of a month ago
{{baseUrl}}/devices/:serial/clients
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/clients");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/clients")
require "http/client"
url = "{{baseUrl}}/devices/:serial/clients"
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}}/devices/:serial/clients"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/clients");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/clients"
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/devices/:serial/clients HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/clients")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/clients"))
.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}}/devices/:serial/clients")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/clients")
.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}}/devices/:serial/clients');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/devices/:serial/clients'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/clients';
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}}/devices/:serial/clients',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/clients")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/clients',
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}}/devices/:serial/clients'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/clients');
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}}/devices/:serial/clients'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/clients';
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}}/devices/:serial/clients"]
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}}/devices/:serial/clients" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/clients",
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}}/devices/:serial/clients');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/clients');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/clients');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/clients' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/clients' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/clients")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/clients"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/clients"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/clients")
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/devices/:serial/clients') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/clients";
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}}/devices/:serial/clients
http GET {{baseUrl}}/devices/:serial/clients
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/clients
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/clients")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"description": "Miles's phone",
"dhcpHostname": "MilesPhone",
"id": "k74272e",
"ip": "1.2.3.4",
"mac": "22:33:44:55:66:77",
"mdnsName": "Miles's phone",
"switchport": null,
"usage": {
"recv": 61,
"sent": 138
},
"user": "milesmeraki",
"vlan": 255
}
]
GET
List the clients that have used this network in the timespan
{{baseUrl}}/networks/:networkId/clients
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients"
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}}/networks/:networkId/clients"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients"
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/networks/:networkId/clients HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients"))
.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}}/networks/:networkId/clients")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients")
.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}}/networks/:networkId/clients');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/clients'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients';
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}}/networks/:networkId/clients',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients',
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}}/networks/:networkId/clients'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients');
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}}/networks/:networkId/clients'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients';
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}}/networks/:networkId/clients"]
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}}/networks/:networkId/clients" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients",
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}}/networks/:networkId/clients');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients")
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/networks/:networkId/clients') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients";
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}}/networks/:networkId/clients
http GET {{baseUrl}}/networks/:networkId/clients
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"description": "Miles's phone",
"firstSeen": 1518365681,
"groupPolicy8021x": "Student_Access",
"id": "k74272e",
"ip": "1.2.3.4",
"ip6": "2001:db8:3c4d:15::1",
"ip6Local": "fe80:0:0:0:1430:aac1:6826:75ab",
"lastSeen": 1526087474,
"mac": "22:33:44:55:66:77",
"manufacturer": "Apple",
"notes": "My AP's note",
"os": "iOS",
"recentDeviceMac": "22:33:44:55:66:77",
"recentDeviceName": "Q234-ABCD-5678",
"recentDeviceSerial": "00:11:22:33:44:55",
"smInstalled": true,
"ssid": "My SSID",
"status": "Online",
"switchport": "My switch port",
"usage": {
"recv": 61,
"sent": 138
},
"user": "milesmeraki",
"vlan": "100"
}
POST
Provisions a client with a name and policy
{{baseUrl}}/networks/:networkId/clients/provision
QUERY PARAMS
networkId
BODY json
{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/provision");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/clients/provision" {:content-type :json
:form-params {:devicePolicy ""
:groupPolicyId ""
:mac ""
:name ""
:policiesBySecurityAppliance {:devicePolicy ""}
:policiesBySsid {:0 {:devicePolicy ""
:groupPolicyId ""}
:1 {:devicePolicy ""
:groupPolicyId ""}
:2 {:devicePolicy ""
:groupPolicyId ""}
:3 {:devicePolicy ""
:groupPolicyId ""}
:4 {:devicePolicy ""
:groupPolicyId ""}
:5 {:devicePolicy ""
:groupPolicyId ""}
:6 {:devicePolicy ""
:groupPolicyId ""}
:7 {:devicePolicy ""
:groupPolicyId ""}
:8 {:devicePolicy ""
:groupPolicyId ""}
:9 {:devicePolicy ""
:groupPolicyId ""}
:10 {:devicePolicy ""
:groupPolicyId ""}
:11 {:devicePolicy ""
:groupPolicyId ""}
:12 {:devicePolicy ""
:groupPolicyId ""}
:13 {:devicePolicy ""
:groupPolicyId ""}
:14 {:devicePolicy ""
:groupPolicyId ""}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/provision"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/clients/provision"),
Content = new StringContent("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/provision");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/provision"
payload := strings.NewReader("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/clients/provision HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1218
{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/clients/provision")
.setHeader("content-type", "application/json")
.setBody("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/provision"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/provision")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/clients/provision")
.header("content-type", "application/json")
.body("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {
devicePolicy: ''
},
policiesBySsid: {
'0': {
devicePolicy: '',
groupPolicyId: ''
},
'1': {
devicePolicy: '',
groupPolicyId: ''
},
'2': {
devicePolicy: '',
groupPolicyId: ''
},
'3': {
devicePolicy: '',
groupPolicyId: ''
},
'4': {
devicePolicy: '',
groupPolicyId: ''
},
'5': {
devicePolicy: '',
groupPolicyId: ''
},
'6': {
devicePolicy: '',
groupPolicyId: ''
},
'7': {
devicePolicy: '',
groupPolicyId: ''
},
'8': {
devicePolicy: '',
groupPolicyId: ''
},
'9': {
devicePolicy: '',
groupPolicyId: ''
},
'10': {
devicePolicy: '',
groupPolicyId: ''
},
'11': {
devicePolicy: '',
groupPolicyId: ''
},
'12': {
devicePolicy: '',
groupPolicyId: ''
},
'13': {
devicePolicy: '',
groupPolicyId: ''
},
'14': {
devicePolicy: '',
groupPolicyId: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/clients/provision');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/clients/provision',
headers: {'content-type': 'application/json'},
data: {
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {devicePolicy: ''},
policiesBySsid: {
'0': {devicePolicy: '', groupPolicyId: ''},
'1': {devicePolicy: '', groupPolicyId: ''},
'2': {devicePolicy: '', groupPolicyId: ''},
'3': {devicePolicy: '', groupPolicyId: ''},
'4': {devicePolicy: '', groupPolicyId: ''},
'5': {devicePolicy: '', groupPolicyId: ''},
'6': {devicePolicy: '', groupPolicyId: ''},
'7': {devicePolicy: '', groupPolicyId: ''},
'8': {devicePolicy: '', groupPolicyId: ''},
'9': {devicePolicy: '', groupPolicyId: ''},
'10': {devicePolicy: '', groupPolicyId: ''},
'11': {devicePolicy: '', groupPolicyId: ''},
'12': {devicePolicy: '', groupPolicyId: ''},
'13': {devicePolicy: '', groupPolicyId: ''},
'14': {devicePolicy: '', groupPolicyId: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/provision';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"devicePolicy":"","groupPolicyId":"","mac":"","name":"","policiesBySecurityAppliance":{"devicePolicy":""},"policiesBySsid":{"0":{"devicePolicy":"","groupPolicyId":""},"1":{"devicePolicy":"","groupPolicyId":""},"2":{"devicePolicy":"","groupPolicyId":""},"3":{"devicePolicy":"","groupPolicyId":""},"4":{"devicePolicy":"","groupPolicyId":""},"5":{"devicePolicy":"","groupPolicyId":""},"6":{"devicePolicy":"","groupPolicyId":""},"7":{"devicePolicy":"","groupPolicyId":""},"8":{"devicePolicy":"","groupPolicyId":""},"9":{"devicePolicy":"","groupPolicyId":""},"10":{"devicePolicy":"","groupPolicyId":""},"11":{"devicePolicy":"","groupPolicyId":""},"12":{"devicePolicy":"","groupPolicyId":""},"13":{"devicePolicy":"","groupPolicyId":""},"14":{"devicePolicy":"","groupPolicyId":""}}}'
};
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}}/networks/:networkId/clients/provision',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "devicePolicy": "",\n "groupPolicyId": "",\n "mac": "",\n "name": "",\n "policiesBySecurityAppliance": {\n "devicePolicy": ""\n },\n "policiesBySsid": {\n "0": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "1": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "2": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "3": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "4": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "5": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "6": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "7": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "8": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "9": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "10": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "11": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "12": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "13": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "14": {\n "devicePolicy": "",\n "groupPolicyId": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/provision")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/provision',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {devicePolicy: ''},
policiesBySsid: {
'0': {devicePolicy: '', groupPolicyId: ''},
'1': {devicePolicy: '', groupPolicyId: ''},
'2': {devicePolicy: '', groupPolicyId: ''},
'3': {devicePolicy: '', groupPolicyId: ''},
'4': {devicePolicy: '', groupPolicyId: ''},
'5': {devicePolicy: '', groupPolicyId: ''},
'6': {devicePolicy: '', groupPolicyId: ''},
'7': {devicePolicy: '', groupPolicyId: ''},
'8': {devicePolicy: '', groupPolicyId: ''},
'9': {devicePolicy: '', groupPolicyId: ''},
'10': {devicePolicy: '', groupPolicyId: ''},
'11': {devicePolicy: '', groupPolicyId: ''},
'12': {devicePolicy: '', groupPolicyId: ''},
'13': {devicePolicy: '', groupPolicyId: ''},
'14': {devicePolicy: '', groupPolicyId: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/clients/provision',
headers: {'content-type': 'application/json'},
body: {
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {devicePolicy: ''},
policiesBySsid: {
'0': {devicePolicy: '', groupPolicyId: ''},
'1': {devicePolicy: '', groupPolicyId: ''},
'2': {devicePolicy: '', groupPolicyId: ''},
'3': {devicePolicy: '', groupPolicyId: ''},
'4': {devicePolicy: '', groupPolicyId: ''},
'5': {devicePolicy: '', groupPolicyId: ''},
'6': {devicePolicy: '', groupPolicyId: ''},
'7': {devicePolicy: '', groupPolicyId: ''},
'8': {devicePolicy: '', groupPolicyId: ''},
'9': {devicePolicy: '', groupPolicyId: ''},
'10': {devicePolicy: '', groupPolicyId: ''},
'11': {devicePolicy: '', groupPolicyId: ''},
'12': {devicePolicy: '', groupPolicyId: ''},
'13': {devicePolicy: '', groupPolicyId: ''},
'14': {devicePolicy: '', groupPolicyId: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/clients/provision');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {
devicePolicy: ''
},
policiesBySsid: {
'0': {
devicePolicy: '',
groupPolicyId: ''
},
'1': {
devicePolicy: '',
groupPolicyId: ''
},
'2': {
devicePolicy: '',
groupPolicyId: ''
},
'3': {
devicePolicy: '',
groupPolicyId: ''
},
'4': {
devicePolicy: '',
groupPolicyId: ''
},
'5': {
devicePolicy: '',
groupPolicyId: ''
},
'6': {
devicePolicy: '',
groupPolicyId: ''
},
'7': {
devicePolicy: '',
groupPolicyId: ''
},
'8': {
devicePolicy: '',
groupPolicyId: ''
},
'9': {
devicePolicy: '',
groupPolicyId: ''
},
'10': {
devicePolicy: '',
groupPolicyId: ''
},
'11': {
devicePolicy: '',
groupPolicyId: ''
},
'12': {
devicePolicy: '',
groupPolicyId: ''
},
'13': {
devicePolicy: '',
groupPolicyId: ''
},
'14': {
devicePolicy: '',
groupPolicyId: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/clients/provision',
headers: {'content-type': 'application/json'},
data: {
devicePolicy: '',
groupPolicyId: '',
mac: '',
name: '',
policiesBySecurityAppliance: {devicePolicy: ''},
policiesBySsid: {
'0': {devicePolicy: '', groupPolicyId: ''},
'1': {devicePolicy: '', groupPolicyId: ''},
'2': {devicePolicy: '', groupPolicyId: ''},
'3': {devicePolicy: '', groupPolicyId: ''},
'4': {devicePolicy: '', groupPolicyId: ''},
'5': {devicePolicy: '', groupPolicyId: ''},
'6': {devicePolicy: '', groupPolicyId: ''},
'7': {devicePolicy: '', groupPolicyId: ''},
'8': {devicePolicy: '', groupPolicyId: ''},
'9': {devicePolicy: '', groupPolicyId: ''},
'10': {devicePolicy: '', groupPolicyId: ''},
'11': {devicePolicy: '', groupPolicyId: ''},
'12': {devicePolicy: '', groupPolicyId: ''},
'13': {devicePolicy: '', groupPolicyId: ''},
'14': {devicePolicy: '', groupPolicyId: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/provision';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"devicePolicy":"","groupPolicyId":"","mac":"","name":"","policiesBySecurityAppliance":{"devicePolicy":""},"policiesBySsid":{"0":{"devicePolicy":"","groupPolicyId":""},"1":{"devicePolicy":"","groupPolicyId":""},"2":{"devicePolicy":"","groupPolicyId":""},"3":{"devicePolicy":"","groupPolicyId":""},"4":{"devicePolicy":"","groupPolicyId":""},"5":{"devicePolicy":"","groupPolicyId":""},"6":{"devicePolicy":"","groupPolicyId":""},"7":{"devicePolicy":"","groupPolicyId":""},"8":{"devicePolicy":"","groupPolicyId":""},"9":{"devicePolicy":"","groupPolicyId":""},"10":{"devicePolicy":"","groupPolicyId":""},"11":{"devicePolicy":"","groupPolicyId":""},"12":{"devicePolicy":"","groupPolicyId":""},"13":{"devicePolicy":"","groupPolicyId":""},"14":{"devicePolicy":"","groupPolicyId":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"devicePolicy": @"",
@"groupPolicyId": @"",
@"mac": @"",
@"name": @"",
@"policiesBySecurityAppliance": @{ @"devicePolicy": @"" },
@"policiesBySsid": @{ @"0": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"1": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"2": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"3": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"4": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"5": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"6": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"7": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"8": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"9": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"10": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"11": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"12": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"13": @{ @"devicePolicy": @"", @"groupPolicyId": @"" }, @"14": @{ @"devicePolicy": @"", @"groupPolicyId": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/clients/provision"]
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}}/networks/:networkId/clients/provision" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'devicePolicy' => '',
'groupPolicyId' => '',
'mac' => '',
'name' => '',
'policiesBySecurityAppliance' => [
'devicePolicy' => ''
],
'policiesBySsid' => [
'0' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'1' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'2' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'3' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'4' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'5' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'6' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'7' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'8' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'9' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'10' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'11' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'12' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'13' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'14' => [
'devicePolicy' => '',
'groupPolicyId' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/clients/provision', [
'body' => '{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/provision');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'devicePolicy' => '',
'groupPolicyId' => '',
'mac' => '',
'name' => '',
'policiesBySecurityAppliance' => [
'devicePolicy' => ''
],
'policiesBySsid' => [
'0' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'1' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'2' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'3' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'4' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'5' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'6' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'7' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'8' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'9' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'10' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'11' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'12' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'13' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'14' => [
'devicePolicy' => '',
'groupPolicyId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'devicePolicy' => '',
'groupPolicyId' => '',
'mac' => '',
'name' => '',
'policiesBySecurityAppliance' => [
'devicePolicy' => ''
],
'policiesBySsid' => [
'0' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'1' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'2' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'3' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'4' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'5' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'6' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'7' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'8' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'9' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'10' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'11' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'12' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'13' => [
'devicePolicy' => '',
'groupPolicyId' => ''
],
'14' => [
'devicePolicy' => '',
'groupPolicyId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/clients/provision');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/provision' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/provision' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/clients/provision", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/provision"
payload = {
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": { "devicePolicy": "" },
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/provision"
payload <- "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/clients/provision') do |req|
req.body = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\",\n \"mac\": \"\",\n \"name\": \"\",\n \"policiesBySecurityAppliance\": {\n \"devicePolicy\": \"\"\n },\n \"policiesBySsid\": {\n \"0\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"1\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"2\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"3\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"4\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"5\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"6\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"7\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"8\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"9\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"10\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"11\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"12\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"13\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n },\n \"14\": {\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/provision";
let payload = json!({
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": json!({"devicePolicy": ""}),
"policiesBySsid": json!({
"0": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"1": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"2": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"3": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"4": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"5": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"6": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"7": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"8": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"9": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"10": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"11": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"12": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"13": json!({
"devicePolicy": "",
"groupPolicyId": ""
}),
"14": json!({
"devicePolicy": "",
"groupPolicyId": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/clients/provision \
--header 'content-type: application/json' \
--data '{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}'
echo '{
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": {
"devicePolicy": ""
},
"policiesBySsid": {
"0": {
"devicePolicy": "",
"groupPolicyId": ""
},
"1": {
"devicePolicy": "",
"groupPolicyId": ""
},
"2": {
"devicePolicy": "",
"groupPolicyId": ""
},
"3": {
"devicePolicy": "",
"groupPolicyId": ""
},
"4": {
"devicePolicy": "",
"groupPolicyId": ""
},
"5": {
"devicePolicy": "",
"groupPolicyId": ""
},
"6": {
"devicePolicy": "",
"groupPolicyId": ""
},
"7": {
"devicePolicy": "",
"groupPolicyId": ""
},
"8": {
"devicePolicy": "",
"groupPolicyId": ""
},
"9": {
"devicePolicy": "",
"groupPolicyId": ""
},
"10": {
"devicePolicy": "",
"groupPolicyId": ""
},
"11": {
"devicePolicy": "",
"groupPolicyId": ""
},
"12": {
"devicePolicy": "",
"groupPolicyId": ""
},
"13": {
"devicePolicy": "",
"groupPolicyId": ""
},
"14": {
"devicePolicy": "",
"groupPolicyId": ""
}
}
}' | \
http POST {{baseUrl}}/networks/:networkId/clients/provision \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "devicePolicy": "",\n "groupPolicyId": "",\n "mac": "",\n "name": "",\n "policiesBySecurityAppliance": {\n "devicePolicy": ""\n },\n "policiesBySsid": {\n "0": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "1": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "2": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "3": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "4": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "5": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "6": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "7": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "8": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "9": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "10": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "11": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "12": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "13": {\n "devicePolicy": "",\n "groupPolicyId": ""\n },\n "14": {\n "devicePolicy": "",\n "groupPolicyId": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/provision
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"devicePolicy": "",
"groupPolicyId": "",
"mac": "",
"name": "",
"policiesBySecurityAppliance": ["devicePolicy": ""],
"policiesBySsid": [
"0": [
"devicePolicy": "",
"groupPolicyId": ""
],
"1": [
"devicePolicy": "",
"groupPolicyId": ""
],
"2": [
"devicePolicy": "",
"groupPolicyId": ""
],
"3": [
"devicePolicy": "",
"groupPolicyId": ""
],
"4": [
"devicePolicy": "",
"groupPolicyId": ""
],
"5": [
"devicePolicy": "",
"groupPolicyId": ""
],
"6": [
"devicePolicy": "",
"groupPolicyId": ""
],
"7": [
"devicePolicy": "",
"groupPolicyId": ""
],
"8": [
"devicePolicy": "",
"groupPolicyId": ""
],
"9": [
"devicePolicy": "",
"groupPolicyId": ""
],
"10": [
"devicePolicy": "",
"groupPolicyId": ""
],
"11": [
"devicePolicy": "",
"groupPolicyId": ""
],
"12": [
"devicePolicy": "",
"groupPolicyId": ""
],
"13": [
"devicePolicy": "",
"groupPolicyId": ""
],
"14": [
"devicePolicy": "",
"groupPolicyId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/provision")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"clientId": "k74272e",
"devicePolicy": "Group policy",
"groupPolicyId": "101",
"mac": "00:11:22:33:44:55",
"name": "Miles's phone"
}
GET
Return the client associated with the given identifier
{{baseUrl}}/networks/:networkId/clients/:clientId
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId"
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}}/networks/:networkId/clients/:clientId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId"
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/networks/:networkId/clients/:clientId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId"))
.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}}/networks/:networkId/clients/:clientId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId")
.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}}/networks/:networkId/clients/:clientId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId';
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}}/networks/:networkId/clients/:clientId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId',
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}}/networks/:networkId/clients/:clientId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId');
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}}/networks/:networkId/clients/:clientId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId';
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}}/networks/:networkId/clients/:clientId"]
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}}/networks/:networkId/clients/:clientId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId",
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}}/networks/:networkId/clients/:clientId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId")
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/networks/:networkId/clients/:clientId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId";
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}}/networks/:networkId/clients/:clientId
http GET {{baseUrl}}/networks/:networkId/clients/:clientId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"cdp": null,
"clientVpnConnections": [
{
"connectedAt": 1522613355,
"disconnectedAt": 1522613360,
"remoteIp": "1.2.3.4"
}
],
"description": "Miles's phone",
"firstSeen": 1518365681,
"id": "k74272e",
"ip": "1.2.3.4",
"ip6": "",
"lastSeen": 1526087474,
"lldp": [
[
"System name",
"Some system name"
],
[
"System description",
"Some system description"
],
[
"Port ID",
"1"
],
[
"Chassis ID",
"00:18:0a:00:00:00"
],
[
"Port description",
"eth0"
],
[
"System capabilities",
"Two-port MAC Relay"
]
],
"mac": "22:33:44:55:66:77",
"manufacturer": "Apple",
"os": "iOS",
"recentDeviceMac": "00:11:22:33:44:55",
"smInstalled": true,
"ssid": "My SSID",
"status": "Online",
"switchport": null,
"user": "null",
"vlan": "255",
"wirelessCapabilities": "802.11ac - 2.4 and 5 GHz"
}
GET
Return the client's daily usage history
{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory"
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}}/networks/:networkId/clients/:clientId/usageHistory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory"
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/networks/:networkId/clients/:clientId/usageHistory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory"))
.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}}/networks/:networkId/clients/:clientId/usageHistory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")
.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}}/networks/:networkId/clients/:clientId/usageHistory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory';
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}}/networks/:networkId/clients/:clientId/usageHistory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/usageHistory',
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}}/networks/:networkId/clients/:clientId/usageHistory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory');
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}}/networks/:networkId/clients/:clientId/usageHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory';
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}}/networks/:networkId/clients/:clientId/usageHistory"]
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}}/networks/:networkId/clients/:clientId/usageHistory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory",
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}}/networks/:networkId/clients/:clientId/usageHistory');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/usageHistory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")
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/networks/:networkId/clients/:clientId/usageHistory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory";
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}}/networks/:networkId/clients/:clientId/usageHistory
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/usageHistory")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"received": 680,
"sent": 500,
"ts": 1518365681
}
]
GET
Return the events associated with this client
{{baseUrl}}/networks/:networkId/clients/:clientId/events
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/events");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/events")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/events"
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}}/networks/:networkId/clients/:clientId/events"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/events");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/events"
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/networks/:networkId/clients/:clientId/events HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/events")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/events"))
.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}}/networks/:networkId/clients/:clientId/events")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/events")
.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}}/networks/:networkId/clients/:clientId/events');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/events'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/events';
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}}/networks/:networkId/clients/:clientId/events',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/events")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/events',
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}}/networks/:networkId/clients/:clientId/events'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/events');
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}}/networks/:networkId/clients/:clientId/events'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/events';
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}}/networks/:networkId/clients/:clientId/events"]
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}}/networks/:networkId/clients/:clientId/events" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/events",
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}}/networks/:networkId/clients/:clientId/events');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/events');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/events');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/events' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/events' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/events")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/events"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/events"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/events")
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/networks/:networkId/clients/:clientId/events') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/events";
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}}/networks/:networkId/clients/:clientId/events
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/events
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/events
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/events")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"details": {
"on_packet": "true",
"vap": "1"
},
"deviceSerial": "Q234-ABCD-5678",
"occurredAt": 1518365681,
"type": "l3roaming_assoc_start"
}
]
GET
Return the latency history for a client
{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory"
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}}/networks/:networkId/clients/:clientId/latencyHistory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory"
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/networks/:networkId/clients/:clientId/latencyHistory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory"))
.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}}/networks/:networkId/clients/:clientId/latencyHistory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")
.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}}/networks/:networkId/clients/:clientId/latencyHistory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory';
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}}/networks/:networkId/clients/:clientId/latencyHistory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/latencyHistory',
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}}/networks/:networkId/clients/:clientId/latencyHistory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory');
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}}/networks/:networkId/clients/:clientId/latencyHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory';
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}}/networks/:networkId/clients/:clientId/latencyHistory"]
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}}/networks/:networkId/clients/:clientId/latencyHistory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory",
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}}/networks/:networkId/clients/:clientId/latencyHistory');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/latencyHistory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")
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/networks/:networkId/clients/:clientId/latencyHistory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory";
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}}/networks/:networkId/clients/:clientId/latencyHistory
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyHistory")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"latencyBinsByCategory": {
"backgroundTraffic": {
"0.5": 41750,
"1.0": 21552,
"1024.0": 0,
"128.0": 0,
"16.0": 0,
"2.0": 59940,
"2048.0": 0,
"256.0": 1896,
"32.0": 9954,
"4.0": 146622,
"512.0": 0,
"64.0": 0,
"8.0": 57354
},
"bestEffortTraffic": {
"0.5": 1840899,
"1.0": 1644506,
"1024.0": 4943,
"128.0": 191977,
"16.0": 1329568,
"2.0": 629958,
"2048.0": 12072,
"256.0": 30560,
"32.0": 282168,
"4.0": 449564,
"512.0": 26032,
"64.0": 97573,
"8.0": 2009658
},
"videoTraffic": {
"0.5": 0,
"1.0": 0,
"1024.0": 0,
"128.0": 0,
"16.0": 0,
"2.0": 0,
"2048.0": 0,
"256.0": 0,
"32.0": 0,
"4.0": 0,
"512.0": 0,
"64.0": 0,
"8.0": 0
},
"voiceTraffic": {
"0.5": 716,
"1.0": 948,
"1024.0": 0,
"128.0": 0,
"16.0": 0,
"2.0": 474,
"2048.0": 0,
"256.0": 0,
"32.0": 0,
"4.0": 78,
"512.0": 0,
"64.0": 0,
"8.0": 0
}
},
"t0": 1550534400,
"t1": 1550620800
}
]
GET
Return the policy assigned to a client on the network
{{baseUrl}}/networks/:networkId/clients/:clientId/policy
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/policy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
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}}/networks/:networkId/clients/:clientId/policy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/policy");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
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/networks/:networkId/clients/:clientId/policy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/policy"))
.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}}/networks/:networkId/clients/:clientId/policy")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.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}}/networks/:networkId/clients/:clientId/policy');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/policy';
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}}/networks/:networkId/clients/:clientId/policy',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/policy',
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}}/networks/:networkId/clients/:clientId/policy'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
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}}/networks/:networkId/clients/:clientId/policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/policy';
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}}/networks/:networkId/clients/:clientId/policy"]
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}}/networks/:networkId/clients/:clientId/policy" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/policy",
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}}/networks/:networkId/clients/:clientId/policy');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/policy' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/policy' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/policy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
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/networks/:networkId/clients/:clientId/policy') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy";
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}}/networks/:networkId/clients/:clientId/policy
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/policy
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/policy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/policy")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"groupPolicyId": "101",
"mac": "00:11:22:33:44:55",
"type": "Group policy"
}
GET
Return the splash authorization for a client, for each SSID they've associated with through splash
{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
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/networks/:networkId/clients/:clientId/splashAuthorizationStatus HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"))
.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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus';
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus';
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"]
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus",
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
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/networks/:networkId/clients/:clientId/splashAuthorizationStatus') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus";
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ssids": {
"0": {
"authorizedAt": "2017-07-19 16:24:13 UTC",
"expiresAt": "2017-07-20 16:24:13 UTC",
"isAuthorized": true
},
"2": {
"isAuthorized": false
}
}
}
PUT
Update a client's splash authorization
{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
QUERY PARAMS
networkId
clientId
BODY json
{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus" {:content-type :json
:form-params {:ssids {:0 {:isAuthorized false}
:1 {:isAuthorized false}
:2 {:isAuthorized false}
:3 {:isAuthorized false}
:4 {:isAuthorized false}
:5 {:isAuthorized false}
:6 {:isAuthorized false}
:7 {:isAuthorized false}
:8 {:isAuthorized false}
:9 {:isAuthorized false}
:10 {:isAuthorized false}
:11 {:isAuthorized false}
:12 {:isAuthorized false}
:13 {:isAuthorized false}
:14 {:isAuthorized false}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"),
Content = new StringContent("{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
payload := strings.NewReader("{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 714
{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.setHeader("content-type", "application/json")
.setBody("{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.header("content-type", "application/json")
.body("{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}")
.asString();
const data = JSON.stringify({
ssids: {
'0': {
isAuthorized: false
},
'1': {
isAuthorized: false
},
'2': {
isAuthorized: false
},
'3': {
isAuthorized: false
},
'4': {
isAuthorized: false
},
'5': {
isAuthorized: false
},
'6': {
isAuthorized: false
},
'7': {
isAuthorized: false
},
'8': {
isAuthorized: false
},
'9': {
isAuthorized: false
},
'10': {
isAuthorized: false
},
'11': {
isAuthorized: false
},
'12': {
isAuthorized: false
},
'13': {
isAuthorized: false
},
'14': {
isAuthorized: false
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
headers: {'content-type': 'application/json'},
data: {
ssids: {
'0': {isAuthorized: false},
'1': {isAuthorized: false},
'2': {isAuthorized: false},
'3': {isAuthorized: false},
'4': {isAuthorized: false},
'5': {isAuthorized: false},
'6': {isAuthorized: false},
'7': {isAuthorized: false},
'8': {isAuthorized: false},
'9': {isAuthorized: false},
'10': {isAuthorized: false},
'11': {isAuthorized: false},
'12': {isAuthorized: false},
'13': {isAuthorized: false},
'14': {isAuthorized: false}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ssids":{"0":{"isAuthorized":false},"1":{"isAuthorized":false},"2":{"isAuthorized":false},"3":{"isAuthorized":false},"4":{"isAuthorized":false},"5":{"isAuthorized":false},"6":{"isAuthorized":false},"7":{"isAuthorized":false},"8":{"isAuthorized":false},"9":{"isAuthorized":false},"10":{"isAuthorized":false},"11":{"isAuthorized":false},"12":{"isAuthorized":false},"13":{"isAuthorized":false},"14":{"isAuthorized":false}}}'
};
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}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ssids": {\n "0": {\n "isAuthorized": false\n },\n "1": {\n "isAuthorized": false\n },\n "2": {\n "isAuthorized": false\n },\n "3": {\n "isAuthorized": false\n },\n "4": {\n "isAuthorized": false\n },\n "5": {\n "isAuthorized": false\n },\n "6": {\n "isAuthorized": false\n },\n "7": {\n "isAuthorized": false\n },\n "8": {\n "isAuthorized": false\n },\n "9": {\n "isAuthorized": false\n },\n "10": {\n "isAuthorized": false\n },\n "11": {\n "isAuthorized": false\n },\n "12": {\n "isAuthorized": false\n },\n "13": {\n "isAuthorized": false\n },\n "14": {\n "isAuthorized": false\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
ssids: {
'0': {isAuthorized: false},
'1': {isAuthorized: false},
'2': {isAuthorized: false},
'3': {isAuthorized: false},
'4': {isAuthorized: false},
'5': {isAuthorized: false},
'6': {isAuthorized: false},
'7': {isAuthorized: false},
'8': {isAuthorized: false},
'9': {isAuthorized: false},
'10': {isAuthorized: false},
'11': {isAuthorized: false},
'12': {isAuthorized: false},
'13': {isAuthorized: false},
'14': {isAuthorized: false}
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
headers: {'content-type': 'application/json'},
body: {
ssids: {
'0': {isAuthorized: false},
'1': {isAuthorized: false},
'2': {isAuthorized: false},
'3': {isAuthorized: false},
'4': {isAuthorized: false},
'5': {isAuthorized: false},
'6': {isAuthorized: false},
'7': {isAuthorized: false},
'8': {isAuthorized: false},
'9': {isAuthorized: false},
'10': {isAuthorized: false},
'11': {isAuthorized: false},
'12': {isAuthorized: false},
'13': {isAuthorized: false},
'14': {isAuthorized: false}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ssids: {
'0': {
isAuthorized: false
},
'1': {
isAuthorized: false
},
'2': {
isAuthorized: false
},
'3': {
isAuthorized: false
},
'4': {
isAuthorized: false
},
'5': {
isAuthorized: false
},
'6': {
isAuthorized: false
},
'7': {
isAuthorized: false
},
'8': {
isAuthorized: false
},
'9': {
isAuthorized: false
},
'10': {
isAuthorized: false
},
'11': {
isAuthorized: false
},
'12': {
isAuthorized: false
},
'13': {
isAuthorized: false
},
'14': {
isAuthorized: false
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus',
headers: {'content-type': 'application/json'},
data: {
ssids: {
'0': {isAuthorized: false},
'1': {isAuthorized: false},
'2': {isAuthorized: false},
'3': {isAuthorized: false},
'4': {isAuthorized: false},
'5': {isAuthorized: false},
'6': {isAuthorized: false},
'7': {isAuthorized: false},
'8': {isAuthorized: false},
'9': {isAuthorized: false},
'10': {isAuthorized: false},
'11': {isAuthorized: false},
'12': {isAuthorized: false},
'13': {isAuthorized: false},
'14': {isAuthorized: false}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ssids":{"0":{"isAuthorized":false},"1":{"isAuthorized":false},"2":{"isAuthorized":false},"3":{"isAuthorized":false},"4":{"isAuthorized":false},"5":{"isAuthorized":false},"6":{"isAuthorized":false},"7":{"isAuthorized":false},"8":{"isAuthorized":false},"9":{"isAuthorized":false},"10":{"isAuthorized":false},"11":{"isAuthorized":false},"12":{"isAuthorized":false},"13":{"isAuthorized":false},"14":{"isAuthorized":false}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ssids": @{ @"0": @{ @"isAuthorized": @NO }, @"1": @{ @"isAuthorized": @NO }, @"2": @{ @"isAuthorized": @NO }, @"3": @{ @"isAuthorized": @NO }, @"4": @{ @"isAuthorized": @NO }, @"5": @{ @"isAuthorized": @NO }, @"6": @{ @"isAuthorized": @NO }, @"7": @{ @"isAuthorized": @NO }, @"8": @{ @"isAuthorized": @NO }, @"9": @{ @"isAuthorized": @NO }, @"10": @{ @"isAuthorized": @NO }, @"11": @{ @"isAuthorized": @NO }, @"12": @{ @"isAuthorized": @NO }, @"13": @{ @"isAuthorized": @NO }, @"14": @{ @"isAuthorized": @NO } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ssids' => [
'0' => [
'isAuthorized' => null
],
'1' => [
'isAuthorized' => null
],
'2' => [
'isAuthorized' => null
],
'3' => [
'isAuthorized' => null
],
'4' => [
'isAuthorized' => null
],
'5' => [
'isAuthorized' => null
],
'6' => [
'isAuthorized' => null
],
'7' => [
'isAuthorized' => null
],
'8' => [
'isAuthorized' => null
],
'9' => [
'isAuthorized' => null
],
'10' => [
'isAuthorized' => null
],
'11' => [
'isAuthorized' => null
],
'12' => [
'isAuthorized' => null
],
'13' => [
'isAuthorized' => null
],
'14' => [
'isAuthorized' => null
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus', [
'body' => '{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ssids' => [
'0' => [
'isAuthorized' => null
],
'1' => [
'isAuthorized' => null
],
'2' => [
'isAuthorized' => null
],
'3' => [
'isAuthorized' => null
],
'4' => [
'isAuthorized' => null
],
'5' => [
'isAuthorized' => null
],
'6' => [
'isAuthorized' => null
],
'7' => [
'isAuthorized' => null
],
'8' => [
'isAuthorized' => null
],
'9' => [
'isAuthorized' => null
],
'10' => [
'isAuthorized' => null
],
'11' => [
'isAuthorized' => null
],
'12' => [
'isAuthorized' => null
],
'13' => [
'isAuthorized' => null
],
'14' => [
'isAuthorized' => null
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ssids' => [
'0' => [
'isAuthorized' => null
],
'1' => [
'isAuthorized' => null
],
'2' => [
'isAuthorized' => null
],
'3' => [
'isAuthorized' => null
],
'4' => [
'isAuthorized' => null
],
'5' => [
'isAuthorized' => null
],
'6' => [
'isAuthorized' => null
],
'7' => [
'isAuthorized' => null
],
'8' => [
'isAuthorized' => null
],
'9' => [
'isAuthorized' => null
],
'10' => [
'isAuthorized' => null
],
'11' => [
'isAuthorized' => null
],
'12' => [
'isAuthorized' => null
],
'13' => [
'isAuthorized' => null
],
'14' => [
'isAuthorized' => null
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
payload = { "ssids": {
"0": { "isAuthorized": False },
"1": { "isAuthorized": False },
"2": { "isAuthorized": False },
"3": { "isAuthorized": False },
"4": { "isAuthorized": False },
"5": { "isAuthorized": False },
"6": { "isAuthorized": False },
"7": { "isAuthorized": False },
"8": { "isAuthorized": False },
"9": { "isAuthorized": False },
"10": { "isAuthorized": False },
"11": { "isAuthorized": False },
"12": { "isAuthorized": False },
"13": { "isAuthorized": False },
"14": { "isAuthorized": False }
} }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus"
payload <- "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/clients/:clientId/splashAuthorizationStatus') do |req|
req.body = "{\n \"ssids\": {\n \"0\": {\n \"isAuthorized\": false\n },\n \"1\": {\n \"isAuthorized\": false\n },\n \"2\": {\n \"isAuthorized\": false\n },\n \"3\": {\n \"isAuthorized\": false\n },\n \"4\": {\n \"isAuthorized\": false\n },\n \"5\": {\n \"isAuthorized\": false\n },\n \"6\": {\n \"isAuthorized\": false\n },\n \"7\": {\n \"isAuthorized\": false\n },\n \"8\": {\n \"isAuthorized\": false\n },\n \"9\": {\n \"isAuthorized\": false\n },\n \"10\": {\n \"isAuthorized\": false\n },\n \"11\": {\n \"isAuthorized\": false\n },\n \"12\": {\n \"isAuthorized\": false\n },\n \"13\": {\n \"isAuthorized\": false\n },\n \"14\": {\n \"isAuthorized\": false\n }\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus";
let payload = json!({"ssids": json!({
"0": json!({"isAuthorized": false}),
"1": json!({"isAuthorized": false}),
"2": json!({"isAuthorized": false}),
"3": json!({"isAuthorized": false}),
"4": json!({"isAuthorized": false}),
"5": json!({"isAuthorized": false}),
"6": json!({"isAuthorized": false}),
"7": json!({"isAuthorized": false}),
"8": json!({"isAuthorized": false}),
"9": json!({"isAuthorized": false}),
"10": json!({"isAuthorized": false}),
"11": json!({"isAuthorized": false}),
"12": json!({"isAuthorized": false}),
"13": json!({"isAuthorized": false}),
"14": json!({"isAuthorized": false})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus \
--header 'content-type: application/json' \
--data '{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}'
echo '{
"ssids": {
"0": {
"isAuthorized": false
},
"1": {
"isAuthorized": false
},
"2": {
"isAuthorized": false
},
"3": {
"isAuthorized": false
},
"4": {
"isAuthorized": false
},
"5": {
"isAuthorized": false
},
"6": {
"isAuthorized": false
},
"7": {
"isAuthorized": false
},
"8": {
"isAuthorized": false
},
"9": {
"isAuthorized": false
},
"10": {
"isAuthorized": false
},
"11": {
"isAuthorized": false
},
"12": {
"isAuthorized": false
},
"13": {
"isAuthorized": false
},
"14": {
"isAuthorized": false
}
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ssids": {\n "0": {\n "isAuthorized": false\n },\n "1": {\n "isAuthorized": false\n },\n "2": {\n "isAuthorized": false\n },\n "3": {\n "isAuthorized": false\n },\n "4": {\n "isAuthorized": false\n },\n "5": {\n "isAuthorized": false\n },\n "6": {\n "isAuthorized": false\n },\n "7": {\n "isAuthorized": false\n },\n "8": {\n "isAuthorized": false\n },\n "9": {\n "isAuthorized": false\n },\n "10": {\n "isAuthorized": false\n },\n "11": {\n "isAuthorized": false\n },\n "12": {\n "isAuthorized": false\n },\n "13": {\n "isAuthorized": false\n },\n "14": {\n "isAuthorized": false\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ssids": [
"0": ["isAuthorized": false],
"1": ["isAuthorized": false],
"2": ["isAuthorized": false],
"3": ["isAuthorized": false],
"4": ["isAuthorized": false],
"5": ["isAuthorized": false],
"6": ["isAuthorized": false],
"7": ["isAuthorized": false],
"8": ["isAuthorized": false],
"9": ["isAuthorized": false],
"10": ["isAuthorized": false],
"11": ["isAuthorized": false],
"12": ["isAuthorized": false],
"13": ["isAuthorized": false],
"14": ["isAuthorized": false]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/splashAuthorizationStatus")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ssids": {
"0": {
"authorizedAt": "2017-07-19 16:24:13 UTC",
"expiresAt": "2017-07-20 16:24:13 UTC",
"isAuthorized": true
},
"2": {
"isAuthorized": false
}
}
}
PUT
Update the policy assigned to a client on the network
{{baseUrl}}/networks/:networkId/clients/:clientId/policy
QUERY PARAMS
networkId
clientId
BODY json
{
"devicePolicy": "",
"groupPolicyId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/policy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/clients/:clientId/policy" {:content-type :json
:form-params {:devicePolicy ""
:groupPolicyId ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/clients/:clientId/policy"),
Content = new StringContent("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/policy");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
payload := strings.NewReader("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/clients/:clientId/policy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"devicePolicy": "",
"groupPolicyId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.setHeader("content-type", "application/json")
.setBody("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/policy"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.header("content-type", "application/json")
.body("{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}")
.asString();
const data = JSON.stringify({
devicePolicy: '',
groupPolicyId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/policy',
headers: {'content-type': 'application/json'},
data: {devicePolicy: '', groupPolicyId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/policy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"devicePolicy":"","groupPolicyId":""}'
};
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}}/networks/:networkId/clients/:clientId/policy',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "devicePolicy": "",\n "groupPolicyId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/policy',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({devicePolicy: '', groupPolicyId: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/policy',
headers: {'content-type': 'application/json'},
body: {devicePolicy: '', groupPolicyId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
devicePolicy: '',
groupPolicyId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/policy',
headers: {'content-type': 'application/json'},
data: {devicePolicy: '', groupPolicyId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/policy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"devicePolicy":"","groupPolicyId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"devicePolicy": @"",
@"groupPolicyId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/clients/:clientId/policy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/clients/:clientId/policy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'devicePolicy' => '',
'groupPolicyId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/clients/:clientId/policy', [
'body' => '{
"devicePolicy": "",
"groupPolicyId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'devicePolicy' => '',
'groupPolicyId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'devicePolicy' => '',
'groupPolicyId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/policy');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/policy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"devicePolicy": "",
"groupPolicyId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/policy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"devicePolicy": "",
"groupPolicyId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/clients/:clientId/policy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
payload = {
"devicePolicy": "",
"groupPolicyId": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/policy"
payload <- "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/clients/:clientId/policy') do |req|
req.body = "{\n \"devicePolicy\": \"\",\n \"groupPolicyId\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/policy";
let payload = json!({
"devicePolicy": "",
"groupPolicyId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/clients/:clientId/policy \
--header 'content-type: application/json' \
--data '{
"devicePolicy": "",
"groupPolicyId": ""
}'
echo '{
"devicePolicy": "",
"groupPolicyId": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/clients/:clientId/policy \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "devicePolicy": "",\n "groupPolicyId": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/policy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"devicePolicy": "",
"groupPolicyId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/policy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"groupPolicyId": "101",
"mac": "00:11:22:33:44:55",
"type": "Group policy"
}
GET
List the configuration templates for this organization
{{baseUrl}}/organizations/:organizationId/configTemplates
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/configTemplates");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/configTemplates")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/configTemplates"
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}}/organizations/:organizationId/configTemplates"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/configTemplates");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/configTemplates"
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/organizations/:organizationId/configTemplates HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/configTemplates")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/configTemplates"))
.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}}/organizations/:organizationId/configTemplates")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/configTemplates")
.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}}/organizations/:organizationId/configTemplates');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/configTemplates'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates';
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}}/organizations/:organizationId/configTemplates',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/configTemplates")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/configTemplates',
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}}/organizations/:organizationId/configTemplates'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/configTemplates');
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}}/organizations/:organizationId/configTemplates'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates';
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}}/organizations/:organizationId/configTemplates"]
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}}/organizations/:organizationId/configTemplates" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/configTemplates",
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}}/organizations/:organizationId/configTemplates');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/configTemplates');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/configTemplates');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/configTemplates")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/configTemplates"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/configTemplates"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/configTemplates")
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/organizations/:organizationId/configTemplates') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/configTemplates";
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}}/organizations/:organizationId/configTemplates
http GET {{baseUrl}}/organizations/:organizationId/configTemplates
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/configTemplates
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/configTemplates")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "N_24329156",
"name": "My config template",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"timeZone": "America/Los_Angeles"
}
]
DELETE
Remove a configuration template
{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId
QUERY PARAMS
organizationId
configTemplateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId"
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}}/organizations/:organizationId/configTemplates/:configTemplateId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId"
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/organizations/:organizationId/configTemplates/:configTemplateId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId"))
.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}}/organizations/:organizationId/configTemplates/:configTemplateId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")
.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}}/organizations/:organizationId/configTemplates/:configTemplateId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId';
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}}/organizations/:organizationId/configTemplates/:configTemplateId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/configTemplates/:configTemplateId',
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}}/organizations/:organizationId/configTemplates/:configTemplateId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId');
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}}/organizations/:organizationId/configTemplates/:configTemplateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId';
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}}/organizations/:organizationId/configTemplates/:configTemplateId"]
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}}/organizations/:organizationId/configTemplates/:configTemplateId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId",
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}}/organizations/:organizationId/configTemplates/:configTemplateId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationId/configTemplates/:configTemplateId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")
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/organizations/:organizationId/configTemplates/:configTemplateId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId";
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}}/organizations/:organizationId/configTemplates/:configTemplateId
http DELETE {{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId")! 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
List all available content filtering categories for an MX network
{{baseUrl}}/networks/:networkId/contentFiltering/categories
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/contentFiltering/categories");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/contentFiltering/categories")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/contentFiltering/categories"
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}}/networks/:networkId/contentFiltering/categories"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/contentFiltering/categories");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/contentFiltering/categories"
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/networks/:networkId/contentFiltering/categories HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/contentFiltering/categories")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/contentFiltering/categories"))
.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}}/networks/:networkId/contentFiltering/categories")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/contentFiltering/categories")
.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}}/networks/:networkId/contentFiltering/categories');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/contentFiltering/categories'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/contentFiltering/categories';
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}}/networks/:networkId/contentFiltering/categories',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/contentFiltering/categories")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/contentFiltering/categories',
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}}/networks/:networkId/contentFiltering/categories'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/contentFiltering/categories');
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}}/networks/:networkId/contentFiltering/categories'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/contentFiltering/categories';
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}}/networks/:networkId/contentFiltering/categories"]
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}}/networks/:networkId/contentFiltering/categories" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/contentFiltering/categories",
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}}/networks/:networkId/contentFiltering/categories');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/contentFiltering/categories');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/contentFiltering/categories');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/contentFiltering/categories' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/contentFiltering/categories' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/contentFiltering/categories")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/contentFiltering/categories"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/contentFiltering/categories"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/contentFiltering/categories")
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/networks/:networkId/contentFiltering/categories') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/contentFiltering/categories";
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}}/networks/:networkId/contentFiltering/categories
http GET {{baseUrl}}/networks/:networkId/contentFiltering/categories
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/contentFiltering/categories
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/contentFiltering/categories")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"categories": [
{
"id": "meraki:contentFiltering/category/1",
"name": "Real Estate"
},
{
"id": "meraki:contentFiltering/category/3",
"name": "Financial Services"
},
"...",
{
"id": "meraki:contentFiltering/category/11",
"name": "Adult and Pornography"
}
]
}
GET
Return the content filtering settings for an MX network
{{baseUrl}}/networks/:networkId/contentFiltering
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/contentFiltering");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/contentFiltering")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/contentFiltering"
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}}/networks/:networkId/contentFiltering"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/contentFiltering");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/contentFiltering"
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/networks/:networkId/contentFiltering HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/contentFiltering")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/contentFiltering"))
.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}}/networks/:networkId/contentFiltering")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/contentFiltering")
.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}}/networks/:networkId/contentFiltering');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/contentFiltering'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/contentFiltering';
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}}/networks/:networkId/contentFiltering',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/contentFiltering")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/contentFiltering',
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}}/networks/:networkId/contentFiltering'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/contentFiltering');
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}}/networks/:networkId/contentFiltering'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/contentFiltering';
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}}/networks/:networkId/contentFiltering"]
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}}/networks/:networkId/contentFiltering" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/contentFiltering",
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}}/networks/:networkId/contentFiltering');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/contentFiltering');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/contentFiltering');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/contentFiltering' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/contentFiltering' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/contentFiltering")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/contentFiltering"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/contentFiltering"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/contentFiltering")
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/networks/:networkId/contentFiltering') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/contentFiltering";
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}}/networks/:networkId/contentFiltering
http GET {{baseUrl}}/networks/:networkId/contentFiltering
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/contentFiltering
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/contentFiltering")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"allowedUrlPatterns": [
"http://www.example.org",
"http://help.com.au"
],
"blockedUrlCategories": [
{
"id": "meraki:contentFiltering/category/1",
"name": "Real Estate"
},
{
"id": "meraki:contentFiltering/category/7",
"name": "Shopping"
}
],
"blockedUrlPatterns": [
"http://www.example.com",
"http://www.betting.com"
],
"urlCategoryListSize": "topSites"
}
PUT
Update the content filtering settings for an MX network
{{baseUrl}}/networks/:networkId/contentFiltering
QUERY PARAMS
networkId
BODY json
{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/contentFiltering");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/contentFiltering" {:content-type :json
:form-params {:allowedUrlPatterns []
:blockedUrlCategories []
:blockedUrlPatterns []
:urlCategoryListSize ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/contentFiltering"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/contentFiltering"),
Content = new StringContent("{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/contentFiltering");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/contentFiltering"
payload := strings.NewReader("{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/contentFiltering HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/contentFiltering")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/contentFiltering"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/contentFiltering")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/contentFiltering")
.header("content-type", "application/json")
.body("{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/contentFiltering');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/contentFiltering',
headers: {'content-type': 'application/json'},
data: {
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/contentFiltering';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowedUrlPatterns":[],"blockedUrlCategories":[],"blockedUrlPatterns":[],"urlCategoryListSize":""}'
};
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}}/networks/:networkId/contentFiltering',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowedUrlPatterns": [],\n "blockedUrlCategories": [],\n "blockedUrlPatterns": [],\n "urlCategoryListSize": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/contentFiltering")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/contentFiltering',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/contentFiltering',
headers: {'content-type': 'application/json'},
body: {
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/contentFiltering');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/contentFiltering',
headers: {'content-type': 'application/json'},
data: {
allowedUrlPatterns: [],
blockedUrlCategories: [],
blockedUrlPatterns: [],
urlCategoryListSize: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/contentFiltering';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowedUrlPatterns":[],"blockedUrlCategories":[],"blockedUrlPatterns":[],"urlCategoryListSize":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"allowedUrlPatterns": @[ ],
@"blockedUrlCategories": @[ ],
@"blockedUrlPatterns": @[ ],
@"urlCategoryListSize": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/contentFiltering"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/contentFiltering" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/contentFiltering",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowedUrlPatterns' => [
],
'blockedUrlCategories' => [
],
'blockedUrlPatterns' => [
],
'urlCategoryListSize' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/contentFiltering', [
'body' => '{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/contentFiltering');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowedUrlPatterns' => [
],
'blockedUrlCategories' => [
],
'blockedUrlPatterns' => [
],
'urlCategoryListSize' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowedUrlPatterns' => [
],
'blockedUrlCategories' => [
],
'blockedUrlPatterns' => [
],
'urlCategoryListSize' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/contentFiltering');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/contentFiltering' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/contentFiltering' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/contentFiltering", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/contentFiltering"
payload = {
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/contentFiltering"
payload <- "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/contentFiltering")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/contentFiltering') do |req|
req.body = "{\n \"allowedUrlPatterns\": [],\n \"blockedUrlCategories\": [],\n \"blockedUrlPatterns\": [],\n \"urlCategoryListSize\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/contentFiltering";
let payload = json!({
"allowedUrlPatterns": (),
"blockedUrlCategories": (),
"blockedUrlPatterns": (),
"urlCategoryListSize": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/contentFiltering \
--header 'content-type: application/json' \
--data '{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}'
echo '{
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/contentFiltering \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allowedUrlPatterns": [],\n "blockedUrlCategories": [],\n "blockedUrlPatterns": [],\n "urlCategoryListSize": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/contentFiltering
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowedUrlPatterns": [],
"blockedUrlCategories": [],
"blockedUrlPatterns": [],
"urlCategoryListSize": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/contentFiltering")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"allowedUrlPatterns": [
"http://www.example.org",
"http://help.com.au"
],
"blockedUrlCategories": [
{
"id": "meraki:contentFiltering/category/1",
"name": "Real Estate"
},
{
"id": "meraki:contentFiltering/category/7",
"name": "Shopping"
}
],
"blockedUrlPatterns": [
"http://www.example.com",
"http://www.betting.com"
],
"urlCategoryListSize": "topSites"
}
POST
Claim devices into a network. (Note- for recently claimed devices, it may take a few minutes for API requests against that device to succeed)
{{baseUrl}}/networks/:networkId/devices/claim
QUERY PARAMS
networkId
BODY json
{
"serial": "",
"serials": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/claim");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/devices/claim" {:content-type :json
:form-params {:serials ["Q234-ABCD-0001" "Q234-ABCD-0002" "Q234-ABCD-0003"]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/claim"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/devices/claim"),
Content = new StringContent("{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/claim");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/claim"
payload := strings.NewReader("{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/devices/claim HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 87
{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/devices/claim")
.setHeader("content-type", "application/json")
.setBody("{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/claim"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/claim")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/devices/claim")
.header("content-type", "application/json")
.body("{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}")
.asString();
const data = JSON.stringify({
serials: [
'Q234-ABCD-0001',
'Q234-ABCD-0002',
'Q234-ABCD-0003'
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/devices/claim');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/claim',
headers: {'content-type': 'application/json'},
data: {serials: ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003']}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/claim';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serials":["Q234-ABCD-0001","Q234-ABCD-0002","Q234-ABCD-0003"]}'
};
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}}/networks/:networkId/devices/claim',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "serials": [\n "Q234-ABCD-0001",\n "Q234-ABCD-0002",\n "Q234-ABCD-0003"\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/claim")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/claim',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({serials: ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003']}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/claim',
headers: {'content-type': 'application/json'},
body: {serials: ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003']},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/devices/claim');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
serials: [
'Q234-ABCD-0001',
'Q234-ABCD-0002',
'Q234-ABCD-0003'
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/claim',
headers: {'content-type': 'application/json'},
data: {serials: ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003']}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/claim';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serials":["Q234-ABCD-0001","Q234-ABCD-0002","Q234-ABCD-0003"]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"serials": @[ @"Q234-ABCD-0001", @"Q234-ABCD-0002", @"Q234-ABCD-0003" ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/devices/claim"]
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}}/networks/:networkId/devices/claim" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/claim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'serials' => [
'Q234-ABCD-0001',
'Q234-ABCD-0002',
'Q234-ABCD-0003'
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/devices/claim', [
'body' => '{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/claim');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'serials' => [
'Q234-ABCD-0001',
'Q234-ABCD-0002',
'Q234-ABCD-0003'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'serials' => [
'Q234-ABCD-0001',
'Q234-ABCD-0002',
'Q234-ABCD-0003'
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/devices/claim');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/claim' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/claim' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/devices/claim", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/claim"
payload = { "serials": ["Q234-ABCD-0001", "Q234-ABCD-0002", "Q234-ABCD-0003"] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/claim"
payload <- "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/devices/claim') do |req|
req.body = "{\n \"serials\": [\n \"Q234-ABCD-0001\",\n \"Q234-ABCD-0002\",\n \"Q234-ABCD-0003\"\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/claim";
let payload = json!({"serials": ("Q234-ABCD-0001", "Q234-ABCD-0002", "Q234-ABCD-0003")});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/devices/claim \
--header 'content-type: application/json' \
--data '{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}'
echo '{
"serials": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
}' | \
http POST {{baseUrl}}/networks/:networkId/devices/claim \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "serials": [\n "Q234-ABCD-0001",\n "Q234-ABCD-0002",\n "Q234-ABCD-0003"\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/claim
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["serials": ["Q234-ABCD-0001", "Q234-ABCD-0002", "Q234-ABCD-0003"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/claim")! 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
Cycle a set of switch ports
{{baseUrl}}/devices/:serial/switch/ports/cycle
QUERY PARAMS
serial
BODY json
{
"ports": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/switch/ports/cycle");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ports\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/devices/:serial/switch/ports/cycle" {:content-type :json
:form-params {:ports []}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/switch/ports/cycle"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ports\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/switch/ports/cycle"),
Content = new StringContent("{\n \"ports\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/switch/ports/cycle");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ports\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/switch/ports/cycle"
payload := strings.NewReader("{\n \"ports\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/devices/:serial/switch/ports/cycle HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"ports": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/devices/:serial/switch/ports/cycle")
.setHeader("content-type", "application/json")
.setBody("{\n \"ports\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/switch/ports/cycle"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ports\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ports\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/switch/ports/cycle")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/devices/:serial/switch/ports/cycle")
.header("content-type", "application/json")
.body("{\n \"ports\": []\n}")
.asString();
const data = JSON.stringify({
ports: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/devices/:serial/switch/ports/cycle');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/devices/:serial/switch/ports/cycle',
headers: {'content-type': 'application/json'},
data: {ports: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/switch/ports/cycle';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ports":[]}'
};
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}}/devices/:serial/switch/ports/cycle',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ports": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ports\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/switch/ports/cycle")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/switch/ports/cycle',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ports: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/devices/:serial/switch/ports/cycle',
headers: {'content-type': 'application/json'},
body: {ports: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/devices/:serial/switch/ports/cycle');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ports: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/devices/:serial/switch/ports/cycle',
headers: {'content-type': 'application/json'},
data: {ports: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/switch/ports/cycle';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ports":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ports": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/switch/ports/cycle"]
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}}/devices/:serial/switch/ports/cycle" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ports\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/switch/ports/cycle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ports' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/devices/:serial/switch/ports/cycle', [
'body' => '{
"ports": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/switch/ports/cycle');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ports' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ports' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/switch/ports/cycle');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/switch/ports/cycle' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ports": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/switch/ports/cycle' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ports": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ports\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/devices/:serial/switch/ports/cycle", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/switch/ports/cycle"
payload = { "ports": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/switch/ports/cycle"
payload <- "{\n \"ports\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/switch/ports/cycle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ports\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/devices/:serial/switch/ports/cycle') do |req|
req.body = "{\n \"ports\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/switch/ports/cycle";
let payload = json!({"ports": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/devices/:serial/switch/ports/cycle \
--header 'content-type: application/json' \
--data '{
"ports": []
}'
echo '{
"ports": []
}' | \
http POST {{baseUrl}}/devices/:serial/switch/ports/cycle \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ports": []\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/switch/ports/cycle
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ports": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/switch/ports/cycle")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ports": [
"1",
"2-5",
"1_MA-MOD-8X10G_1",
"1_MA-MOD-8X10G_2-1_MA-MOD-8X10G_8"
]
}
GET
Get the uplink loss percentage and latency in milliseconds for a wired network device.
{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory
QUERY PARAMS
ip
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory" {:query-params {:ip ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip="
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip="
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/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip="))
.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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
.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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory',
params: {ip: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=';
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=',
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory',
qs: {ip: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory');
req.query({
ip: ''
});
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory',
params: {ip: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=';
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip="]
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=",
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}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'ip' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'ip' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory"
querystring = {"ip":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory"
queryString <- list(ip = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")
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/networks/:networkId/devices/:serial/lossAndLatencyHistory') do |req|
req.params['ip'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory";
let querystring = [
("ip", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip='
http GET '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/lossAndLatencyHistory?ip=")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"endTime": "2018-10-09T22:19:27Z",
"latencyMs": 324.12,
"lossPercent": 5.23,
"startTime": "2018-10-09T22:18:27Z"
},
{
"endTime": "2018-10-09T22:20:27Z",
"latencyMs": 43,
"lossPercent": 1,
"startTime": "2018-10-09T22:19:27Z"
},
{
"endTime": "2018-10-09T22:21:27Z",
"latencyMs": 44.02,
"lossPercent": 0.01,
"startTime": "2018-10-09T22:20:27Z"
}
]
GET
List the devices in a network
{{baseUrl}}/networks/:networkId/devices
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices"
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}}/networks/:networkId/devices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices"
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/networks/:networkId/devices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices"))
.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}}/networks/:networkId/devices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices")
.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}}/networks/:networkId/devices');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/devices'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices';
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}}/networks/:networkId/devices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices',
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}}/networks/:networkId/devices'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices');
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}}/networks/:networkId/devices'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices';
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}}/networks/:networkId/devices"]
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}}/networks/:networkId/devices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices",
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}}/networks/:networkId/devices');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices")
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/networks/:networkId/devices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices";
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}}/networks/:networkId/devices
http GET {{baseUrl}}/networks/:networkId/devices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
]
GET
List the devices in an organization
{{baseUrl}}/organizations/:organizationId/devices
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/devices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/devices")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/devices"
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}}/organizations/:organizationId/devices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/devices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/devices"
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/organizations/:organizationId/devices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/devices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/devices"))
.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}}/organizations/:organizationId/devices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/devices")
.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}}/organizations/:organizationId/devices');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/devices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/devices';
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}}/organizations/:organizationId/devices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/devices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/devices',
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}}/organizations/:organizationId/devices'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/devices');
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}}/organizations/:organizationId/devices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/devices';
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}}/organizations/:organizationId/devices"]
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}}/organizations/:organizationId/devices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/devices",
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}}/organizations/:organizationId/devices');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/devices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/devices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/devices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/devices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/devices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/devices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/devices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/devices")
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/organizations/:organizationId/devices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/devices";
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}}/organizations/:organizationId/devices
http GET {{baseUrl}}/organizations/:organizationId/devices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/devices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/devices")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"address": "1600 Pennsylvania Ave",
"firmware": "wireless-25-14",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
]
POST
Reboot a device
{{baseUrl}}/networks/:networkId/devices/:serial/reboot
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/reboot");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/devices/:serial/reboot")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/reboot"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/devices/:serial/reboot"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/reboot");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/reboot"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/devices/:serial/reboot HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/devices/:serial/reboot")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/reboot"))
.method("POST", 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}}/networks/:networkId/devices/:serial/reboot")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/devices/:serial/reboot")
.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('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/reboot');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/reboot'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/reboot';
const options = {method: 'POST'};
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}}/networks/:networkId/devices/:serial/reboot',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/reboot")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/reboot',
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: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/reboot'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/reboot');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/reboot'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/reboot';
const options = {method: 'POST'};
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}}/networks/:networkId/devices/:serial/reboot"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/devices/:serial/reboot" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/reboot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/reboot');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/reboot');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/reboot');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/reboot' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/reboot' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/devices/:serial/reboot")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/reboot"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/reboot"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/reboot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/devices/:serial/reboot') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/reboot";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/devices/:serial/reboot
http POST {{baseUrl}}/networks/:networkId/devices/:serial/reboot
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/reboot
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/reboot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
POST
Remove a single device
{{baseUrl}}/networks/:networkId/devices/:serial/remove
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/remove");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/devices/:serial/remove")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/remove"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/devices/:serial/remove"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/remove");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/remove"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/devices/:serial/remove HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/devices/:serial/remove")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/remove"))
.method("POST", 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}}/networks/:networkId/devices/:serial/remove")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/devices/:serial/remove")
.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('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/remove');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/remove'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/remove';
const options = {method: 'POST'};
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}}/networks/:networkId/devices/:serial/remove',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/remove")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/remove',
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: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/remove'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/remove');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/remove'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/remove';
const options = {method: 'POST'};
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}}/networks/:networkId/devices/:serial/remove"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/devices/:serial/remove" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/remove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/devices/:serial/remove');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/remove');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/remove');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/remove' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/remove' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/devices/:serial/remove")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/remove"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/remove"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/remove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/devices/:serial/remove') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/remove";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/devices/:serial/remove
http POST {{baseUrl}}/networks/:networkId/devices/:serial/remove
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/remove
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/remove")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
Return a single device
{{baseUrl}}/networks/:networkId/devices/:serial
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial"
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}}/networks/:networkId/devices/:serial"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial"
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/networks/:networkId/devices/:serial HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial"))
.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}}/networks/:networkId/devices/:serial")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial")
.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}}/networks/:networkId/devices/:serial');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial';
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}}/networks/:networkId/devices/:serial',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial',
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}}/networks/:networkId/devices/:serial'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial');
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}}/networks/:networkId/devices/:serial'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial';
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}}/networks/:networkId/devices/:serial"]
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}}/networks/:networkId/devices/:serial" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial",
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}}/networks/:networkId/devices/:serial');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial")
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/networks/:networkId/devices/:serial') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial";
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}}/networks/:networkId/devices/:serial
http GET {{baseUrl}}/networks/:networkId/devices/:serial
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
GET
Return the performance score for a single MX
{{baseUrl}}/networks/:networkId/devices/:serial/performance
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/performance");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/performance")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/performance"
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}}/networks/:networkId/devices/:serial/performance"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/performance");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/performance"
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/networks/:networkId/devices/:serial/performance HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/performance")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/performance"))
.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}}/networks/:networkId/devices/:serial/performance")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/performance")
.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}}/networks/:networkId/devices/:serial/performance');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/performance'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/performance';
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}}/networks/:networkId/devices/:serial/performance',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/performance")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/performance',
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}}/networks/:networkId/devices/:serial/performance'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/performance');
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}}/networks/:networkId/devices/:serial/performance'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/performance';
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}}/networks/:networkId/devices/:serial/performance"]
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}}/networks/:networkId/devices/:serial/performance" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/performance",
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}}/networks/:networkId/devices/:serial/performance');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/performance');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/performance');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/performance' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/performance' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/performance")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/performance"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/performance"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/performance")
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/networks/:networkId/devices/:serial/performance') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/performance";
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}}/networks/:networkId/devices/:serial/performance
http GET {{baseUrl}}/networks/:networkId/devices/:serial/performance
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/performance
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/performance")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"perfScore": 10
}
GET
Return the uplink information for a device.
{{baseUrl}}/networks/:networkId/devices/:serial/uplink
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/uplink");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/uplink")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/uplink"
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}}/networks/:networkId/devices/:serial/uplink"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/uplink");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/uplink"
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/networks/:networkId/devices/:serial/uplink HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/uplink")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/uplink"))
.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}}/networks/:networkId/devices/:serial/uplink")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/uplink")
.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}}/networks/:networkId/devices/:serial/uplink');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/uplink'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/uplink';
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}}/networks/:networkId/devices/:serial/uplink',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/uplink")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/uplink',
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}}/networks/:networkId/devices/:serial/uplink'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/uplink');
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}}/networks/:networkId/devices/:serial/uplink'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/uplink';
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}}/networks/:networkId/devices/:serial/uplink"]
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}}/networks/:networkId/devices/:serial/uplink" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/uplink",
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}}/networks/:networkId/devices/:serial/uplink');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/uplink');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/uplink');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/uplink' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/uplink' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/uplink")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/uplink"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/uplink"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/uplink")
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/networks/:networkId/devices/:serial/uplink') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/uplink";
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}}/networks/:networkId/devices/:serial/uplink
http GET {{baseUrl}}/networks/:networkId/devices/:serial/uplink
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/uplink
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/uplink")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"dns": "8.8.8.8, 8.8.4.4",
"gateway": "1.2.3.5",
"interface": "WAN 1",
"ip": "1.2.3.4",
"publicIp": "123.123.123.1",
"status": "Active",
"usingStaticIp": false
}
]
PUT
Update the attributes of a device
{{baseUrl}}/networks/:networkId/devices/:serial
QUERY PARAMS
networkId
serial
BODY json
{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/devices/:serial" {:content-type :json
:form-params {:address ""
:floorPlanId ""
:lat ""
:lng ""
:moveMapMarker false
:name ""
:notes ""
:switchProfileId ""
:tags ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/devices/:serial"),
Content = new StringContent("{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial"
payload := strings.NewReader("{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/devices/:serial HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 160
{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/devices/:serial")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/devices/:serial")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/devices/:serial');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/devices/:serial',
headers: {'content-type': 'application/json'},
data: {
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","floorPlanId":"","lat":"","lng":"","moveMapMarker":false,"name":"","notes":"","switchProfileId":"","tags":""}'
};
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}}/networks/:networkId/devices/:serial',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "floorPlanId": "",\n "lat": "",\n "lng": "",\n "moveMapMarker": false,\n "name": "",\n "notes": "",\n "switchProfileId": "",\n "tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/devices/:serial',
headers: {'content-type': 'application/json'},
body: {
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/devices/:serial');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/devices/:serial',
headers: {'content-type': 'application/json'},
data: {
address: '',
floorPlanId: '',
lat: '',
lng: '',
moveMapMarker: false,
name: '',
notes: '',
switchProfileId: '',
tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","floorPlanId":"","lat":"","lng":"","moveMapMarker":false,"name":"","notes":"","switchProfileId":"","tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"floorPlanId": @"",
@"lat": @"",
@"lng": @"",
@"moveMapMarker": @NO,
@"name": @"",
@"notes": @"",
@"switchProfileId": @"",
@"tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/devices/:serial"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/devices/:serial" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'floorPlanId' => '',
'lat' => '',
'lng' => '',
'moveMapMarker' => null,
'name' => '',
'notes' => '',
'switchProfileId' => '',
'tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/devices/:serial', [
'body' => '{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'floorPlanId' => '',
'lat' => '',
'lng' => '',
'moveMapMarker' => null,
'name' => '',
'notes' => '',
'switchProfileId' => '',
'tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'floorPlanId' => '',
'lat' => '',
'lng' => '',
'moveMapMarker' => null,
'name' => '',
'notes' => '',
'switchProfileId' => '',
'tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/devices/:serial", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial"
payload = {
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": False,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial"
payload <- "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/devices/:serial') do |req|
req.body = "{\n \"address\": \"\",\n \"floorPlanId\": \"\",\n \"lat\": \"\",\n \"lng\": \"\",\n \"moveMapMarker\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"switchProfileId\": \"\",\n \"tags\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial";
let payload = json!({
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/devices/:serial \
--header 'content-type: application/json' \
--data '{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}'
echo '{
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/devices/:serial \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "floorPlanId": "",\n "lat": "",\n "lng": "",\n "moveMapMarker": false,\n "name": "",\n "notes": "",\n "switchProfileId": "",\n "tags": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"floorPlanId": "",
"lat": "",
"lng": "",
"moveMapMarker": false,
"name": "",
"notes": "",
"switchProfileId": "",
"tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
GET
List the event type to human-readable description
{{baseUrl}}/networks/:networkId/events/eventTypes
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/events/eventTypes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/events/eventTypes")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/events/eventTypes"
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}}/networks/:networkId/events/eventTypes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/events/eventTypes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/events/eventTypes"
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/networks/:networkId/events/eventTypes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/events/eventTypes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/events/eventTypes"))
.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}}/networks/:networkId/events/eventTypes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/events/eventTypes")
.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}}/networks/:networkId/events/eventTypes');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/events/eventTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/events/eventTypes';
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}}/networks/:networkId/events/eventTypes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/events/eventTypes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/events/eventTypes',
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}}/networks/:networkId/events/eventTypes'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/events/eventTypes');
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}}/networks/:networkId/events/eventTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/events/eventTypes';
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}}/networks/:networkId/events/eventTypes"]
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}}/networks/:networkId/events/eventTypes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/events/eventTypes",
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}}/networks/:networkId/events/eventTypes');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/events/eventTypes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/events/eventTypes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/events/eventTypes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/events/eventTypes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/events/eventTypes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/events/eventTypes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/events/eventTypes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/events/eventTypes")
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/networks/:networkId/events/eventTypes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/events/eventTypes";
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}}/networks/:networkId/events/eventTypes
http GET {{baseUrl}}/networks/:networkId/events/eventTypes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/events/eventTypes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/events/eventTypes")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"category": "802.11",
"description": "802.11 association",
"type": "association"
}
]
GET
List the events for the network
{{baseUrl}}/networks/:networkId/events
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/events");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/events")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/events"
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}}/networks/:networkId/events"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/events");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/events"
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/networks/:networkId/events HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/events")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/events"))
.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}}/networks/:networkId/events")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/events")
.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}}/networks/:networkId/events');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/events'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/events';
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}}/networks/:networkId/events',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/events")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/events',
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}}/networks/:networkId/events'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/events');
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}}/networks/:networkId/events'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/events';
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}}/networks/:networkId/events"]
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}}/networks/:networkId/events" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/events",
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}}/networks/:networkId/events');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/events');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/events');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/events' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/events' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/events")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/events"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/events"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/events")
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/networks/:networkId/events') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/events";
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}}/networks/:networkId/events
http GET {{baseUrl}}/networks/:networkId/events
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/events
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/events")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"events": [
{
"clientDescription": "Miles's phone",
"clientId": "k74272e",
"clientMac": "22:33:44:55:66:77",
"description": "802.11 association",
"deviceName": "My AP",
"deviceSerial": "Q234-ABCD-5678",
"eventData": {
"aid": "2104009183",
"channel": "36",
"client_ip": "1.2.3.4",
"client_mac": "22:33:44:55:66:77",
"radio": "1",
"rssi": "12",
"vap": "1"
},
"networkId": "N_24329156",
"occurredAt": "2018-02-11T00:00:00.090210Z",
"ssidName": "My SSID",
"ssidNumber": 1,
"type": "association"
}
],
"message": "Some error",
"pageEndAt": "2018-02-11T00:00:00.090210Z",
"pageStartAt": "2018-02-11T00:00:00.090210Z"
}
GET
List the appliance services and their accessibility rules
{{baseUrl}}/networks/:networkId/firewalledServices
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/firewalledServices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/firewalledServices")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/firewalledServices"
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}}/networks/:networkId/firewalledServices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/firewalledServices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/firewalledServices"
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/networks/:networkId/firewalledServices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/firewalledServices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/firewalledServices"))
.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}}/networks/:networkId/firewalledServices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/firewalledServices")
.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}}/networks/:networkId/firewalledServices');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/firewalledServices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/firewalledServices';
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}}/networks/:networkId/firewalledServices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/firewalledServices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/firewalledServices',
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}}/networks/:networkId/firewalledServices'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/firewalledServices');
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}}/networks/:networkId/firewalledServices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/firewalledServices';
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}}/networks/:networkId/firewalledServices"]
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}}/networks/:networkId/firewalledServices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/firewalledServices",
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}}/networks/:networkId/firewalledServices');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/firewalledServices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/firewalledServices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/firewalledServices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/firewalledServices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/firewalledServices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/firewalledServices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/firewalledServices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/firewalledServices")
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/networks/:networkId/firewalledServices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/firewalledServices";
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}}/networks/:networkId/firewalledServices
http GET {{baseUrl}}/networks/:networkId/firewalledServices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/firewalledServices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/firewalledServices")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"access": "restricted",
"allowedIps": [
"123.123.123.1"
],
"service": "web"
}
]
GET
Return the accessibility settings of the given service ('ICMP', 'web', or 'SNMP')
{{baseUrl}}/networks/:networkId/firewalledServices/:service
QUERY PARAMS
networkId
service
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/firewalledServices/:service");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/firewalledServices/:service")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
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}}/networks/:networkId/firewalledServices/:service"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/firewalledServices/:service");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
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/networks/:networkId/firewalledServices/:service HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/firewalledServices/:service"))
.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}}/networks/:networkId/firewalledServices/:service")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.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}}/networks/:networkId/firewalledServices/:service');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/firewalledServices/:service'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/firewalledServices/:service';
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}}/networks/:networkId/firewalledServices/:service',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/firewalledServices/:service',
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}}/networks/:networkId/firewalledServices/:service'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/firewalledServices/:service');
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}}/networks/:networkId/firewalledServices/:service'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/firewalledServices/:service';
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}}/networks/:networkId/firewalledServices/:service"]
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}}/networks/:networkId/firewalledServices/:service" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/firewalledServices/:service",
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}}/networks/:networkId/firewalledServices/:service');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/firewalledServices/:service');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/firewalledServices/:service');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/firewalledServices/:service' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/firewalledServices/:service' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/firewalledServices/:service")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
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/networks/:networkId/firewalledServices/:service') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service";
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}}/networks/:networkId/firewalledServices/:service
http GET {{baseUrl}}/networks/:networkId/firewalledServices/:service
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/firewalledServices/:service
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/firewalledServices/:service")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"access": "restricted",
"allowedIps": [
"123.123.123.1"
],
"service": "web"
}
PUT
Updates the accessibility settings for the given service ('ICMP', 'web', or 'SNMP')
{{baseUrl}}/networks/:networkId/firewalledServices/:service
QUERY PARAMS
networkId
service
BODY json
{
"access": "",
"allowedIps": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/firewalledServices/:service");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"access\": \"\",\n \"allowedIps\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/firewalledServices/:service" {:content-type :json
:form-params {:access ""
:allowedIps []}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"access\": \"\",\n \"allowedIps\": []\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/firewalledServices/:service"),
Content = new StringContent("{\n \"access\": \"\",\n \"allowedIps\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/firewalledServices/:service");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"access\": \"\",\n \"allowedIps\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
payload := strings.NewReader("{\n \"access\": \"\",\n \"allowedIps\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/firewalledServices/:service HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"access": "",
"allowedIps": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.setHeader("content-type", "application/json")
.setBody("{\n \"access\": \"\",\n \"allowedIps\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/firewalledServices/:service"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"access\": \"\",\n \"allowedIps\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"access\": \"\",\n \"allowedIps\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.header("content-type", "application/json")
.body("{\n \"access\": \"\",\n \"allowedIps\": []\n}")
.asString();
const data = JSON.stringify({
access: '',
allowedIps: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/firewalledServices/:service');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/firewalledServices/:service',
headers: {'content-type': 'application/json'},
data: {access: '', allowedIps: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/firewalledServices/:service';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"access":"","allowedIps":[]}'
};
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}}/networks/:networkId/firewalledServices/:service',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "access": "",\n "allowedIps": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"access\": \"\",\n \"allowedIps\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/firewalledServices/:service',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({access: '', allowedIps: []}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/firewalledServices/:service',
headers: {'content-type': 'application/json'},
body: {access: '', allowedIps: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/firewalledServices/:service');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
access: '',
allowedIps: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/firewalledServices/:service',
headers: {'content-type': 'application/json'},
data: {access: '', allowedIps: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/firewalledServices/:service';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"access":"","allowedIps":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"access": @"",
@"allowedIps": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/firewalledServices/:service"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/firewalledServices/:service" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"access\": \"\",\n \"allowedIps\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/firewalledServices/:service",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'access' => '',
'allowedIps' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/firewalledServices/:service', [
'body' => '{
"access": "",
"allowedIps": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/firewalledServices/:service');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'access' => '',
'allowedIps' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'access' => '',
'allowedIps' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/firewalledServices/:service');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/firewalledServices/:service' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"access": "",
"allowedIps": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/firewalledServices/:service' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"access": "",
"allowedIps": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"access\": \"\",\n \"allowedIps\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/firewalledServices/:service", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
payload = {
"access": "",
"allowedIps": []
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/firewalledServices/:service"
payload <- "{\n \"access\": \"\",\n \"allowedIps\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/firewalledServices/:service")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"access\": \"\",\n \"allowedIps\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/firewalledServices/:service') do |req|
req.body = "{\n \"access\": \"\",\n \"allowedIps\": []\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/firewalledServices/:service";
let payload = json!({
"access": "",
"allowedIps": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/firewalledServices/:service \
--header 'content-type: application/json' \
--data '{
"access": "",
"allowedIps": []
}'
echo '{
"access": "",
"allowedIps": []
}' | \
http PUT {{baseUrl}}/networks/:networkId/firewalledServices/:service \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "access": "",\n "allowedIps": []\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/firewalledServices/:service
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"access": "",
"allowedIps": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/firewalledServices/:service")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"access": "restricted",
"allowedIps": [
"123.123.123.1"
],
"service": "web"
}
DELETE
Destroy a floor plan
{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
QUERY PARAMS
networkId
floorPlanId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
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}}/networks/:networkId/floorPlans/:floorPlanId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
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/networks/:networkId/floorPlans/:floorPlanId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"))
.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}}/networks/:networkId/floorPlans/:floorPlanId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.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}}/networks/:networkId/floorPlans/:floorPlanId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
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}}/networks/:networkId/floorPlans/:floorPlanId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/floorPlans/:floorPlanId',
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}}/networks/:networkId/floorPlans/:floorPlanId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
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}}/networks/:networkId/floorPlans/:floorPlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
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}}/networks/:networkId/floorPlans/:floorPlanId"]
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}}/networks/:networkId/floorPlans/:floorPlanId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId",
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}}/networks/:networkId/floorPlans/:floorPlanId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/floorPlans/:floorPlanId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
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/networks/:networkId/floorPlans/:floorPlanId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId";
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}}/networks/:networkId/floorPlans/:floorPlanId
http DELETE {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")! 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
Find a floor plan by ID
{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
QUERY PARAMS
networkId
floorPlanId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
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}}/networks/:networkId/floorPlans/:floorPlanId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
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/networks/:networkId/floorPlans/:floorPlanId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"))
.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}}/networks/:networkId/floorPlans/:floorPlanId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.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}}/networks/:networkId/floorPlans/:floorPlanId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
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}}/networks/:networkId/floorPlans/:floorPlanId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/floorPlans/:floorPlanId',
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}}/networks/:networkId/floorPlans/:floorPlanId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
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}}/networks/:networkId/floorPlans/:floorPlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
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}}/networks/:networkId/floorPlans/:floorPlanId"]
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}}/networks/:networkId/floorPlans/:floorPlanId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId",
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}}/networks/:networkId/floorPlans/:floorPlanId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/floorPlans/:floorPlanId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
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/networks/:networkId/floorPlans/:floorPlanId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId";
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}}/networks/:networkId/floorPlans/:floorPlanId
http GET {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bottomLeftCorner": {
"lat": 37.7696461495,
"lng": -122.3880815506
},
"bottomRightCorner": {
"lat": 37.771524649766654,
"lng": -122.38795275055205
},
"center": {
"lat": 37.770040510499996,
"lng": -122.38714009525
},
"devices": [
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
],
"floorPlanId": "g_1234567",
"height": 150.1,
"imageExtension": "png",
"imageMd5": "2a9edd3f4ffd80130c647d13eacb59f3",
"imageUrl": "https://meraki-na.s3.amazonaws.com/assets/...",
"imageUrlExpiresAt": "2019-06-11 16:04:54 +00:00",
"name": "HQ Floor Plan",
"topLeftCorner": {
"lat": 37.769700101836364,
"lng": -122.3888684251381
},
"topRightCorner": {
"lat": 37.77157860210302,
"lng": -122.38873962509012
},
"width": 100
}
GET
List the floor plans that belong to your network
{{baseUrl}}/networks/:networkId/floorPlans
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/floorPlans");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/floorPlans")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/floorPlans"
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}}/networks/:networkId/floorPlans"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/floorPlans");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/floorPlans"
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/networks/:networkId/floorPlans HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/floorPlans")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/floorPlans"))
.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}}/networks/:networkId/floorPlans")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/floorPlans")
.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}}/networks/:networkId/floorPlans');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/floorPlans'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/floorPlans';
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}}/networks/:networkId/floorPlans',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/floorPlans',
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}}/networks/:networkId/floorPlans'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/floorPlans');
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}}/networks/:networkId/floorPlans'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/floorPlans';
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}}/networks/:networkId/floorPlans"]
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}}/networks/:networkId/floorPlans" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/floorPlans",
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}}/networks/:networkId/floorPlans');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/floorPlans');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/floorPlans');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/floorPlans' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/floorPlans' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/floorPlans")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/floorPlans"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/floorPlans"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/floorPlans")
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/networks/:networkId/floorPlans') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/floorPlans";
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}}/networks/:networkId/floorPlans
http GET {{baseUrl}}/networks/:networkId/floorPlans
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/floorPlans
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/floorPlans")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"bottomLeftCorner": {
"lat": 37.7696461495,
"lng": -122.3880815506
},
"bottomRightCorner": {
"lat": 37.771524649766654,
"lng": -122.38795275055205
},
"center": {
"lat": 37.770040510499996,
"lng": -122.38714009525
},
"devices": [
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
],
"floorPlanId": "g_1234567",
"height": 150.1,
"imageExtension": "png",
"imageMd5": "2a9edd3f4ffd80130c647d13eacb59f3",
"imageUrl": "https://meraki-na.s3.amazonaws.com/assets/...",
"imageUrlExpiresAt": "2019-06-11 16:04:54 +00:00",
"name": "HQ Floor Plan",
"topLeftCorner": {
"lat": 37.769700101836364,
"lng": -122.3888684251381
},
"topRightCorner": {
"lat": 37.77157860210302,
"lng": -122.38873962509012
},
"width": 100
}
]
PUT
Update a floor plan's geolocation and other meta data
{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
QUERY PARAMS
networkId
floorPlanId
BODY json
{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId" {:content-type :json
:form-params {:bottomLeftCorner {:lat ""
:lng ""}
:bottomRightCorner {:lat ""
:lng ""}
:center {:lat ""
:lng ""}
:imageContents ""
:name ""
:topLeftCorner {:lat ""
:lng ""}
:topRightCorner {:lat ""
:lng ""}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"),
Content = new StringContent("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
payload := strings.NewReader("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/floorPlans/:floorPlanId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 315
{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.setHeader("content-type", "application/json")
.setBody("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.header("content-type", "application/json")
.body("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
bottomLeftCorner: {
lat: '',
lng: ''
},
bottomRightCorner: {
lat: '',
lng: ''
},
center: {
lat: '',
lng: ''
},
imageContents: '',
name: '',
topLeftCorner: {
lat: '',
lng: ''
},
topRightCorner: {
lat: '',
lng: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId',
headers: {'content-type': 'application/json'},
data: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bottomLeftCorner":{"lat":"","lng":""},"bottomRightCorner":{"lat":"","lng":""},"center":{"lat":"","lng":""},"imageContents":"","name":"","topLeftCorner":{"lat":"","lng":""},"topRightCorner":{"lat":"","lng":""}}'
};
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}}/networks/:networkId/floorPlans/:floorPlanId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bottomLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "bottomRightCorner": {\n "lat": "",\n "lng": ""\n },\n "center": {\n "lat": "",\n "lng": ""\n },\n "imageContents": "",\n "name": "",\n "topLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "topRightCorner": {\n "lat": "",\n "lng": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/floorPlans/:floorPlanId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId',
headers: {'content-type': 'application/json'},
body: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bottomLeftCorner: {
lat: '',
lng: ''
},
bottomRightCorner: {
lat: '',
lng: ''
},
center: {
lat: '',
lng: ''
},
imageContents: '',
name: '',
topLeftCorner: {
lat: '',
lng: ''
},
topRightCorner: {
lat: '',
lng: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId',
headers: {'content-type': 'application/json'},
data: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bottomLeftCorner":{"lat":"","lng":""},"bottomRightCorner":{"lat":"","lng":""},"center":{"lat":"","lng":""},"imageContents":"","name":"","topLeftCorner":{"lat":"","lng":""},"topRightCorner":{"lat":"","lng":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bottomLeftCorner": @{ @"lat": @"", @"lng": @"" },
@"bottomRightCorner": @{ @"lat": @"", @"lng": @"" },
@"center": @{ @"lat": @"", @"lng": @"" },
@"imageContents": @"",
@"name": @"",
@"topLeftCorner": @{ @"lat": @"", @"lng": @"" },
@"topRightCorner": @{ @"lat": @"", @"lng": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId', [
'body' => '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/floorPlans/:floorPlanId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
payload = {
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId"
payload <- "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/floorPlans/:floorPlanId') do |req|
req.body = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId";
let payload = json!({
"bottomLeftCorner": json!({
"lat": "",
"lng": ""
}),
"bottomRightCorner": json!({
"lat": "",
"lng": ""
}),
"center": json!({
"lat": "",
"lng": ""
}),
"imageContents": "",
"name": "",
"topLeftCorner": json!({
"lat": "",
"lng": ""
}),
"topRightCorner": json!({
"lat": "",
"lng": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId \
--header 'content-type: application/json' \
--data '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
echo '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bottomLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "bottomRightCorner": {\n "lat": "",\n "lng": ""\n },\n "center": {\n "lat": "",\n "lng": ""\n },\n "imageContents": "",\n "name": "",\n "topLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "topRightCorner": {\n "lat": "",\n "lng": ""\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bottomLeftCorner": [
"lat": "",
"lng": ""
],
"bottomRightCorner": [
"lat": "",
"lng": ""
],
"center": [
"lat": "",
"lng": ""
],
"imageContents": "",
"name": "",
"topLeftCorner": [
"lat": "",
"lng": ""
],
"topRightCorner": [
"lat": "",
"lng": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/floorPlans/:floorPlanId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bottomLeftCorner": {
"lat": 37.7696461495,
"lng": -122.3880815506
},
"bottomRightCorner": {
"lat": 37.771524649766654,
"lng": -122.38795275055205
},
"center": {
"lat": 37.770040510499996,
"lng": -122.38714009525
},
"devices": [
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
],
"floorPlanId": "g_1234567",
"height": 150.1,
"imageExtension": "png",
"imageMd5": "2a9edd3f4ffd80130c647d13eacb59f3",
"imageUrl": "https://meraki-na.s3.amazonaws.com/assets/...",
"imageUrlExpiresAt": "2019-06-11 16:04:54 +00:00",
"name": "HQ Floor Plan",
"topLeftCorner": {
"lat": 37.769700101836364,
"lng": -122.3888684251381
},
"topRightCorner": {
"lat": 37.77157860210302,
"lng": -122.38873962509012
},
"width": 100
}
POST
Upload a floor plan
{{baseUrl}}/networks/:networkId/floorPlans
QUERY PARAMS
networkId
BODY json
{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/floorPlans");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/floorPlans" {:content-type :json
:form-params {:bottomLeftCorner {:lat ""
:lng ""}
:bottomRightCorner {:lat ""
:lng ""}
:center {:lat ""
:lng ""}
:imageContents ""
:name ""
:topLeftCorner {:lat ""
:lng ""}
:topRightCorner {:lat ""
:lng ""}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/floorPlans"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/floorPlans"),
Content = new StringContent("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/floorPlans");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/floorPlans"
payload := strings.NewReader("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/floorPlans HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 315
{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/floorPlans")
.setHeader("content-type", "application/json")
.setBody("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/floorPlans"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/floorPlans")
.header("content-type", "application/json")
.body("{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
bottomLeftCorner: {
lat: '',
lng: ''
},
bottomRightCorner: {
lat: '',
lng: ''
},
center: {
lat: '',
lng: ''
},
imageContents: '',
name: '',
topLeftCorner: {
lat: '',
lng: ''
},
topRightCorner: {
lat: '',
lng: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/floorPlans');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/floorPlans',
headers: {'content-type': 'application/json'},
data: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/floorPlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bottomLeftCorner":{"lat":"","lng":""},"bottomRightCorner":{"lat":"","lng":""},"center":{"lat":"","lng":""},"imageContents":"","name":"","topLeftCorner":{"lat":"","lng":""},"topRightCorner":{"lat":"","lng":""}}'
};
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}}/networks/:networkId/floorPlans',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bottomLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "bottomRightCorner": {\n "lat": "",\n "lng": ""\n },\n "center": {\n "lat": "",\n "lng": ""\n },\n "imageContents": "",\n "name": "",\n "topLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "topRightCorner": {\n "lat": "",\n "lng": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/floorPlans")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/floorPlans',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/floorPlans',
headers: {'content-type': 'application/json'},
body: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/floorPlans');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bottomLeftCorner: {
lat: '',
lng: ''
},
bottomRightCorner: {
lat: '',
lng: ''
},
center: {
lat: '',
lng: ''
},
imageContents: '',
name: '',
topLeftCorner: {
lat: '',
lng: ''
},
topRightCorner: {
lat: '',
lng: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/floorPlans',
headers: {'content-type': 'application/json'},
data: {
bottomLeftCorner: {lat: '', lng: ''},
bottomRightCorner: {lat: '', lng: ''},
center: {lat: '', lng: ''},
imageContents: '',
name: '',
topLeftCorner: {lat: '', lng: ''},
topRightCorner: {lat: '', lng: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/floorPlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bottomLeftCorner":{"lat":"","lng":""},"bottomRightCorner":{"lat":"","lng":""},"center":{"lat":"","lng":""},"imageContents":"","name":"","topLeftCorner":{"lat":"","lng":""},"topRightCorner":{"lat":"","lng":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bottomLeftCorner": @{ @"lat": @"", @"lng": @"" },
@"bottomRightCorner": @{ @"lat": @"", @"lng": @"" },
@"center": @{ @"lat": @"", @"lng": @"" },
@"imageContents": @"",
@"name": @"",
@"topLeftCorner": @{ @"lat": @"", @"lng": @"" },
@"topRightCorner": @{ @"lat": @"", @"lng": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/floorPlans"]
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}}/networks/:networkId/floorPlans" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/floorPlans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/floorPlans', [
'body' => '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/floorPlans');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bottomLeftCorner' => [
'lat' => '',
'lng' => ''
],
'bottomRightCorner' => [
'lat' => '',
'lng' => ''
],
'center' => [
'lat' => '',
'lng' => ''
],
'imageContents' => '',
'name' => '',
'topLeftCorner' => [
'lat' => '',
'lng' => ''
],
'topRightCorner' => [
'lat' => '',
'lng' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/floorPlans');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/floorPlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/floorPlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/floorPlans", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/floorPlans"
payload = {
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/floorPlans"
payload <- "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/floorPlans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/floorPlans') do |req|
req.body = "{\n \"bottomLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"bottomRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"center\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"imageContents\": \"\",\n \"name\": \"\",\n \"topLeftCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n },\n \"topRightCorner\": {\n \"lat\": \"\",\n \"lng\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/floorPlans";
let payload = json!({
"bottomLeftCorner": json!({
"lat": "",
"lng": ""
}),
"bottomRightCorner": json!({
"lat": "",
"lng": ""
}),
"center": json!({
"lat": "",
"lng": ""
}),
"imageContents": "",
"name": "",
"topLeftCorner": json!({
"lat": "",
"lng": ""
}),
"topRightCorner": json!({
"lat": "",
"lng": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/floorPlans \
--header 'content-type: application/json' \
--data '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}'
echo '{
"bottomLeftCorner": {
"lat": "",
"lng": ""
},
"bottomRightCorner": {
"lat": "",
"lng": ""
},
"center": {
"lat": "",
"lng": ""
},
"imageContents": "",
"name": "",
"topLeftCorner": {
"lat": "",
"lng": ""
},
"topRightCorner": {
"lat": "",
"lng": ""
}
}' | \
http POST {{baseUrl}}/networks/:networkId/floorPlans \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "bottomLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "bottomRightCorner": {\n "lat": "",\n "lng": ""\n },\n "center": {\n "lat": "",\n "lng": ""\n },\n "imageContents": "",\n "name": "",\n "topLeftCorner": {\n "lat": "",\n "lng": ""\n },\n "topRightCorner": {\n "lat": "",\n "lng": ""\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/floorPlans
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bottomLeftCorner": [
"lat": "",
"lng": ""
],
"bottomRightCorner": [
"lat": "",
"lng": ""
],
"center": [
"lat": "",
"lng": ""
],
"imageContents": "",
"name": "",
"topLeftCorner": [
"lat": "",
"lng": ""
],
"topRightCorner": [
"lat": "",
"lng": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/floorPlans")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bottomLeftCorner": {
"lat": 37.7696461495,
"lng": -122.3880815506
},
"bottomRightCorner": {
"lat": 37.771524649766654,
"lng": -122.38795275055205
},
"center": {
"lat": 37.770040510499996,
"lng": -122.38714009525
},
"devices": [
{
"address": "1600 Pennsylvania Ave",
"beaconIdParams": {
"major": 5,
"minor": 3,
"uuid": "00000000-0000-0000-0000-000000000000"
},
"firmware": "wireless-25-14",
"floorPlanId": "g_1234567",
"lanIp": "1.2.3.4",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"notes": "My AP's note",
"serial": "Q234-ABCD-5678",
"tags": " recently-added "
}
],
"floorPlanId": "g_1234567",
"height": 150.1,
"imageExtension": "png",
"imageMd5": "2a9edd3f4ffd80130c647d13eacb59f3",
"imageUrl": "https://meraki-na.s3.amazonaws.com/assets/...",
"imageUrlExpiresAt": "2019-06-11 16:04:54 +00:00",
"name": "HQ Floor Plan",
"topLeftCorner": {
"lat": 37.769700101836364,
"lng": -122.3888684251381
},
"topRightCorner": {
"lat": 37.77157860210302,
"lng": -122.38873962509012
},
"width": 100
}
GET
Returns all supported intrusion settings for an MX network
{{baseUrl}}/networks/:networkId/security/intrusionSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/security/intrusionSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/security/intrusionSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
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}}/networks/:networkId/security/intrusionSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/security/intrusionSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
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/networks/:networkId/security/intrusionSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/security/intrusionSettings"))
.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}}/networks/:networkId/security/intrusionSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.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}}/networks/:networkId/security/intrusionSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/security/intrusionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/security/intrusionSettings';
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}}/networks/:networkId/security/intrusionSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/security/intrusionSettings',
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}}/networks/:networkId/security/intrusionSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/security/intrusionSettings');
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}}/networks/:networkId/security/intrusionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/security/intrusionSettings';
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}}/networks/:networkId/security/intrusionSettings"]
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}}/networks/:networkId/security/intrusionSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/security/intrusionSettings",
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}}/networks/:networkId/security/intrusionSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/security/intrusionSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/security/intrusionSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/security/intrusionSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/security/intrusionSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/security/intrusionSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
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/networks/:networkId/security/intrusionSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings";
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}}/networks/:networkId/security/intrusionSettings
http GET {{baseUrl}}/networks/:networkId/security/intrusionSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/security/intrusionSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/security/intrusionSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"idsRulesets": "balanced",
"mode": "prevention",
"protectedNetworks": {
"excludedCidr": [
"10.0.0.0/8",
"127.0.0.0/8"
],
"includedCidr": [
"10.0.0.0/8",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12"
],
"useDefault": false
}
}
GET
Returns all supported intrusion settings for an organization
{{baseUrl}}/organizations/:organizationId/security/intrusionSettings
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
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}}/organizations/:organizationId/security/intrusionSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
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/organizations/:organizationId/security/intrusionSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"))
.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}}/organizations/:organizationId/security/intrusionSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.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}}/organizations/:organizationId/security/intrusionSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings';
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}}/organizations/:organizationId/security/intrusionSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/security/intrusionSettings',
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}}/organizations/:organizationId/security/intrusionSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
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}}/organizations/:organizationId/security/intrusionSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings';
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}}/organizations/:organizationId/security/intrusionSettings"]
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}}/organizations/:organizationId/security/intrusionSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/security/intrusionSettings",
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}}/organizations/:organizationId/security/intrusionSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/security/intrusionSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
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/organizations/:organizationId/security/intrusionSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings";
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}}/organizations/:organizationId/security/intrusionSettings
http GET {{baseUrl}}/organizations/:organizationId/security/intrusionSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/security/intrusionSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"whitelistedRules": [
{
"message": "SQL sa login failed",
"ruleId": "meraki:intrusion/snort/GID/01/SID/688"
},
{
"message": "MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines",
"ruleId": "meraki:intrusion/snort/GID/01/SID/5805"
}
]
}
PUT
Set the supported intrusion settings for an MX network
{{baseUrl}}/networks/:networkId/security/intrusionSettings
QUERY PARAMS
networkId
BODY json
{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/security/intrusionSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/security/intrusionSettings" {:content-type :json
:form-params {:idsRulesets ""
:mode ""
:protectedNetworks {:excludedCidr []
:includedCidr []
:useDefault false}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/security/intrusionSettings"),
Content = new StringContent("{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/security/intrusionSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
payload := strings.NewReader("{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/security/intrusionSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 139
{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/security/intrusionSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.header("content-type", "application/json")
.body("{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}")
.asString();
const data = JSON.stringify({
idsRulesets: '',
mode: '',
protectedNetworks: {
excludedCidr: [],
includedCidr: [],
useDefault: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/security/intrusionSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
data: {
idsRulesets: '',
mode: '',
protectedNetworks: {excludedCidr: [], includedCidr: [], useDefault: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/security/intrusionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"idsRulesets":"","mode":"","protectedNetworks":{"excludedCidr":[],"includedCidr":[],"useDefault":false}}'
};
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}}/networks/:networkId/security/intrusionSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "idsRulesets": "",\n "mode": "",\n "protectedNetworks": {\n "excludedCidr": [],\n "includedCidr": [],\n "useDefault": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/security/intrusionSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
idsRulesets: '',
mode: '',
protectedNetworks: {excludedCidr: [], includedCidr: [], useDefault: false}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
body: {
idsRulesets: '',
mode: '',
protectedNetworks: {excludedCidr: [], includedCidr: [], useDefault: false}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/security/intrusionSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
idsRulesets: '',
mode: '',
protectedNetworks: {
excludedCidr: [],
includedCidr: [],
useDefault: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
data: {
idsRulesets: '',
mode: '',
protectedNetworks: {excludedCidr: [], includedCidr: [], useDefault: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/security/intrusionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"idsRulesets":"","mode":"","protectedNetworks":{"excludedCidr":[],"includedCidr":[],"useDefault":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"idsRulesets": @"",
@"mode": @"",
@"protectedNetworks": @{ @"excludedCidr": @[ ], @"includedCidr": @[ ], @"useDefault": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/security/intrusionSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/security/intrusionSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/security/intrusionSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'idsRulesets' => '',
'mode' => '',
'protectedNetworks' => [
'excludedCidr' => [
],
'includedCidr' => [
],
'useDefault' => null
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/security/intrusionSettings', [
'body' => '{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/security/intrusionSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'idsRulesets' => '',
'mode' => '',
'protectedNetworks' => [
'excludedCidr' => [
],
'includedCidr' => [
],
'useDefault' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'idsRulesets' => '',
'mode' => '',
'protectedNetworks' => [
'excludedCidr' => [
],
'includedCidr' => [
],
'useDefault' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/security/intrusionSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/security/intrusionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/security/intrusionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/security/intrusionSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
payload = {
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": False
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/security/intrusionSettings"
payload <- "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/security/intrusionSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/security/intrusionSettings') do |req|
req.body = "{\n \"idsRulesets\": \"\",\n \"mode\": \"\",\n \"protectedNetworks\": {\n \"excludedCidr\": [],\n \"includedCidr\": [],\n \"useDefault\": false\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/security/intrusionSettings";
let payload = json!({
"idsRulesets": "",
"mode": "",
"protectedNetworks": json!({
"excludedCidr": (),
"includedCidr": (),
"useDefault": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/security/intrusionSettings \
--header 'content-type: application/json' \
--data '{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}'
echo '{
"idsRulesets": "",
"mode": "",
"protectedNetworks": {
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/security/intrusionSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "idsRulesets": "",\n "mode": "",\n "protectedNetworks": {\n "excludedCidr": [],\n "includedCidr": [],\n "useDefault": false\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/security/intrusionSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"idsRulesets": "",
"mode": "",
"protectedNetworks": [
"excludedCidr": [],
"includedCidr": [],
"useDefault": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/security/intrusionSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"idsRulesets": "balanced",
"mode": "prevention",
"protectedNetworks": {
"excludedCidr": [
"10.0.0.0/8",
"127.0.0.0/8"
],
"includedCidr": [
"10.0.0.0/8",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12"
],
"useDefault": false
}
}
PUT
Sets supported intrusion settings for an organization
{{baseUrl}}/organizations/:organizationId/security/intrusionSettings
QUERY PARAMS
organizationId
BODY json
{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings" {:content-type :json
:form-params {:whitelistedRules [{:message ""
:ruleId ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"),
Content = new StringContent("{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
payload := strings.NewReader("{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/security/intrusionSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 83
{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.header("content-type", "application/json")
.body("{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
whitelistedRules: [
{
message: '',
ruleId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
data: {whitelistedRules: [{message: '', ruleId: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"whitelistedRules":[{"message":"","ruleId":""}]}'
};
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}}/organizations/:organizationId/security/intrusionSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "whitelistedRules": [\n {\n "message": "",\n "ruleId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/security/intrusionSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({whitelistedRules: [{message: '', ruleId: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
body: {whitelistedRules: [{message: '', ruleId: ''}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
whitelistedRules: [
{
message: '',
ruleId: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings',
headers: {'content-type': 'application/json'},
data: {whitelistedRules: [{message: '', ruleId: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"whitelistedRules":[{"message":"","ruleId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"whitelistedRules": @[ @{ @"message": @"", @"ruleId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/security/intrusionSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'whitelistedRules' => [
[
'message' => '',
'ruleId' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings', [
'body' => '{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'whitelistedRules' => [
[
'message' => '',
'ruleId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'whitelistedRules' => [
[
'message' => '',
'ruleId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/security/intrusionSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/security/intrusionSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/security/intrusionSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
payload = { "whitelistedRules": [
{
"message": "",
"ruleId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings"
payload <- "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/security/intrusionSettings') do |req|
req.body = "{\n \"whitelistedRules\": [\n {\n \"message\": \"\",\n \"ruleId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings";
let payload = json!({"whitelistedRules": (
json!({
"message": "",
"ruleId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/security/intrusionSettings \
--header 'content-type: application/json' \
--data '{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}'
echo '{
"whitelistedRules": [
{
"message": "",
"ruleId": ""
}
]
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/security/intrusionSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "whitelistedRules": [\n {\n "message": "",\n "ruleId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/security/intrusionSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["whitelistedRules": [
[
"message": "",
"ruleId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/security/intrusionSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"whitelistedRules": [
{
"message": "SQL sa login failed",
"ruleId": "meraki:intrusion/snort/GID/01/SID/688"
},
{
"message": "MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines",
"ruleId": "meraki:intrusion/snort/GID/01/SID/5805"
}
]
}
POST
Assign SM seats to a network
{{baseUrl}}/organizations/:organizationId/licenses/assignSeats
QUERY PARAMS
organizationId
BODY json
{
"licenseId": "",
"networkId": "",
"seatCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats" {:content-type :json
:form-params {:licenseId ""
:networkId ""
:seatCount 0}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"),
Content = new StringContent("{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"
payload := strings.NewReader("{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/licenses/assignSeats HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 58
{
"licenseId": "",
"networkId": "",
"seatCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")
.setHeader("content-type", "application/json")
.setBody("{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")
.header("content-type", "application/json")
.body("{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}")
.asString();
const data = JSON.stringify({
licenseId: '',
networkId: '',
seatCount: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats',
headers: {'content-type': 'application/json'},
data: {licenseId: '', networkId: '', seatCount: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenseId":"","networkId":"","seatCount":0}'
};
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}}/organizations/:organizationId/licenses/assignSeats',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "licenseId": "",\n "networkId": "",\n "seatCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenses/assignSeats',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({licenseId: '', networkId: '', seatCount: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats',
headers: {'content-type': 'application/json'},
body: {licenseId: '', networkId: '', seatCount: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
licenseId: '',
networkId: '',
seatCount: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats',
headers: {'content-type': 'application/json'},
data: {licenseId: '', networkId: '', seatCount: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenseId":"","networkId":"","seatCount":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"licenseId": @"",
@"networkId": @"",
@"seatCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"]
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}}/organizations/:organizationId/licenses/assignSeats" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenses/assignSeats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'licenseId' => '',
'networkId' => '',
'seatCount' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats', [
'body' => '{
"licenseId": "",
"networkId": "",
"seatCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenses/assignSeats');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'licenseId' => '',
'networkId' => '',
'seatCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'licenseId' => '',
'networkId' => '',
'seatCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenses/assignSeats');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenseId": "",
"networkId": "",
"seatCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenses/assignSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenseId": "",
"networkId": "",
"seatCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/licenses/assignSeats", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"
payload = {
"licenseId": "",
"networkId": "",
"seatCount": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats"
payload <- "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/licenses/assignSeats') do |req|
req.body = "{\n \"licenseId\": \"\",\n \"networkId\": \"\",\n \"seatCount\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats";
let payload = json!({
"licenseId": "",
"networkId": "",
"seatCount": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/licenses/assignSeats \
--header 'content-type: application/json' \
--data '{
"licenseId": "",
"networkId": "",
"seatCount": 0
}'
echo '{
"licenseId": "",
"networkId": "",
"seatCount": 0
}' | \
http POST {{baseUrl}}/organizations/:organizationId/licenses/assignSeats \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "licenseId": "",\n "networkId": "",\n "seatCount": 0\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenses/assignSeats
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"licenseId": "",
"networkId": "",
"seatCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenses/assignSeats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"resultingLicenses": [
{
"activationDate": "2019-09-01T15:01:46Z",
"claimDate": "2019-08-29T12:40:10Z",
"deviceSerial": null,
"durationInDays": 365,
"expirationDate": "2020-08-31T15:01:46Z",
"headLicenseId": "1234",
"id": "1234",
"licenseKey": "Z21234567890",
"licenseType": "SME",
"networkId": "N_24329156",
"orderNumber": "4C1234567",
"permanentlyQueuedLicenses": [],
"seatCount": 25,
"state": "active",
"totalDurationInDays": 365
}
]
}
GET
Display a license
{{baseUrl}}/organizations/:organizationId/licenses/:licenseId
QUERY PARAMS
organizationId
licenseId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId"
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}}/organizations/:organizationId/licenses/:licenseId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenses/:licenseId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId"
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/organizations/:organizationId/licenses/:licenseId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenses/:licenseId"))
.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}}/organizations/:organizationId/licenses/:licenseId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")
.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}}/organizations/:organizationId/licenses/:licenseId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId';
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}}/organizations/:organizationId/licenses/:licenseId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenses/:licenseId',
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}}/organizations/:organizationId/licenses/:licenseId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId');
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}}/organizations/:organizationId/licenses/:licenseId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId';
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}}/organizations/:organizationId/licenses/:licenseId"]
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}}/organizations/:organizationId/licenses/:licenseId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenses/:licenseId",
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}}/organizations/:organizationId/licenses/:licenseId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenses/:licenseId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenses/:licenseId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenses/:licenseId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/licenses/:licenseId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")
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/organizations/:organizationId/licenses/:licenseId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId";
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}}/organizations/:organizationId/licenses/:licenseId
http GET {{baseUrl}}/organizations/:organizationId/licenses/:licenseId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenses/:licenseId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenses/:licenseId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"activationDate": "2019-09-01T15:01:46Z",
"claimDate": "2019-08-29T12:40:10Z",
"deviceSerial": "Q234-ABCD-5678",
"durationInDays": 365,
"expirationDate": "2020-10-30T15:01:46Z",
"headLicenseId": "1234",
"id": "1234",
"licenseKey": "Z21234567890",
"licenseType": "MX64-ENT",
"networkId": "N_24329156",
"orderNumber": "4C1234567",
"permanentlyQueuedLicenses": [
{
"durationInDays": 60,
"id": "5678",
"licenseKey": "Z21234567890",
"licenseType": "MX64-ENT",
"orderNumber": "4C1234567"
}
],
"seatCount": null,
"state": "active",
"totalDurationInDays": 425
}
GET
List the licenses for an organization
{{baseUrl}}/organizations/:organizationId/licenses
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/licenses")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenses"
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}}/organizations/:organizationId/licenses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenses"
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/organizations/:organizationId/licenses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/licenses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenses"))
.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}}/organizations/:organizationId/licenses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/licenses")
.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}}/organizations/:organizationId/licenses');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/licenses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenses';
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}}/organizations/:organizationId/licenses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenses',
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}}/organizations/:organizationId/licenses'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/licenses');
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}}/organizations/:organizationId/licenses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenses';
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}}/organizations/:organizationId/licenses"]
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}}/organizations/:organizationId/licenses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenses",
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}}/organizations/:organizationId/licenses');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/licenses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenses")
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/organizations/:organizationId/licenses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenses";
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}}/organizations/:organizationId/licenses
http GET {{baseUrl}}/organizations/:organizationId/licenses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenses")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"activationDate": "2019-09-01T15:01:46Z",
"claimDate": "2019-08-29T12:40:10Z",
"deviceSerial": "Q234-ABCD-5678",
"durationInDays": 365,
"expirationDate": "2020-10-30T15:01:46Z",
"headLicenseId": "1234",
"id": "1234",
"licenseKey": "Z21234567890",
"licenseType": "MX64-ENT",
"networkId": "N_24329156",
"orderNumber": "4C1234567",
"permanentlyQueuedLicenses": [
{
"durationInDays": 60,
"id": "5678",
"licenseKey": "Z21234567890",
"licenseType": "MX64-ENT",
"orderNumber": "4C1234567"
}
],
"seatCount": null,
"state": "active",
"totalDurationInDays": 425
}
]
POST
Move SM seats to another organization
{{baseUrl}}/organizations/:organizationId/licenses/moveSeats
QUERY PARAMS
organizationId
BODY json
{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats" {:content-type :json
:form-params {:destOrganizationId ""
:licenseId ""
:seatCount 0}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"),
Content = new StringContent("{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"
payload := strings.NewReader("{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/licenses/moveSeats HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")
.setHeader("content-type", "application/json")
.setBody("{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")
.header("content-type", "application/json")
.body("{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}")
.asString();
const data = JSON.stringify({
destOrganizationId: '',
licenseId: '',
seatCount: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats',
headers: {'content-type': 'application/json'},
data: {destOrganizationId: '', licenseId: '', seatCount: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destOrganizationId":"","licenseId":"","seatCount":0}'
};
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}}/organizations/:organizationId/licenses/moveSeats',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destOrganizationId": "",\n "licenseId": "",\n "seatCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenses/moveSeats',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destOrganizationId: '', licenseId: '', seatCount: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats',
headers: {'content-type': 'application/json'},
body: {destOrganizationId: '', licenseId: '', seatCount: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destOrganizationId: '',
licenseId: '',
seatCount: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats',
headers: {'content-type': 'application/json'},
data: {destOrganizationId: '', licenseId: '', seatCount: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destOrganizationId":"","licenseId":"","seatCount":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destOrganizationId": @"",
@"licenseId": @"",
@"seatCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"]
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}}/organizations/:organizationId/licenses/moveSeats" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenses/moveSeats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destOrganizationId' => '',
'licenseId' => '',
'seatCount' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats', [
'body' => '{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenses/moveSeats');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destOrganizationId' => '',
'licenseId' => '',
'seatCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destOrganizationId' => '',
'licenseId' => '',
'seatCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenses/moveSeats');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenses/moveSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/licenses/moveSeats", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"
payload = {
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats"
payload <- "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/licenses/moveSeats') do |req|
req.body = "{\n \"destOrganizationId\": \"\",\n \"licenseId\": \"\",\n \"seatCount\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats";
let payload = json!({
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/licenses/moveSeats \
--header 'content-type: application/json' \
--data '{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}'
echo '{
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
}' | \
http POST {{baseUrl}}/organizations/:organizationId/licenses/moveSeats \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destOrganizationId": "",\n "licenseId": "",\n "seatCount": 0\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenses/moveSeats
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destOrganizationId": "",
"licenseId": "",
"seatCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenses/moveSeats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"destOrganizationId": "2930418",
"licenseId": "1234",
"seatCount": 20
}
POST
Renew SM seats of a license
{{baseUrl}}/organizations/:organizationId/licenses/renewSeats
QUERY PARAMS
organizationId
BODY json
{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats" {:content-type :json
:form-params {:licenseIdToRenew ""
:unusedLicenseId ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"),
Content = new StringContent("{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"
payload := strings.NewReader("{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/licenses/renewSeats HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 53
{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")
.setHeader("content-type", "application/json")
.setBody("{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")
.header("content-type", "application/json")
.body("{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}")
.asString();
const data = JSON.stringify({
licenseIdToRenew: '',
unusedLicenseId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats',
headers: {'content-type': 'application/json'},
data: {licenseIdToRenew: '', unusedLicenseId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenseIdToRenew":"","unusedLicenseId":""}'
};
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}}/organizations/:organizationId/licenses/renewSeats',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "licenseIdToRenew": "",\n "unusedLicenseId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenses/renewSeats',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({licenseIdToRenew: '', unusedLicenseId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats',
headers: {'content-type': 'application/json'},
body: {licenseIdToRenew: '', unusedLicenseId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
licenseIdToRenew: '',
unusedLicenseId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats',
headers: {'content-type': 'application/json'},
data: {licenseIdToRenew: '', unusedLicenseId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenseIdToRenew":"","unusedLicenseId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"licenseIdToRenew": @"",
@"unusedLicenseId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"]
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}}/organizations/:organizationId/licenses/renewSeats" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenses/renewSeats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'licenseIdToRenew' => '',
'unusedLicenseId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats', [
'body' => '{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenses/renewSeats');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'licenseIdToRenew' => '',
'unusedLicenseId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'licenseIdToRenew' => '',
'unusedLicenseId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenses/renewSeats');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenses/renewSeats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/licenses/renewSeats", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"
payload = {
"licenseIdToRenew": "",
"unusedLicenseId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats"
payload <- "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/licenses/renewSeats') do |req|
req.body = "{\n \"licenseIdToRenew\": \"\",\n \"unusedLicenseId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats";
let payload = json!({
"licenseIdToRenew": "",
"unusedLicenseId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/licenses/renewSeats \
--header 'content-type: application/json' \
--data '{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}'
echo '{
"licenseIdToRenew": "",
"unusedLicenseId": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationId/licenses/renewSeats \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "licenseIdToRenew": "",\n "unusedLicenseId": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenses/renewSeats
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"licenseIdToRenew": "",
"unusedLicenseId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenses/renewSeats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"resultingLicenses": [
{
"activationDate": "2019-09-01T15:01:46Z",
"claimDate": "2019-08-29T12:40:10Z",
"deviceSerial": null,
"durationInDays": 365,
"expirationDate": "2020-08-31T15:01:46Z",
"headLicenseId": "1234",
"id": "1234",
"licenseKey": "Z21234567890",
"licenseType": "SME",
"networkId": "N_24329156",
"orderNumber": "4C1234567",
"permanentlyQueuedLicenses": [],
"seatCount": 25,
"state": "active",
"totalDurationInDays": 365
}
]
}
GET
Return an overview of the license state for an organization
{{baseUrl}}/organizations/:organizationId/licenseState
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/licenseState");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/licenseState")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/licenseState"
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}}/organizations/:organizationId/licenseState"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/licenseState");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/licenseState"
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/organizations/:organizationId/licenseState HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/licenseState")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/licenseState"))
.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}}/organizations/:organizationId/licenseState")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/licenseState")
.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}}/organizations/:organizationId/licenseState');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/licenseState'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/licenseState';
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}}/organizations/:organizationId/licenseState',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/licenseState")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/licenseState',
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}}/organizations/:organizationId/licenseState'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/licenseState');
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}}/organizations/:organizationId/licenseState'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/licenseState';
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}}/organizations/:organizationId/licenseState"]
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}}/organizations/:organizationId/licenseState" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/licenseState",
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}}/organizations/:organizationId/licenseState');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/licenseState');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/licenseState');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/licenseState' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/licenseState' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/licenseState")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/licenseState"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/licenseState"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/licenseState")
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/organizations/:organizationId/licenseState') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/licenseState";
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}}/organizations/:organizationId/licenseState
http GET {{baseUrl}}/organizations/:organizationId/licenseState
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/licenseState
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/licenseState")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"expirationDate": "Feb 8, 2020 UTC",
"licensedDeviceCounts": {
"MS": 100
},
"status": "OK"
}
POST
Create a link aggregation group
{{baseUrl}}/networks/:networkId/switch/linkAggregations
QUERY PARAMS
networkId
BODY json
{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/linkAggregations");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switch/linkAggregations" {:content-type :json
:form-params {:switchPorts [{:portId ""
:serial ""}]
:switchProfilePorts [{:portId ""
:profile ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/linkAggregations"),
Content = new StringContent("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/linkAggregations");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
payload := strings.NewReader("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switch/linkAggregations HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 160
{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.setHeader("content-type", "application/json")
.setBody("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/linkAggregations"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.header("content-type", "application/json")
.body("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
switchPorts: [
{
portId: '',
serial: ''
}
],
switchProfilePorts: [
{
portId: '',
profile: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switch/linkAggregations');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations',
headers: {'content-type': 'application/json'},
data: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"switchPorts":[{"portId":"","serial":""}],"switchProfilePorts":[{"portId":"","profile":""}]}'
};
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}}/networks/:networkId/switch/linkAggregations',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "switchPorts": [\n {\n "portId": "",\n "serial": ""\n }\n ],\n "switchProfilePorts": [\n {\n "portId": "",\n "profile": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/linkAggregations',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations',
headers: {'content-type': 'application/json'},
body: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switch/linkAggregations');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
switchPorts: [
{
portId: '',
serial: ''
}
],
switchProfilePorts: [
{
portId: '',
profile: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations',
headers: {'content-type': 'application/json'},
data: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"switchPorts":[{"portId":"","serial":""}],"switchProfilePorts":[{"portId":"","profile":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"switchPorts": @[ @{ @"portId": @"", @"serial": @"" } ],
@"switchProfilePorts": @[ @{ @"portId": @"", @"profile": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/linkAggregations"]
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}}/networks/:networkId/switch/linkAggregations" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/linkAggregations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switch/linkAggregations', [
'body' => '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switch/linkAggregations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
payload = {
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
payload <- "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switch/linkAggregations') do |req|
req.body = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations";
let payload = json!({
"switchPorts": (
json!({
"portId": "",
"serial": ""
})
),
"switchProfilePorts": (
json!({
"portId": "",
"profile": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switch/linkAggregations \
--header 'content-type: application/json' \
--data '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
echo '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}' | \
http POST {{baseUrl}}/networks/:networkId/switch/linkAggregations \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "switchPorts": [\n {\n "portId": "",\n "serial": ""\n }\n ],\n "switchProfilePorts": [\n {\n "portId": "",\n "profile": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/linkAggregations
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"switchPorts": [
[
"portId": "",
"serial": ""
]
],
"switchProfilePorts": [
[
"portId": "",
"profile": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/linkAggregations")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "NDU2N18yXzM=",
"switchPorts": [
{
"portId": "1",
"serial": "Q234-ABCD-0001"
},
{
"portId": "2",
"serial": "Q234-ABCD-0002"
},
{
"portId": "3",
"serial": "Q234-ABCD-0003"
},
{
"portId": "4",
"serial": "Q234-ABCD-0004"
},
{
"portId": "5",
"serial": "Q234-ABCD-0005"
},
{
"portId": "6",
"serial": "Q234-ABCD-0006"
},
{
"portId": "7",
"serial": "Q234-ABCD-0007"
},
{
"portId": "8",
"serial": "Q234-ABCD-0008"
}
]
}
GET
List link aggregation groups
{{baseUrl}}/networks/:networkId/switch/linkAggregations
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/linkAggregations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/linkAggregations")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
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}}/networks/:networkId/switch/linkAggregations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/linkAggregations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
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/networks/:networkId/switch/linkAggregations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/linkAggregations"))
.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}}/networks/:networkId/switch/linkAggregations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.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}}/networks/:networkId/switch/linkAggregations');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations';
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}}/networks/:networkId/switch/linkAggregations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/linkAggregations',
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}}/networks/:networkId/switch/linkAggregations'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/linkAggregations');
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}}/networks/:networkId/switch/linkAggregations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations';
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}}/networks/:networkId/switch/linkAggregations"]
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}}/networks/:networkId/switch/linkAggregations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/linkAggregations",
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}}/networks/:networkId/switch/linkAggregations');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/linkAggregations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/linkAggregations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/linkAggregations")
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/networks/:networkId/switch/linkAggregations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations";
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}}/networks/:networkId/switch/linkAggregations
http GET {{baseUrl}}/networks/:networkId/switch/linkAggregations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/linkAggregations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/linkAggregations")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "NDU2N18yXzM=",
"switchPorts": [
{
"portId": "1",
"serial": "Q234-ABCD-0001"
},
{
"portId": "2",
"serial": "Q234-ABCD-0002"
},
{
"portId": "3",
"serial": "Q234-ABCD-0003"
},
{
"portId": "4",
"serial": "Q234-ABCD-0004"
},
{
"portId": "5",
"serial": "Q234-ABCD-0005"
},
{
"portId": "6",
"serial": "Q234-ABCD-0006"
},
{
"portId": "7",
"serial": "Q234-ABCD-0007"
},
{
"portId": "8",
"serial": "Q234-ABCD-0008"
}
]
}
]
DELETE
Split a link aggregation group into separate ports
{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
QUERY PARAMS
networkId
linkAggregationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
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/networks/:networkId/switch/linkAggregations/:linkAggregationId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"))
.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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId';
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId',
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId';
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"]
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId",
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
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/networks/:networkId/switch/linkAggregations/:linkAggregationId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId";
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
http DELETE {{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")! 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()
PUT
Update a link aggregation group
{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
QUERY PARAMS
networkId
linkAggregationId
BODY json
{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId" {:content-type :json
:form-params {:switchPorts [{:portId ""
:serial ""}]
:switchProfilePorts [{:portId ""
:profile ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"),
Content = new StringContent("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
payload := strings.NewReader("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 160
{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.setHeader("content-type", "application/json")
.setBody("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.header("content-type", "application/json")
.body("{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
switchPorts: [
{
portId: '',
serial: ''
}
],
switchProfilePorts: [
{
portId: '',
profile: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId',
headers: {'content-type': 'application/json'},
data: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"switchPorts":[{"portId":"","serial":""}],"switchProfilePorts":[{"portId":"","profile":""}]}'
};
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}}/networks/:networkId/switch/linkAggregations/:linkAggregationId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "switchPorts": [\n {\n "portId": "",\n "serial": ""\n }\n ],\n "switchProfilePorts": [\n {\n "portId": "",\n "profile": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId',
headers: {'content-type': 'application/json'},
body: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
switchPorts: [
{
portId: '',
serial: ''
}
],
switchProfilePorts: [
{
portId: '',
profile: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId',
headers: {'content-type': 'application/json'},
data: {
switchPorts: [{portId: '', serial: ''}],
switchProfilePorts: [{portId: '', profile: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"switchPorts":[{"portId":"","serial":""}],"switchProfilePorts":[{"portId":"","profile":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"switchPorts": @[ @{ @"portId": @"", @"serial": @"" } ],
@"switchProfilePorts": @[ @{ @"portId": @"", @"profile": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId', [
'body' => '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'switchPorts' => [
[
'portId' => '',
'serial' => ''
]
],
'switchProfilePorts' => [
[
'portId' => '',
'profile' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
payload = {
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId"
payload <- "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/linkAggregations/:linkAggregationId') do |req|
req.body = "{\n \"switchPorts\": [\n {\n \"portId\": \"\",\n \"serial\": \"\"\n }\n ],\n \"switchProfilePorts\": [\n {\n \"portId\": \"\",\n \"profile\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId";
let payload = json!({
"switchPorts": (
json!({
"portId": "",
"serial": ""
})
),
"switchProfilePorts": (
json!({
"portId": "",
"profile": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId \
--header 'content-type: application/json' \
--data '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}'
echo '{
"switchPorts": [
{
"portId": "",
"serial": ""
}
],
"switchProfilePorts": [
{
"portId": "",
"profile": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "switchPorts": [\n {\n "portId": "",\n "serial": ""\n }\n ],\n "switchProfilePorts": [\n {\n "portId": "",\n "profile": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"switchPorts": [
[
"portId": "",
"serial": ""
]
],
"switchProfilePorts": [
[
"portId": "",
"profile": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/linkAggregations/:linkAggregationId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "NDU2N18yXzM=",
"switchPorts": [
{
"portId": "1",
"serial": "Q234-ABCD-0001"
},
{
"portId": "2",
"serial": "Q234-ABCD-0002"
},
{
"portId": "3",
"serial": "Q234-ABCD-0003"
},
{
"portId": "4",
"serial": "Q234-ABCD-0004"
},
{
"portId": "5",
"serial": "Q234-ABCD-0005"
},
{
"portId": "6",
"serial": "Q234-ABCD-0006"
},
{
"portId": "7",
"serial": "Q234-ABCD-0007"
},
{
"portId": "8",
"serial": "Q234-ABCD-0008"
}
]
}
GET
Returns all supported malware settings for an MX network
{{baseUrl}}/networks/:networkId/security/malwareSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/security/malwareSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/security/malwareSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/security/malwareSettings"
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}}/networks/:networkId/security/malwareSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/security/malwareSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/security/malwareSettings"
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/networks/:networkId/security/malwareSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/security/malwareSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/security/malwareSettings"))
.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}}/networks/:networkId/security/malwareSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/security/malwareSettings")
.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}}/networks/:networkId/security/malwareSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/security/malwareSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/security/malwareSettings';
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}}/networks/:networkId/security/malwareSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/malwareSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/security/malwareSettings',
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}}/networks/:networkId/security/malwareSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/security/malwareSettings');
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}}/networks/:networkId/security/malwareSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/security/malwareSettings';
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}}/networks/:networkId/security/malwareSettings"]
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}}/networks/:networkId/security/malwareSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/security/malwareSettings",
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}}/networks/:networkId/security/malwareSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/security/malwareSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/security/malwareSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/security/malwareSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/security/malwareSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/security/malwareSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/security/malwareSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/security/malwareSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/security/malwareSettings")
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/networks/:networkId/security/malwareSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/security/malwareSettings";
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}}/networks/:networkId/security/malwareSettings
http GET {{baseUrl}}/networks/:networkId/security/malwareSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/security/malwareSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/security/malwareSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"allowedFiles": [
{
"comment": "allow ZIP file",
"sha256": "e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503"
}
],
"allowedUrls": [
{
"comment": "allow example.org",
"url": "example.org"
},
{
"comment": "allow help.com.au",
"url": "help.com.au"
}
],
"mode": "enabled"
}
PUT
Set the supported malware settings for an MX network
{{baseUrl}}/networks/:networkId/security/malwareSettings
QUERY PARAMS
networkId
BODY json
{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/security/malwareSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/security/malwareSettings" {:content-type :json
:form-params {:allowedFiles [{:comment ""
:sha256 ""}]
:allowedUrls [{:comment ""
:url ""}]
:mode ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/security/malwareSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/security/malwareSettings"),
Content = new StringContent("{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/security/malwareSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/security/malwareSettings"
payload := strings.NewReader("{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/security/malwareSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 166
{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/security/malwareSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/security/malwareSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/malwareSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/security/malwareSettings")
.header("content-type", "application/json")
.body("{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowedFiles: [
{
comment: '',
sha256: ''
}
],
allowedUrls: [
{
comment: '',
url: ''
}
],
mode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/security/malwareSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/malwareSettings',
headers: {'content-type': 'application/json'},
data: {
allowedFiles: [{comment: '', sha256: ''}],
allowedUrls: [{comment: '', url: ''}],
mode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/security/malwareSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowedFiles":[{"comment":"","sha256":""}],"allowedUrls":[{"comment":"","url":""}],"mode":""}'
};
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}}/networks/:networkId/security/malwareSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowedFiles": [\n {\n "comment": "",\n "sha256": ""\n }\n ],\n "allowedUrls": [\n {\n "comment": "",\n "url": ""\n }\n ],\n "mode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/security/malwareSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/security/malwareSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
allowedFiles: [{comment: '', sha256: ''}],
allowedUrls: [{comment: '', url: ''}],
mode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/malwareSettings',
headers: {'content-type': 'application/json'},
body: {
allowedFiles: [{comment: '', sha256: ''}],
allowedUrls: [{comment: '', url: ''}],
mode: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/security/malwareSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowedFiles: [
{
comment: '',
sha256: ''
}
],
allowedUrls: [
{
comment: '',
url: ''
}
],
mode: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/security/malwareSettings',
headers: {'content-type': 'application/json'},
data: {
allowedFiles: [{comment: '', sha256: ''}],
allowedUrls: [{comment: '', url: ''}],
mode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/security/malwareSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowedFiles":[{"comment":"","sha256":""}],"allowedUrls":[{"comment":"","url":""}],"mode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"allowedFiles": @[ @{ @"comment": @"", @"sha256": @"" } ],
@"allowedUrls": @[ @{ @"comment": @"", @"url": @"" } ],
@"mode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/security/malwareSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/security/malwareSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/security/malwareSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowedFiles' => [
[
'comment' => '',
'sha256' => ''
]
],
'allowedUrls' => [
[
'comment' => '',
'url' => ''
]
],
'mode' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/security/malwareSettings', [
'body' => '{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/security/malwareSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowedFiles' => [
[
'comment' => '',
'sha256' => ''
]
],
'allowedUrls' => [
[
'comment' => '',
'url' => ''
]
],
'mode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowedFiles' => [
[
'comment' => '',
'sha256' => ''
]
],
'allowedUrls' => [
[
'comment' => '',
'url' => ''
]
],
'mode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/security/malwareSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/security/malwareSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/security/malwareSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/security/malwareSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/security/malwareSettings"
payload = {
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/security/malwareSettings"
payload <- "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/security/malwareSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/security/malwareSettings') do |req|
req.body = "{\n \"allowedFiles\": [\n {\n \"comment\": \"\",\n \"sha256\": \"\"\n }\n ],\n \"allowedUrls\": [\n {\n \"comment\": \"\",\n \"url\": \"\"\n }\n ],\n \"mode\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/security/malwareSettings";
let payload = json!({
"allowedFiles": (
json!({
"comment": "",
"sha256": ""
})
),
"allowedUrls": (
json!({
"comment": "",
"url": ""
})
),
"mode": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/security/malwareSettings \
--header 'content-type: application/json' \
--data '{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}'
echo '{
"allowedFiles": [
{
"comment": "",
"sha256": ""
}
],
"allowedUrls": [
{
"comment": "",
"url": ""
}
],
"mode": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/security/malwareSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allowedFiles": [\n {\n "comment": "",\n "sha256": ""\n }\n ],\n "allowedUrls": [\n {\n "comment": "",\n "url": ""\n }\n ],\n "mode": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/security/malwareSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowedFiles": [
[
"comment": "",
"sha256": ""
]
],
"allowedUrls": [
[
"comment": "",
"url": ""
]
],
"mode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/security/malwareSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"allowedFiles": [
{
"comment": "allow ZIP file",
"sha256": "e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503"
}
],
"allowedUrls": [
{
"comment": "allow example.org",
"url": "example.org"
},
{
"comment": "allow help.com.au",
"url": "help.com.au"
}
],
"mode": "enabled"
}
GET
List the splash or RADIUS users configured under Meraki Authentication for a network
{{baseUrl}}/networks/:networkId/merakiAuthUsers
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/merakiAuthUsers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/merakiAuthUsers")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers"
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}}/networks/:networkId/merakiAuthUsers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/merakiAuthUsers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/merakiAuthUsers"
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/networks/:networkId/merakiAuthUsers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/merakiAuthUsers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/merakiAuthUsers"))
.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}}/networks/:networkId/merakiAuthUsers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/merakiAuthUsers")
.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}}/networks/:networkId/merakiAuthUsers');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/merakiAuthUsers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/merakiAuthUsers';
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}}/networks/:networkId/merakiAuthUsers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/merakiAuthUsers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/merakiAuthUsers',
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}}/networks/:networkId/merakiAuthUsers'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/merakiAuthUsers');
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}}/networks/:networkId/merakiAuthUsers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/merakiAuthUsers';
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}}/networks/:networkId/merakiAuthUsers"]
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}}/networks/:networkId/merakiAuthUsers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/merakiAuthUsers",
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}}/networks/:networkId/merakiAuthUsers');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/merakiAuthUsers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/merakiAuthUsers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/merakiAuthUsers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/merakiAuthUsers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/merakiAuthUsers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/merakiAuthUsers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/merakiAuthUsers")
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/networks/:networkId/merakiAuthUsers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers";
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}}/networks/:networkId/merakiAuthUsers
http GET {{baseUrl}}/networks/:networkId/merakiAuthUsers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/merakiAuthUsers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/merakiAuthUsers")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"accountType": "Guest",
"authorizations": [
{
"authorizedByEmail": "miles@meraki.com",
"authorizedByName": "Miles Meraki",
"authorizedZone": "Store WiFi",
"expiresAt": 1526087474
}
],
"createdAt": 1518365681,
"email": "miles@meraki.com",
"id": "aGlAaGkuY29t",
"name": "Miles Meraki"
}
]
GET
Return the Meraki Auth splash or RADIUS user
{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId
QUERY PARAMS
networkId
merakiAuthUserId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"
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/networks/:networkId/merakiAuthUsers/:merakiAuthUserId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"))
.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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
.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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId';
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/merakiAuthUsers/:merakiAuthUserId',
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId');
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId';
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"]
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId",
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")
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/networks/:networkId/merakiAuthUsers/:merakiAuthUserId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId";
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}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId
http GET {{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/merakiAuthUsers/:merakiAuthUserId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accountType": "Guest",
"authorizations": [
{
"authorizedByEmail": "miles@meraki.com",
"authorizedByName": "Miles Meraki",
"authorizedZone": "Store WiFi",
"expiresAt": 1526087474
}
],
"createdAt": 1518365681,
"email": "miles@meraki.com",
"id": "aGlAaGkuY29t",
"name": "Miles Meraki"
}
GET
Show the LAN Settings of a MG
{{baseUrl}}/devices/:serial/cellularGateway/settings
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/cellularGateway/settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/cellularGateway/settings")
require "http/client"
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings"
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}}/devices/:serial/cellularGateway/settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/cellularGateway/settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/cellularGateway/settings"
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/devices/:serial/cellularGateway/settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/cellularGateway/settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/cellularGateway/settings"))
.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}}/devices/:serial/cellularGateway/settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/cellularGateway/settings")
.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}}/devices/:serial/cellularGateway/settings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings';
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}}/devices/:serial/cellularGateway/settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/cellularGateway/settings',
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}}/devices/:serial/cellularGateway/settings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/cellularGateway/settings');
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}}/devices/:serial/cellularGateway/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings';
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}}/devices/:serial/cellularGateway/settings"]
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}}/devices/:serial/cellularGateway/settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/cellularGateway/settings",
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}}/devices/:serial/cellularGateway/settings');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/cellularGateway/settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/cellularGateway/settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/cellularGateway/settings")
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/devices/:serial/cellularGateway/settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/cellularGateway/settings";
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}}/devices/:serial/cellularGateway/settings
http GET {{baseUrl}}/devices/:serial/cellularGateway/settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/cellularGateway/settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/cellularGateway/settings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"deviceLanIp": "192.168.0.33",
"deviceName": "name of the MG",
"deviceSubnet": "192.168.0.32/27",
"fixedIpAssignments": [
{
"ip": "192.168.0.10",
"mac": "0b:00:00:00:00:ac",
"name": "server 1"
},
{
"ip": "192.168.0.20",
"mac": "0b:00:00:00:00:ab",
"name": "server 2"
}
],
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
]
}
PUT
Update the LAN Settings for a single MG.
{{baseUrl}}/devices/:serial/cellularGateway/settings
QUERY PARAMS
serial
BODY json
{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/cellularGateway/settings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/devices/:serial/cellularGateway/settings" {:content-type :json
:form-params {:fixedIpAssignments [{:ip ""
:mac ""
:name ""}]
:reservedIpRanges [{:comment ""
:end ""
:start ""}]}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/cellularGateway/settings"),
Content = new StringContent("{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/cellularGateway/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/cellularGateway/settings"
payload := strings.NewReader("{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/devices/:serial/cellularGateway/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 192
{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/devices/:serial/cellularGateway/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/cellularGateway/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/devices/:serial/cellularGateway/settings")
.header("content-type", "application/json")
.body("{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
fixedIpAssignments: [
{
ip: '',
mac: '',
name: ''
}
],
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings',
headers: {'content-type': 'application/json'},
data: {
fixedIpAssignments: [{ip: '', mac: '', name: ''}],
reservedIpRanges: [{comment: '', end: '', start: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"fixedIpAssignments":[{"ip":"","mac":"","name":""}],"reservedIpRanges":[{"comment":"","end":"","start":""}]}'
};
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}}/devices/:serial/cellularGateway/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "fixedIpAssignments": [\n {\n "ip": "",\n "mac": "",\n "name": ""\n }\n ],\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/cellularGateway/settings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
fixedIpAssignments: [{ip: '', mac: '', name: ''}],
reservedIpRanges: [{comment: '', end: '', start: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings',
headers: {'content-type': 'application/json'},
body: {
fixedIpAssignments: [{ip: '', mac: '', name: ''}],
reservedIpRanges: [{comment: '', end: '', start: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
fixedIpAssignments: [
{
ip: '',
mac: '',
name: ''
}
],
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings',
headers: {'content-type': 'application/json'},
data: {
fixedIpAssignments: [{ip: '', mac: '', name: ''}],
reservedIpRanges: [{comment: '', end: '', start: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"fixedIpAssignments":[{"ip":"","mac":"","name":""}],"reservedIpRanges":[{"comment":"","end":"","start":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"fixedIpAssignments": @[ @{ @"ip": @"", @"mac": @"", @"name": @"" } ],
@"reservedIpRanges": @[ @{ @"comment": @"", @"end": @"", @"start": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/cellularGateway/settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices/:serial/cellularGateway/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/cellularGateway/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fixedIpAssignments' => [
[
'ip' => '',
'mac' => '',
'name' => ''
]
],
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings', [
'body' => '{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'fixedIpAssignments' => [
[
'ip' => '',
'mac' => '',
'name' => ''
]
],
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'fixedIpAssignments' => [
[
'ip' => '',
'mac' => '',
'name' => ''
]
],
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/devices/:serial/cellularGateway/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings"
payload = {
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/cellularGateway/settings"
payload <- "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/cellularGateway/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/devices/:serial/cellularGateway/settings') do |req|
req.body = "{\n \"fixedIpAssignments\": [\n {\n \"ip\": \"\",\n \"mac\": \"\",\n \"name\": \"\"\n }\n ],\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/cellularGateway/settings";
let payload = json!({
"fixedIpAssignments": (
json!({
"ip": "",
"mac": "",
"name": ""
})
),
"reservedIpRanges": (
json!({
"comment": "",
"end": "",
"start": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/devices/:serial/cellularGateway/settings \
--header 'content-type: application/json' \
--data '{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}'
echo '{
"fixedIpAssignments": [
{
"ip": "",
"mac": "",
"name": ""
}
],
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
]
}' | \
http PUT {{baseUrl}}/devices/:serial/cellularGateway/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "fixedIpAssignments": [\n {\n "ip": "",\n "mac": "",\n "name": ""\n }\n ],\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/cellularGateway/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"fixedIpAssignments": [
[
"ip": "",
"mac": "",
"name": ""
]
],
"reservedIpRanges": [
[
"comment": "",
"end": "",
"start": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/cellularGateway/settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"deviceLanIp": "192.168.0.33",
"deviceName": "name of the MG",
"deviceSubnet": "192.168.0.32/27",
"fixedIpAssignments": [
{
"ip": "192.168.0.10",
"mac": "0b:00:00:00:00:ac",
"name": "server 1"
},
{
"ip": "192.168.0.20",
"mac": "0b:00:00:00:00:ab",
"name": "server 2"
}
],
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
]
}
GET
Returns the port forwarding rules for a single MG.
{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
require "http/client"
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
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}}/devices/:serial/cellularGateway/settings/portForwardingRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
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/devices/:serial/cellularGateway/settings/portForwardingRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"))
.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}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.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}}/devices/:serial/cellularGateway/settings/portForwardingRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules';
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}}/devices/:serial/cellularGateway/settings/portForwardingRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules',
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}}/devices/:serial/cellularGateway/settings/portForwardingRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
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}}/devices/:serial/cellularGateway/settings/portForwardingRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules';
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}}/devices/:serial/cellularGateway/settings/portForwardingRules"]
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}}/devices/:serial/cellularGateway/settings/portForwardingRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules",
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}}/devices/:serial/cellularGateway/settings/portForwardingRules');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
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/devices/:serial/cellularGateway/settings/portForwardingRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules";
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}}/devices/:serial/cellularGateway/settings/portForwardingRules
http GET {{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"access": "any",
"lanIp": "172.31.128.5",
"localPort": "4",
"name": "test",
"protocol": "tcp",
"publicPort": "11-12",
"uplink": "both"
},
{
"access": "restricted",
"allowedIps": [
"10.10.10.10",
"10.10.10.11"
],
"lanIp": "172.31.128.5",
"localPort": "5",
"name": "test 2",
"protocol": "tcp",
"publicPort": "99",
"uplink": "both"
}
]
}
PUT
Updates the port forwarding rules for a single MG.
{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules
QUERY PARAMS
serial
BODY json
{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules" {:content-type :json
:form-params {:rules [{:access ""
:allowedIps []
:lanIp ""
:localPort ""
:name ""
:protocol ""
:publicPort ""}]}})
require "http/client"
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 181
{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"access":"","allowedIps":[],"lanIp":"","localPort":"","name":"","protocol":"","publicPort":""}]}'
};
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}}/devices/:serial/cellularGateway/settings/portForwardingRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "access": "",\n "allowedIps": [],\n "lanIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
access: '',
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"access":"","allowedIps":[],"lanIp":"","localPort":"","name":"","protocol":"","publicPort":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"access": @"", @"allowedIps": @[ ], @"lanIp": @"", @"localPort": @"", @"name": @"", @"protocol": @"", @"publicPort": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'access' => '',
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules', [
'body' => '{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'access' => '',
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'access' => '',
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
payload = { "rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules"
payload <- "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/devices/:serial/cellularGateway/settings/portForwardingRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"access\": \"\",\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules";
let payload = json!({"rules": (
json!({
"access": "",
"allowedIps": (),
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}'
echo '{
"rules": [
{
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
]
}' | \
http PUT {{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "access": "",\n "allowedIps": [],\n "lanIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"access": "",
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/cellularGateway/settings/portForwardingRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"access": "any",
"lanIp": "172.31.128.5",
"localPort": "4",
"name": "test",
"protocol": "tcp",
"publicPort": "11-12",
"uplink": "both"
},
{
"access": "restricted",
"allowedIps": [
"10.10.10.10",
"10.10.10.11"
],
"lanIp": "172.31.128.5",
"localPort": "5",
"name": "test 2",
"protocol": "tcp",
"publicPort": "99",
"uplink": "both"
}
]
}
POST
Add a media server to be monitored for this organization
{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers
QUERY PARAMS
organizationId
BODY json
{
"address": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers" {:content-type :json
:form-params {:address ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"),
Content = new StringContent("{\n \"address\": \"\",\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
payload := strings.NewReader("{\n \"address\": \"\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/insight/monitoredMediaServers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"address": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers',
headers: {'content-type': 'application/json'},
data: {address: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","name":""}'
};
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}}/organizations/:organizationId/insight/monitoredMediaServers',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/insight/monitoredMediaServers',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({address: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers',
headers: {'content-type': 'application/json'},
body: {address: '', name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers',
headers: {'content-type': 'application/json'},
data: {address: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"]
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}}/organizations/:organizationId/insight/monitoredMediaServers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers', [
'body' => '{
"address": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/insight/monitoredMediaServers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
payload = {
"address": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
payload <- "{\n \"address\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/insight/monitoredMediaServers') do |req|
req.body = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers";
let payload = json!({
"address": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers \
--header 'content-type: application/json' \
--data '{
"address": "",
"name": ""
}'
echo '{
"address": "",
"name": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"address": "123.123.123.1",
"id": "1284392014819",
"name": "Sample VoIP Provider"
}
DELETE
Delete a monitored media server from this organization
{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
QUERY PARAMS
organizationId
monitoredMediaServerId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
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/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"))
.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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"]
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId",
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
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/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId";
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
http DELETE {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")! 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
List the monitored media servers for this organization
{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
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}}/organizations/:organizationId/insight/monitoredMediaServers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
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/organizations/:organizationId/insight/monitoredMediaServers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"))
.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}}/organizations/:organizationId/insight/monitoredMediaServers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.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}}/organizations/:organizationId/insight/monitoredMediaServers');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers';
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}}/organizations/:organizationId/insight/monitoredMediaServers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/insight/monitoredMediaServers',
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}}/organizations/:organizationId/insight/monitoredMediaServers'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
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}}/organizations/:organizationId/insight/monitoredMediaServers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers';
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}}/organizations/:organizationId/insight/monitoredMediaServers"]
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}}/organizations/:organizationId/insight/monitoredMediaServers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers",
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}}/organizations/:organizationId/insight/monitoredMediaServers');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/insight/monitoredMediaServers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")
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/organizations/:organizationId/insight/monitoredMediaServers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers";
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}}/organizations/:organizationId/insight/monitoredMediaServers
http GET {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"address": "123.123.123.1",
"id": "1284392014819",
"name": "Sample VoIP Provider"
}
]
GET
Return a monitored media server for this organization
{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
QUERY PARAMS
organizationId
monitoredMediaServerId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
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/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"))
.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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"]
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId",
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
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/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId";
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
http GET {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"address": "123.123.123.1",
"id": "1284392014819",
"name": "Sample VoIP Provider"
}
PUT
Update a monitored media server for this organization
{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
QUERY PARAMS
organizationId
monitoredMediaServerId
BODY json
{
"address": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId" {:content-type :json
:form-params {:address ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"),
Content = new StringContent("{\n \"address\": \"\",\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
payload := strings.NewReader("{\n \"address\": \"\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"address": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
headers: {'content-type': 'application/json'},
data: {address: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","name":""}'
};
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}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({address: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
headers: {'content-type': 'application/json'},
body: {address: '', name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId',
headers: {'content-type': 'application/json'},
data: {address: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId', [
'body' => '{
"address": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
payload = {
"address": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId"
payload <- "{\n \"address\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId') do |req|
req.body = "{\n \"address\": \"\",\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId";
let payload = json!({
"address": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId \
--header 'content-type: application/json' \
--data '{
"address": "",
"name": ""
}'
echo '{
"address": "",
"name": ""
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/insight/monitoredMediaServers/:monitoredMediaServerId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"address": "123.123.123.1",
"id": "1284392014819",
"name": "Sample VoIP Provider"
}
GET
Return the L3 firewall rules for an SSID on an MR network
{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules
QUERY PARAMS
networkId
number
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
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}}/networks/:networkId/ssids/:number/l3FirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
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/networks/:networkId/ssids/:number/l3FirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"))
.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}}/networks/:networkId/ssids/:number/l3FirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.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}}/networks/:networkId/ssids/:number/l3FirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules';
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}}/networks/:networkId/ssids/:number/l3FirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number/l3FirewallRules',
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}}/networks/:networkId/ssids/:number/l3FirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
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}}/networks/:networkId/ssids/:number/l3FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules';
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}}/networks/:networkId/ssids/:number/l3FirewallRules"]
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}}/networks/:networkId/ssids/:number/l3FirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules",
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}}/networks/:networkId/ssids/:number/l3FirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/ssids/:number/l3FirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
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/networks/:networkId/ssids/:number/l3FirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules";
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}}/networks/:networkId/ssids/:number/l3FirewallRules
http GET {{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp"
}
]
PUT
Update the L3 firewall rules of an SSID on an MR network
{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules
QUERY PARAMS
networkId
number
BODY json
{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules" {:content-type :json
:form-params {:allowLanAccess false
:rules [{:comment ""
:destCidr ""
:destPort ""
:policy ""
:protocol ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"),
Content = new StringContent("{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
payload := strings.NewReader("{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/ssids/:number/l3FirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 165
{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.header("content-type", "application/json")
.body("{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
allowLanAccess: false,
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules',
headers: {'content-type': 'application/json'},
data: {
allowLanAccess: false,
rules: [{comment: '', destCidr: '', destPort: '', policy: '', protocol: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowLanAccess":false,"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":""}]}'
};
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}}/networks/:networkId/ssids/:number/l3FirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowLanAccess": false,\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number/l3FirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
allowLanAccess: false,
rules: [{comment: '', destCidr: '', destPort: '', policy: '', protocol: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules',
headers: {'content-type': 'application/json'},
body: {
allowLanAccess: false,
rules: [{comment: '', destCidr: '', destPort: '', policy: '', protocol: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowLanAccess: false,
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules',
headers: {'content-type': 'application/json'},
data: {
allowLanAccess: false,
rules: [{comment: '', destCidr: '', destPort: '', policy: '', protocol: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowLanAccess":false,"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"allowLanAccess": @NO,
@"rules": @[ @{ @"comment": @"", @"destCidr": @"", @"destPort": @"", @"policy": @"", @"protocol": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowLanAccess' => null,
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules', [
'body' => '{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowLanAccess' => null,
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowLanAccess' => null,
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/ssids/:number/l3FirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
payload = {
"allowLanAccess": False,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules"
payload <- "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/ssids/:number/l3FirewallRules') do |req|
req.body = "{\n \"allowLanAccess\": false,\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules";
let payload = json!({
"allowLanAccess": false,
"rules": (
json!({
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules \
--header 'content-type: application/json' \
--data '{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}'
echo '{
"allowLanAccess": false,
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allowLanAccess": false,\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowLanAccess": false,
"rules": [
[
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number/l3FirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp"
}
]
GET
Return historical records for analytic zones
{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history
QUERY PARAMS
serial
zoneId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history"
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}}/devices/:serial/camera/analytics/zones/:zoneId/history"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history"
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/devices/:serial/camera/analytics/zones/:zoneId/history HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history"))
.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}}/devices/:serial/camera/analytics/zones/:zoneId/history")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")
.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}}/devices/:serial/camera/analytics/zones/:zoneId/history');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history';
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}}/devices/:serial/camera/analytics/zones/:zoneId/history',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/analytics/zones/:zoneId/history',
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}}/devices/:serial/camera/analytics/zones/:zoneId/history'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history');
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}}/devices/:serial/camera/analytics/zones/:zoneId/history'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history';
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}}/devices/:serial/camera/analytics/zones/:zoneId/history"]
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}}/devices/:serial/camera/analytics/zones/:zoneId/history" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history",
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}}/devices/:serial/camera/analytics/zones/:zoneId/history');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/analytics/zones/:zoneId/history")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")
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/devices/:serial/camera/analytics/zones/:zoneId/history') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history";
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}}/devices/:serial/camera/analytics/zones/:zoneId/history
http GET {{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/analytics/zones/:zoneId/history")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"averageCount": 1.5,
"endTs": "2018-08-15T18:33:38.123Z",
"entrances": 5,
"startTs": "2018-08-15T18:32:38.123Z"
}
]
GET
Returns all configured analytic zones for this camera
{{baseUrl}}/devices/:serial/camera/analytics/zones
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/analytics/zones");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/analytics/zones")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/analytics/zones"
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}}/devices/:serial/camera/analytics/zones"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/analytics/zones");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/analytics/zones"
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/devices/:serial/camera/analytics/zones HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/analytics/zones")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/analytics/zones"))
.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}}/devices/:serial/camera/analytics/zones")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/analytics/zones")
.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}}/devices/:serial/camera/analytics/zones');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/analytics/zones'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/analytics/zones';
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}}/devices/:serial/camera/analytics/zones',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/analytics/zones")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/analytics/zones',
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}}/devices/:serial/camera/analytics/zones'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/analytics/zones');
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}}/devices/:serial/camera/analytics/zones'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/analytics/zones';
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}}/devices/:serial/camera/analytics/zones"]
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}}/devices/:serial/camera/analytics/zones" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/analytics/zones",
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}}/devices/:serial/camera/analytics/zones');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/analytics/zones');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/analytics/zones');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/analytics/zones' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/analytics/zones' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/analytics/zones")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/analytics/zones"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/analytics/zones"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/analytics/zones")
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/devices/:serial/camera/analytics/zones') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/analytics/zones";
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}}/devices/:serial/camera/analytics/zones
http GET {{baseUrl}}/devices/:serial/camera/analytics/zones
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/analytics/zones
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/analytics/zones")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "0",
"label": "Full Frame",
"regionOfInterest": {
"x0": "0.00",
"x1": "1.00",
"y0": "0.00",
"y1": "1.00"
},
"type": "occupancy"
}
]
GET
Returns an overview of aggregate analytics data for a timespan
{{baseUrl}}/devices/:serial/camera/analytics/overview
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/analytics/overview");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/analytics/overview")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/analytics/overview"
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}}/devices/:serial/camera/analytics/overview"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/analytics/overview");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/analytics/overview"
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/devices/:serial/camera/analytics/overview HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/analytics/overview")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/analytics/overview"))
.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}}/devices/:serial/camera/analytics/overview")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/analytics/overview")
.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}}/devices/:serial/camera/analytics/overview');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/analytics/overview'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/analytics/overview';
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}}/devices/:serial/camera/analytics/overview',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/analytics/overview")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/analytics/overview',
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}}/devices/:serial/camera/analytics/overview'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/analytics/overview');
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}}/devices/:serial/camera/analytics/overview'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/analytics/overview';
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}}/devices/:serial/camera/analytics/overview"]
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}}/devices/:serial/camera/analytics/overview" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/analytics/overview",
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}}/devices/:serial/camera/analytics/overview');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/analytics/overview');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/analytics/overview');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/analytics/overview' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/analytics/overview' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/analytics/overview")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/analytics/overview"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/analytics/overview"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/analytics/overview")
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/devices/:serial/camera/analytics/overview') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/analytics/overview";
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}}/devices/:serial/camera/analytics/overview
http GET {{baseUrl}}/devices/:serial/camera/analytics/overview
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/analytics/overview
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/analytics/overview")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"averageCount": 5,
"endTs": "2018-08-15T18:33:38.123Z",
"entrances": 254,
"startTs": "2018-08-15T18:32:38.123Z",
"zoneId": 0
}
]
GET
Returns live state from camera of analytics zones
{{baseUrl}}/devices/:serial/camera/analytics/live
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/analytics/live");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/analytics/live")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/analytics/live"
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}}/devices/:serial/camera/analytics/live"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/analytics/live");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/analytics/live"
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/devices/:serial/camera/analytics/live HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/analytics/live")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/analytics/live"))
.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}}/devices/:serial/camera/analytics/live")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/analytics/live")
.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}}/devices/:serial/camera/analytics/live');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/analytics/live'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/analytics/live';
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}}/devices/:serial/camera/analytics/live',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/analytics/live")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/analytics/live',
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}}/devices/:serial/camera/analytics/live'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/analytics/live');
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}}/devices/:serial/camera/analytics/live'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/analytics/live';
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}}/devices/:serial/camera/analytics/live"]
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}}/devices/:serial/camera/analytics/live" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/analytics/live",
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}}/devices/:serial/camera/analytics/live');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/analytics/live');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/analytics/live');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/analytics/live' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/analytics/live' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/analytics/live")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/analytics/live"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/analytics/live"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/analytics/live")
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/devices/:serial/camera/analytics/live') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/analytics/live";
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}}/devices/:serial/camera/analytics/live
http GET {{baseUrl}}/devices/:serial/camera/analytics/live
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/analytics/live
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/analytics/live")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ts": "2018-08-15T18:32:38.123Z",
"zones": {
"0": {
"person": 0
}
}
}
GET
Returns most recent record for analytics zones
{{baseUrl}}/devices/:serial/camera/analytics/recent
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/camera/analytics/recent");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/camera/analytics/recent")
require "http/client"
url = "{{baseUrl}}/devices/:serial/camera/analytics/recent"
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}}/devices/:serial/camera/analytics/recent"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/camera/analytics/recent");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/camera/analytics/recent"
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/devices/:serial/camera/analytics/recent HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/camera/analytics/recent")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/camera/analytics/recent"))
.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}}/devices/:serial/camera/analytics/recent")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/camera/analytics/recent")
.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}}/devices/:serial/camera/analytics/recent');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/camera/analytics/recent'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/camera/analytics/recent';
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}}/devices/:serial/camera/analytics/recent',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/camera/analytics/recent")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/camera/analytics/recent',
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}}/devices/:serial/camera/analytics/recent'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/camera/analytics/recent');
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}}/devices/:serial/camera/analytics/recent'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/camera/analytics/recent';
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}}/devices/:serial/camera/analytics/recent"]
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}}/devices/:serial/camera/analytics/recent" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/camera/analytics/recent",
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}}/devices/:serial/camera/analytics/recent');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/camera/analytics/recent');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/camera/analytics/recent');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/camera/analytics/recent' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/camera/analytics/recent' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/camera/analytics/recent")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/camera/analytics/recent"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/camera/analytics/recent"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/camera/analytics/recent")
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/devices/:serial/camera/analytics/recent') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/camera/analytics/recent";
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}}/devices/:serial/camera/analytics/recent
http GET {{baseUrl}}/devices/:serial/camera/analytics/recent
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/camera/analytics/recent
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/camera/analytics/recent")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"averageCount": 2.54,
"endTs": "2018-08-15T18:33:38.123Z",
"entrances": 10,
"startTs": "2018-08-15T18:32:38.123Z",
"zoneId": 0
}
]
GET
Return the 1-1 NAT mapping rules for an MX network
{{baseUrl}}/networks/:networkId/oneToOneNatRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/oneToOneNatRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/oneToOneNatRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
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}}/networks/:networkId/oneToOneNatRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/oneToOneNatRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
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/networks/:networkId/oneToOneNatRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/oneToOneNatRules"))
.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}}/networks/:networkId/oneToOneNatRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.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}}/networks/:networkId/oneToOneNatRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/oneToOneNatRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/oneToOneNatRules';
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}}/networks/:networkId/oneToOneNatRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/oneToOneNatRules',
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}}/networks/:networkId/oneToOneNatRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/oneToOneNatRules');
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}}/networks/:networkId/oneToOneNatRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/oneToOneNatRules';
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}}/networks/:networkId/oneToOneNatRules"]
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}}/networks/:networkId/oneToOneNatRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/oneToOneNatRules",
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}}/networks/:networkId/oneToOneNatRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/oneToOneNatRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/oneToOneNatRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/oneToOneNatRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/oneToOneNatRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/oneToOneNatRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
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/networks/:networkId/oneToOneNatRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules";
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}}/networks/:networkId/oneToOneNatRules
http GET {{baseUrl}}/networks/:networkId/oneToOneNatRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/oneToOneNatRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/oneToOneNatRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [
"10.82.112.0/24",
"10.82.0.0/16"
],
"destinationPorts": [
"80"
],
"protocol": "tcp"
},
{
"allowedIps": [
"10.81.110.5",
"10.81.0.0/16"
],
"destinationPorts": [
"8080"
],
"protocol": "udp"
}
],
"lanIp": "192.168.128.22",
"name": "Service behind NAT",
"publicIp": "146.12.3.33",
"uplink": "internet1"
}
]
}
PUT
Set the 1-1 NAT mapping rules for an MX network
{{baseUrl}}/networks/:networkId/oneToOneNatRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/oneToOneNatRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/oneToOneNatRules" {:content-type :json
:form-params {:rules [{:allowedInbound [{:allowedIps []
:destinationPorts []
:protocol ""}]
:lanIp ""
:name ""
:publicIp ""
:uplink ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/oneToOneNatRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/oneToOneNatRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/oneToOneNatRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 252
{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/oneToOneNatRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
allowedInbound: [
{
allowedIps: [],
destinationPorts: [],
protocol: ''
}
],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/oneToOneNatRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToOneNatRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
allowedInbound: [{allowedIps: [], destinationPorts: [], protocol: ''}],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/oneToOneNatRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"allowedInbound":[{"allowedIps":[],"destinationPorts":[],"protocol":""}],"lanIp":"","name":"","publicIp":"","uplink":""}]}'
};
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}}/networks/:networkId/oneToOneNatRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "allowedInbound": [\n {\n "allowedIps": [],\n "destinationPorts": [],\n "protocol": ""\n }\n ],\n "lanIp": "",\n "name": "",\n "publicIp": "",\n "uplink": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/oneToOneNatRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
allowedInbound: [{allowedIps: [], destinationPorts: [], protocol: ''}],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToOneNatRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
allowedInbound: [{allowedIps: [], destinationPorts: [], protocol: ''}],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/oneToOneNatRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
allowedInbound: [
{
allowedIps: [],
destinationPorts: [],
protocol: ''
}
],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToOneNatRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
allowedInbound: [{allowedIps: [], destinationPorts: [], protocol: ''}],
lanIp: '',
name: '',
publicIp: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/oneToOneNatRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"allowedInbound":[{"allowedIps":[],"destinationPorts":[],"protocol":""}],"lanIp":"","name":"","publicIp":"","uplink":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"allowedInbound": @[ @{ @"allowedIps": @[ ], @"destinationPorts": @[ ], @"protocol": @"" } ], @"lanIp": @"", @"name": @"", @"publicIp": @"", @"uplink": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/oneToOneNatRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/oneToOneNatRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/oneToOneNatRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'allowedInbound' => [
[
'allowedIps' => [
],
'destinationPorts' => [
],
'protocol' => ''
]
],
'lanIp' => '',
'name' => '',
'publicIp' => '',
'uplink' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/oneToOneNatRules', [
'body' => '{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/oneToOneNatRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'allowedInbound' => [
[
'allowedIps' => [
],
'destinationPorts' => [
],
'protocol' => ''
]
],
'lanIp' => '',
'name' => '',
'publicIp' => '',
'uplink' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'allowedInbound' => [
[
'allowedIps' => [
],
'destinationPorts' => [
],
'protocol' => ''
]
],
'lanIp' => '',
'name' => '',
'publicIp' => '',
'uplink' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/oneToOneNatRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/oneToOneNatRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/oneToOneNatRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/oneToOneNatRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
payload = { "rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/oneToOneNatRules"
payload <- "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/oneToOneNatRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/oneToOneNatRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"allowedInbound\": [\n {\n \"allowedIps\": [],\n \"destinationPorts\": [],\n \"protocol\": \"\"\n }\n ],\n \"lanIp\": \"\",\n \"name\": \"\",\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/oneToOneNatRules";
let payload = json!({"rules": (
json!({
"allowedInbound": (
json!({
"allowedIps": (),
"destinationPorts": (),
"protocol": ""
})
),
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/oneToOneNatRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}'
echo '{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
}
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/oneToOneNatRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "allowedInbound": [\n {\n "allowedIps": [],\n "destinationPorts": [],\n "protocol": ""\n }\n ],\n "lanIp": "",\n "name": "",\n "publicIp": "",\n "uplink": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/oneToOneNatRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"allowedInbound": [
[
"allowedIps": [],
"destinationPorts": [],
"protocol": ""
]
],
"lanIp": "",
"name": "",
"publicIp": "",
"uplink": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/oneToOneNatRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"allowedInbound": [
{
"allowedIps": [
"10.82.112.0/24",
"10.82.0.0/16"
],
"destinationPorts": [
"80"
],
"protocol": "tcp"
},
{
"allowedIps": [
"10.81.110.5",
"10.81.0.0/16"
],
"destinationPorts": [
"8080"
],
"protocol": "udp"
}
],
"lanIp": "192.168.128.22",
"name": "Service behind NAT",
"publicIp": "146.12.3.33",
"uplink": "internet1"
}
]
}
GET
Return the 1-Many NAT mapping rules for an MX network
{{baseUrl}}/networks/:networkId/oneToManyNatRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/oneToManyNatRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/oneToManyNatRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
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}}/networks/:networkId/oneToManyNatRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/oneToManyNatRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
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/networks/:networkId/oneToManyNatRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/oneToManyNatRules"))
.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}}/networks/:networkId/oneToManyNatRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.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}}/networks/:networkId/oneToManyNatRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/oneToManyNatRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/oneToManyNatRules';
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}}/networks/:networkId/oneToManyNatRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/oneToManyNatRules',
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}}/networks/:networkId/oneToManyNatRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/oneToManyNatRules');
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}}/networks/:networkId/oneToManyNatRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/oneToManyNatRules';
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}}/networks/:networkId/oneToManyNatRules"]
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}}/networks/:networkId/oneToManyNatRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/oneToManyNatRules",
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}}/networks/:networkId/oneToManyNatRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/oneToManyNatRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/oneToManyNatRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/oneToManyNatRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/oneToManyNatRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/oneToManyNatRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
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/networks/:networkId/oneToManyNatRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules";
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}}/networks/:networkId/oneToManyNatRules
http GET {{baseUrl}}/networks/:networkId/oneToManyNatRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/oneToManyNatRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/oneToManyNatRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"portRules": [
{
"allowedIps": [
"any"
],
"localIp": "192.168.128.1",
"localPort": "443",
"name": "Rule 1",
"protocol": "tcp",
"publicPort": "9443"
},
{
"allowedIps": [
"10.82.110.0/24",
"10.82.111.0/24"
],
"localIp": "192.168.128.1",
"localPort": "80",
"name": "Rule 2",
"protocol": "tcp",
"publicPort": "8080"
}
],
"publicIp": "146.11.11.13",
"uplink": "internet1"
}
]
}
PUT
Set the 1-Many NAT mapping rules for an MX network
{{baseUrl}}/networks/:networkId/oneToManyNatRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/oneToManyNatRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/oneToManyNatRules" {:content-type :json
:form-params {:rules [{:portRules [{:allowedIps []
:localIp ""
:localPort ""
:name ""
:protocol ""
:publicPort ""}]
:publicIp ""
:uplink ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/oneToManyNatRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/oneToManyNatRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/oneToManyNatRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 278
{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/oneToManyNatRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/oneToManyNatRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToManyNatRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/oneToManyNatRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"portRules":[{"allowedIps":[],"localIp":"","localPort":"","name":"","protocol":"","publicPort":""}],"publicIp":"","uplink":""}]}'
};
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}}/networks/:networkId/oneToManyNatRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "portRules": [\n {\n "allowedIps": [],\n "localIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": ""\n }\n ],\n "publicIp": "",\n "uplink": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/oneToManyNatRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToManyNatRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/oneToManyNatRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/oneToManyNatRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
portRules: [
{
allowedIps: [],
localIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: ''
}
],
publicIp: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/oneToManyNatRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"portRules":[{"allowedIps":[],"localIp":"","localPort":"","name":"","protocol":"","publicPort":""}],"publicIp":"","uplink":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"portRules": @[ @{ @"allowedIps": @[ ], @"localIp": @"", @"localPort": @"", @"name": @"", @"protocol": @"", @"publicPort": @"" } ], @"publicIp": @"", @"uplink": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/oneToManyNatRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/oneToManyNatRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/oneToManyNatRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'portRules' => [
[
'allowedIps' => [
],
'localIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
],
'publicIp' => '',
'uplink' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/oneToManyNatRules', [
'body' => '{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/oneToManyNatRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'portRules' => [
[
'allowedIps' => [
],
'localIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
],
'publicIp' => '',
'uplink' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'portRules' => [
[
'allowedIps' => [
],
'localIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => ''
]
],
'publicIp' => '',
'uplink' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/oneToManyNatRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/oneToManyNatRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/oneToManyNatRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/oneToManyNatRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
payload = { "rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/oneToManyNatRules"
payload <- "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/oneToManyNatRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/oneToManyNatRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"portRules\": [\n {\n \"allowedIps\": [],\n \"localIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\"\n }\n ],\n \"publicIp\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/oneToManyNatRules";
let payload = json!({"rules": (
json!({
"portRules": (
json!({
"allowedIps": (),
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
})
),
"publicIp": "",
"uplink": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/oneToManyNatRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}'
echo '{
"rules": [
{
"portRules": [
{
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
}
],
"publicIp": "",
"uplink": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/oneToManyNatRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "portRules": [\n {\n "allowedIps": [],\n "localIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": ""\n }\n ],\n "publicIp": "",\n "uplink": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/oneToManyNatRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"portRules": [
[
"allowedIps": [],
"localIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": ""
]
],
"publicIp": "",
"uplink": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/oneToManyNatRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"portRules": [
{
"allowedIps": [
"any"
],
"localIp": "192.168.128.1",
"localPort": "443",
"name": "Rule 1",
"protocol": "tcp",
"publicPort": "9443"
},
{
"allowedIps": [
"10.82.110.0/24",
"10.82.111.0/24"
],
"localIp": "192.168.128.1",
"localPort": "80",
"name": "Rule 2",
"protocol": "tcp",
"publicPort": "8080"
}
],
"publicIp": "146.11.11.13",
"uplink": "internet1"
}
]
}
GET
Return the cellular firewall rules for an MX network
{{baseUrl}}/networks/:networkId/cellularFirewallRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/cellularFirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/cellularFirewallRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
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}}/networks/:networkId/cellularFirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/cellularFirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
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/networks/:networkId/cellularFirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/cellularFirewallRules"))
.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}}/networks/:networkId/cellularFirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.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}}/networks/:networkId/cellularFirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/cellularFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/cellularFirewallRules';
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}}/networks/:networkId/cellularFirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/cellularFirewallRules',
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}}/networks/:networkId/cellularFirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/cellularFirewallRules');
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}}/networks/:networkId/cellularFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/cellularFirewallRules';
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}}/networks/:networkId/cellularFirewallRules"]
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}}/networks/:networkId/cellularFirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/cellularFirewallRules",
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}}/networks/:networkId/cellularFirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/cellularFirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/cellularFirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/cellularFirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/cellularFirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/cellularFirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
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/networks/:networkId/cellularFirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules";
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}}/networks/:networkId/cellularFirewallRules
http GET {{baseUrl}}/networks/:networkId/cellularFirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/cellularFirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/cellularFirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
PUT
Update the cellular firewall rules of an MX network
{{baseUrl}}/networks/:networkId/cellularFirewallRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/cellularFirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/cellularFirewallRules" {:content-type :json
:form-params {:rules [{:comment ""
:destCidr ""
:destPort ""
:policy ""
:protocol ""
:srcCidr ""
:srcPort ""
:syslogEnabled false}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/cellularFirewallRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/cellularFirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/cellularFirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 210
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/cellularFirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/cellularFirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/cellularFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/cellularFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}]}'
};
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}}/networks/:networkId/cellularFirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/cellularFirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/cellularFirewallRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/cellularFirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/cellularFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/cellularFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"comment": @"", @"destCidr": @"", @"destPort": @"", @"policy": @"", @"protocol": @"", @"srcCidr": @"", @"srcPort": @"", @"syslogEnabled": @NO } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/cellularFirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/cellularFirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/cellularFirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/cellularFirewallRules', [
'body' => '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/cellularFirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/cellularFirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/cellularFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/cellularFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/cellularFirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
payload = { "rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": False
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/cellularFirewallRules"
payload <- "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/cellularFirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/cellularFirewallRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/cellularFirewallRules";
let payload = json!({"rules": (
json!({
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/cellularFirewallRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}'
echo '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/cellularFirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/cellularFirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/cellularFirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
GET
Return the inbound firewall rules for an MX network
{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
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/networks/:networkId/appliance/firewall/inboundFirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"))
.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}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.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}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules';
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules',
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules';
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules"]
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules",
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
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/networks/:networkId/appliance/firewall/inboundFirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules";
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules
http GET {{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
],
"syslogDefaultRule": true
}
PUT
Update the inbound firewall rules of an MX network
{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules" {:content-type :json
:form-params {:rules [{:comment ""
:destCidr ""
:destPort ""
:policy ""
:protocol ""
:srcCidr ""
:srcPort ""
:syslogEnabled false}]
:syslogDefaultRule false}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 240
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.asString();
const data = JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
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}}/networks/:networkId/appliance/firewall/inboundFirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"comment": @"", @"destCidr": @"", @"destPort": @"", @"policy": @"", @"protocol": @"", @"srcCidr": @"", @"srcPort": @"", @"syslogEnabled": @NO } ],
@"syslogDefaultRule": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules', [
'body' => '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
payload = {
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": False
}
],
"syslogDefaultRule": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules"
payload <- "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/appliance/firewall/inboundFirewallRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules";
let payload = json!({
"rules": (
json!({
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
})
),
"syslogDefaultRule": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
echo '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}' | \
http PUT {{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"rules": [
[
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
]
],
"syslogDefaultRule": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/appliance/firewall/inboundFirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
],
"syslogDefaultRule": true
}
GET
Return the L3 firewall rules for an MX network
{{baseUrl}}/networks/:networkId/l3FirewallRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/l3FirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/l3FirewallRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/l3FirewallRules"
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}}/networks/:networkId/l3FirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/l3FirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/l3FirewallRules"
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/networks/:networkId/l3FirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/l3FirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/l3FirewallRules"))
.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}}/networks/:networkId/l3FirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/l3FirewallRules")
.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}}/networks/:networkId/l3FirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/l3FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/l3FirewallRules';
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}}/networks/:networkId/l3FirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l3FirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/l3FirewallRules',
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}}/networks/:networkId/l3FirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/l3FirewallRules');
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}}/networks/:networkId/l3FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/l3FirewallRules';
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}}/networks/:networkId/l3FirewallRules"]
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}}/networks/:networkId/l3FirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/l3FirewallRules",
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}}/networks/:networkId/l3FirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/l3FirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/l3FirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/l3FirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/l3FirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/l3FirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/l3FirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/l3FirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/l3FirewallRules")
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/networks/:networkId/l3FirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/l3FirewallRules";
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}}/networks/:networkId/l3FirewallRules
http GET {{baseUrl}}/networks/:networkId/l3FirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/l3FirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/l3FirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
PUT
Update the L3 firewall rules of an MX network
{{baseUrl}}/networks/:networkId/l3FirewallRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/l3FirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/l3FirewallRules" {:content-type :json
:form-params {:rules [{:comment ""
:destCidr ""
:destPort ""
:policy ""
:protocol ""
:srcCidr ""
:srcPort ""
:syslogEnabled false}]
:syslogDefaultRule false}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/l3FirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/l3FirewallRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/l3FirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/l3FirewallRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/l3FirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 240
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/l3FirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/l3FirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l3FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/l3FirewallRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.asString();
const data = JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/l3FirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l3FirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/l3FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
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}}/networks/:networkId/l3FirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l3FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/l3FirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l3FirewallRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/l3FirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l3FirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/l3FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"comment": @"", @"destCidr": @"", @"destPort": @"", @"policy": @"", @"protocol": @"", @"srcCidr": @"", @"srcPort": @"", @"syslogEnabled": @NO } ],
@"syslogDefaultRule": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/l3FirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/l3FirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/l3FirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/l3FirewallRules', [
'body' => '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/l3FirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/l3FirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/l3FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/l3FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/l3FirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/l3FirewallRules"
payload = {
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": False
}
],
"syslogDefaultRule": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/l3FirewallRules"
payload <- "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/l3FirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/l3FirewallRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/l3FirewallRules";
let payload = json!({
"rules": (
json!({
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
})
),
"syslogDefaultRule": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/l3FirewallRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
echo '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}' | \
http PUT {{baseUrl}}/networks/:networkId/l3FirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/l3FirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"rules": [
[
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
]
],
"syslogDefaultRule": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/l3FirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
GET
Return the L7 firewall application categories and their associated applications for an MX network
{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories"
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}}/networks/:networkId/l7FirewallRules/applicationCategories"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories"
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/networks/:networkId/l7FirewallRules/applicationCategories HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories"))
.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}}/networks/:networkId/l7FirewallRules/applicationCategories")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")
.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}}/networks/:networkId/l7FirewallRules/applicationCategories');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories';
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}}/networks/:networkId/l7FirewallRules/applicationCategories',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/l7FirewallRules/applicationCategories',
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}}/networks/:networkId/l7FirewallRules/applicationCategories'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories');
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}}/networks/:networkId/l7FirewallRules/applicationCategories'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories';
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}}/networks/:networkId/l7FirewallRules/applicationCategories"]
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}}/networks/:networkId/l7FirewallRules/applicationCategories" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories",
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}}/networks/:networkId/l7FirewallRules/applicationCategories');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/l7FirewallRules/applicationCategories")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")
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/networks/:networkId/l7FirewallRules/applicationCategories') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories";
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}}/networks/:networkId/l7FirewallRules/applicationCategories
http GET {{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/l7FirewallRules/applicationCategories")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"applicationCategories": [
{
"applications": [
{
"id": "meraki:layer7/application/5",
"name": "Advertising.com"
},
{
"id": "meraki:layer7/application/0",
"name": "AppNexus"
},
{
"id": "meraki:layer7/application/1",
"name": "Brightroll"
}
],
"id": "meraki:layer7/category/24",
"name": "Advertising"
}
]
}
GET
List the MX L7 firewall rules for an MX network
{{baseUrl}}/networks/:networkId/l7FirewallRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/l7FirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/l7FirewallRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules"
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}}/networks/:networkId/l7FirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/l7FirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/l7FirewallRules"
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/networks/:networkId/l7FirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/l7FirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/l7FirewallRules"))
.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}}/networks/:networkId/l7FirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/l7FirewallRules")
.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}}/networks/:networkId/l7FirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/l7FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules';
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}}/networks/:networkId/l7FirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l7FirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/l7FirewallRules',
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}}/networks/:networkId/l7FirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/l7FirewallRules');
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}}/networks/:networkId/l7FirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules';
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}}/networks/:networkId/l7FirewallRules"]
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}}/networks/:networkId/l7FirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/l7FirewallRules",
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}}/networks/:networkId/l7FirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/l7FirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/l7FirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/l7FirewallRules")
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/networks/:networkId/l7FirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/l7FirewallRules";
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}}/networks/:networkId/l7FirewallRules
http GET {{baseUrl}}/networks/:networkId/l7FirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/l7FirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/l7FirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"policy": "deny",
"type": "host",
"value": "google.com"
},
{
"policy": "deny",
"type": "port",
"value": "23"
},
{
"policy": "deny",
"type": "ipRange",
"value": "10.11.12.00/24"
},
{
"policy": "deny",
"type": "ipRange",
"value": "10.11.12.00/24:5555"
}
]
}
PUT
Update the MX L7 firewall rules for an MX network
{{baseUrl}}/networks/:networkId/l7FirewallRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/l7FirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/l7FirewallRules" {:content-type :json
:form-params {:rules [{:policy ""
:type ""
:value ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/l7FirewallRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/l7FirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/l7FirewallRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/l7FirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/l7FirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/l7FirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l7FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/l7FirewallRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
policy: '',
type: '',
value: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/l7FirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l7FirewallRules',
headers: {'content-type': 'application/json'},
data: {rules: [{policy: '', type: '', value: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"policy":"","type":"","value":""}]}'
};
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}}/networks/:networkId/l7FirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "policy": "",\n "type": "",\n "value": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/l7FirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/l7FirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({rules: [{policy: '', type: '', value: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l7FirewallRules',
headers: {'content-type': 'application/json'},
body: {rules: [{policy: '', type: '', value: ''}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/l7FirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
policy: '',
type: '',
value: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/l7FirewallRules',
headers: {'content-type': 'application/json'},
data: {rules: [{policy: '', type: '', value: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/l7FirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"policy":"","type":"","value":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"policy": @"", @"type": @"", @"value": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/l7FirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/l7FirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/l7FirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'policy' => '',
'type' => '',
'value' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/l7FirewallRules', [
'body' => '{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'policy' => '',
'type' => '',
'value' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'policy' => '',
'type' => '',
'value' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/l7FirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/l7FirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/l7FirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/l7FirewallRules"
payload = { "rules": [
{
"policy": "",
"type": "",
"value": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/l7FirewallRules"
payload <- "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/l7FirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/l7FirewallRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"policy\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/l7FirewallRules";
let payload = json!({"rules": (
json!({
"policy": "",
"type": "",
"value": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/l7FirewallRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}'
echo '{
"rules": [
{
"policy": "",
"type": "",
"value": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/l7FirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "policy": "",\n "type": "",\n "value": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/l7FirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"policy": "",
"type": "",
"value": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/l7FirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"policy": "deny",
"type": "host",
"value": "google.com"
},
{
"policy": "deny",
"type": "port",
"value": "23"
},
{
"policy": "deny",
"type": "ipRange",
"value": "10.11.12.00/24"
},
{
"policy": "deny",
"type": "ipRange",
"value": "10.11.12.00/24:5555"
}
]
}
GET
Return the port forwarding rules for an MX network
{{baseUrl}}/networks/:networkId/portForwardingRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/portForwardingRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/portForwardingRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/portForwardingRules"
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}}/networks/:networkId/portForwardingRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/portForwardingRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/portForwardingRules"
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/networks/:networkId/portForwardingRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/portForwardingRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/portForwardingRules"))
.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}}/networks/:networkId/portForwardingRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/portForwardingRules")
.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}}/networks/:networkId/portForwardingRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/portForwardingRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/portForwardingRules';
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}}/networks/:networkId/portForwardingRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/portForwardingRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/portForwardingRules',
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}}/networks/:networkId/portForwardingRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/portForwardingRules');
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}}/networks/:networkId/portForwardingRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/portForwardingRules';
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}}/networks/:networkId/portForwardingRules"]
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}}/networks/:networkId/portForwardingRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/portForwardingRules",
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}}/networks/:networkId/portForwardingRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/portForwardingRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/portForwardingRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/portForwardingRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/portForwardingRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/portForwardingRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/portForwardingRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/portForwardingRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/portForwardingRules")
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/networks/:networkId/portForwardingRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/portForwardingRules";
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}}/networks/:networkId/portForwardingRules
http GET {{baseUrl}}/networks/:networkId/portForwardingRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/portForwardingRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/portForwardingRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"allowedIps": [
"any"
],
"lanIp": "192.168.128.1",
"localPort": "442-443",
"name": "Description of Port Forwarding Rule",
"protocol": "tcp",
"publicPort": "8100-8101",
"uplink": "both"
}
]
}
PUT
Update the port forwarding rules for an MX network
{{baseUrl}}/networks/:networkId/portForwardingRules
QUERY PARAMS
networkId
BODY json
{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/portForwardingRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/portForwardingRules" {:content-type :json
:form-params {:rules [{:allowedIps []
:lanIp ""
:localPort ""
:name ""
:protocol ""
:publicPort ""
:uplink ""}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/portForwardingRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/portForwardingRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/portForwardingRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/portForwardingRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/portForwardingRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 181
{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/portForwardingRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/portForwardingRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/portForwardingRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/portForwardingRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/portForwardingRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/portForwardingRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/portForwardingRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"allowedIps":[],"lanIp":"","localPort":"","name":"","protocol":"","publicPort":"","uplink":""}]}'
};
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}}/networks/:networkId/portForwardingRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "allowedIps": [],\n "lanIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": "",\n "uplink": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/portForwardingRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/portForwardingRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/portForwardingRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/portForwardingRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/portForwardingRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
allowedIps: [],
lanIp: '',
localPort: '',
name: '',
protocol: '',
publicPort: '',
uplink: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/portForwardingRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"allowedIps":[],"lanIp":"","localPort":"","name":"","protocol":"","publicPort":"","uplink":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"allowedIps": @[ ], @"lanIp": @"", @"localPort": @"", @"name": @"", @"protocol": @"", @"publicPort": @"", @"uplink": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/portForwardingRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/portForwardingRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/portForwardingRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => '',
'uplink' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/portForwardingRules', [
'body' => '{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/portForwardingRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => '',
'uplink' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'allowedIps' => [
],
'lanIp' => '',
'localPort' => '',
'name' => '',
'protocol' => '',
'publicPort' => '',
'uplink' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/portForwardingRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/portForwardingRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/portForwardingRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/portForwardingRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/portForwardingRules"
payload = { "rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/portForwardingRules"
payload <- "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/portForwardingRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/portForwardingRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"allowedIps\": [],\n \"lanIp\": \"\",\n \"localPort\": \"\",\n \"name\": \"\",\n \"protocol\": \"\",\n \"publicPort\": \"\",\n \"uplink\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/portForwardingRules";
let payload = json!({"rules": (
json!({
"allowedIps": (),
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/portForwardingRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}'
echo '{
"rules": [
{
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/portForwardingRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "allowedIps": [],\n "lanIp": "",\n "localPort": "",\n "name": "",\n "protocol": "",\n "publicPort": "",\n "uplink": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/portForwardingRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["rules": [
[
"allowedIps": [],
"lanIp": "",
"localPort": "",
"name": "",
"protocol": "",
"publicPort": "",
"uplink": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/portForwardingRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"rules": [
{
"allowedIps": [
"any"
],
"lanIp": "192.168.128.1",
"localPort": "442-443",
"name": "Description of Port Forwarding Rule",
"protocol": "tcp",
"publicPort": "8100-8101",
"uplink": "both"
}
]
}
POST
Add a static route for an MX or teleworker network
{{baseUrl}}/networks/:networkId/staticRoutes
QUERY PARAMS
networkId
BODY json
{
"gatewayIp": "",
"name": "",
"subnet": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/staticRoutes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/staticRoutes" {:content-type :json
:form-params {:gatewayIp ""
:name ""
:subnet ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/staticRoutes"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/staticRoutes"),
Content = new StringContent("{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/staticRoutes");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/staticRoutes"
payload := strings.NewReader("{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/staticRoutes HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"gatewayIp": "",
"name": "",
"subnet": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/staticRoutes")
.setHeader("content-type", "application/json")
.setBody("{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/staticRoutes"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/staticRoutes")
.header("content-type", "application/json")
.body("{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
.asString();
const data = JSON.stringify({
gatewayIp: '',
name: '',
subnet: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/staticRoutes');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/staticRoutes',
headers: {'content-type': 'application/json'},
data: {gatewayIp: '', name: '', subnet: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/staticRoutes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gatewayIp":"","name":"","subnet":""}'
};
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}}/networks/:networkId/staticRoutes',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gatewayIp": "",\n "name": "",\n "subnet": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/staticRoutes',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({gatewayIp: '', name: '', subnet: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/staticRoutes',
headers: {'content-type': 'application/json'},
body: {gatewayIp: '', name: '', subnet: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/staticRoutes');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gatewayIp: '',
name: '',
subnet: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/staticRoutes',
headers: {'content-type': 'application/json'},
data: {gatewayIp: '', name: '', subnet: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/staticRoutes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gatewayIp":"","name":"","subnet":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"gatewayIp": @"",
@"name": @"",
@"subnet": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/staticRoutes"]
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}}/networks/:networkId/staticRoutes" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/staticRoutes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gatewayIp' => '',
'name' => '',
'subnet' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/staticRoutes', [
'body' => '{
"gatewayIp": "",
"name": "",
"subnet": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/staticRoutes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gatewayIp' => '',
'name' => '',
'subnet' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gatewayIp' => '',
'name' => '',
'subnet' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/staticRoutes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/staticRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gatewayIp": "",
"name": "",
"subnet": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/staticRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gatewayIp": "",
"name": "",
"subnet": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/staticRoutes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/staticRoutes"
payload = {
"gatewayIp": "",
"name": "",
"subnet": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/staticRoutes"
payload <- "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/staticRoutes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/staticRoutes') do |req|
req.body = "{\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/staticRoutes";
let payload = json!({
"gatewayIp": "",
"name": "",
"subnet": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/staticRoutes \
--header 'content-type: application/json' \
--data '{
"gatewayIp": "",
"name": "",
"subnet": ""
}'
echo '{
"gatewayIp": "",
"name": "",
"subnet": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/staticRoutes \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gatewayIp": "",\n "name": "",\n "subnet": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/staticRoutes
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gatewayIp": "",
"name": "",
"subnet": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/staticRoutes")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"fixedIpAssignments": {},
"gatewayIp": "1.2.3.5",
"id": "d7fa4948-7921-4dfa-af6b-ae8b16c20c39",
"ipVersion": 4,
"name": "My route",
"networkId": "N_24329156",
"reservedIpRanges": [],
"subnet": "192.168.1.0/24"
}
DELETE
Delete a static route from an MX or teleworker network
{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
QUERY PARAMS
networkId
staticRouteId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
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}}/networks/:networkId/staticRoutes/:staticRouteId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
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/networks/:networkId/staticRoutes/:staticRouteId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"))
.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}}/networks/:networkId/staticRoutes/:staticRouteId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.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}}/networks/:networkId/staticRoutes/:staticRouteId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
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}}/networks/:networkId/staticRoutes/:staticRouteId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/staticRoutes/:staticRouteId',
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}}/networks/:networkId/staticRoutes/:staticRouteId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
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}}/networks/:networkId/staticRoutes/:staticRouteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
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}}/networks/:networkId/staticRoutes/:staticRouteId"]
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}}/networks/:networkId/staticRoutes/:staticRouteId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId",
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}}/networks/:networkId/staticRoutes/:staticRouteId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/staticRoutes/:staticRouteId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
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/networks/:networkId/staticRoutes/:staticRouteId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId";
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}}/networks/:networkId/staticRoutes/:staticRouteId
http DELETE {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")! 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
List the static routes for an MX or teleworker network
{{baseUrl}}/networks/:networkId/staticRoutes
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/staticRoutes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/staticRoutes")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/staticRoutes"
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}}/networks/:networkId/staticRoutes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/staticRoutes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/staticRoutes"
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/networks/:networkId/staticRoutes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/staticRoutes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/staticRoutes"))
.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}}/networks/:networkId/staticRoutes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/staticRoutes")
.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}}/networks/:networkId/staticRoutes');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/staticRoutes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/staticRoutes';
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}}/networks/:networkId/staticRoutes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/staticRoutes',
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}}/networks/:networkId/staticRoutes'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/staticRoutes');
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}}/networks/:networkId/staticRoutes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/staticRoutes';
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}}/networks/:networkId/staticRoutes"]
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}}/networks/:networkId/staticRoutes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/staticRoutes",
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}}/networks/:networkId/staticRoutes');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/staticRoutes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/staticRoutes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/staticRoutes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/staticRoutes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/staticRoutes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/staticRoutes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/staticRoutes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/staticRoutes")
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/networks/:networkId/staticRoutes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/staticRoutes";
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}}/networks/:networkId/staticRoutes
http GET {{baseUrl}}/networks/:networkId/staticRoutes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/staticRoutes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/staticRoutes")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"enabled": true,
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"gatewayIp": "1.2.3.5",
"id": "d7fa4948-7921-4dfa-af6b-ae8b16c20c39",
"ipVersion": 4,
"name": "My route",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24"
}
]
GET
Return a static route for an MX or teleworker network
{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
QUERY PARAMS
networkId
staticRouteId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
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}}/networks/:networkId/staticRoutes/:staticRouteId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
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/networks/:networkId/staticRoutes/:staticRouteId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"))
.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}}/networks/:networkId/staticRoutes/:staticRouteId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.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}}/networks/:networkId/staticRoutes/:staticRouteId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
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}}/networks/:networkId/staticRoutes/:staticRouteId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/staticRoutes/:staticRouteId',
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}}/networks/:networkId/staticRoutes/:staticRouteId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
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}}/networks/:networkId/staticRoutes/:staticRouteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
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}}/networks/:networkId/staticRoutes/:staticRouteId"]
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}}/networks/:networkId/staticRoutes/:staticRouteId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId",
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}}/networks/:networkId/staticRoutes/:staticRouteId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/staticRoutes/:staticRouteId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
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/networks/:networkId/staticRoutes/:staticRouteId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId";
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}}/networks/:networkId/staticRoutes/:staticRouteId
http GET {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"gatewayIp": "1.2.3.5",
"id": "d7fa4948-7921-4dfa-af6b-ae8b16c20c39",
"ipVersion": 4,
"name": "My route",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24"
}
PUT
Update a static route for an MX or teleworker network
{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
QUERY PARAMS
networkId
staticRouteId
BODY json
{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId" {:content-type :json
:form-params {:enabled false
:fixedIpAssignments {}
:gatewayIp ""
:name ""
:reservedIpRanges [{:comment ""
:end ""
:start ""}]
:subnet ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"),
Content = new StringContent("{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
payload := strings.NewReader("{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/staticRoutes/:staticRouteId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 196
{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.setHeader("content-type", "application/json")
.setBody("{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.header("content-type", "application/json")
.body("{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}")
.asString();
const data = JSON.stringify({
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
],
subnet: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId',
headers: {'content-type': 'application/json'},
data: {
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false,"fixedIpAssignments":{},"gatewayIp":"","name":"","reservedIpRanges":[{"comment":"","end":"","start":""}],"subnet":""}'
};
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}}/networks/:networkId/staticRoutes/:staticRouteId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "enabled": false,\n "fixedIpAssignments": {},\n "gatewayIp": "",\n "name": "",\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ],\n "subnet": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/staticRoutes/:staticRouteId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId',
headers: {'content-type': 'application/json'},
body: {
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
],
subnet: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId',
headers: {'content-type': 'application/json'},
data: {
enabled: false,
fixedIpAssignments: {},
gatewayIp: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false,"fixedIpAssignments":{},"gatewayIp":"","name":"","reservedIpRanges":[{"comment":"","end":"","start":""}],"subnet":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"enabled": @NO,
@"fixedIpAssignments": @{ },
@"gatewayIp": @"",
@"name": @"",
@"reservedIpRanges": @[ @{ @"comment": @"", @"end": @"", @"start": @"" } ],
@"subnet": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => null,
'fixedIpAssignments' => [
],
'gatewayIp' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId', [
'body' => '{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'enabled' => null,
'fixedIpAssignments' => [
],
'gatewayIp' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'enabled' => null,
'fixedIpAssignments' => [
],
'gatewayIp' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/staticRoutes/:staticRouteId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
payload = {
"enabled": False,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId"
payload <- "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/staticRoutes/:staticRouteId') do |req|
req.body = "{\n \"enabled\": false,\n \"fixedIpAssignments\": {},\n \"gatewayIp\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId";
let payload = json!({
"enabled": false,
"fixedIpAssignments": json!({}),
"gatewayIp": "",
"name": "",
"reservedIpRanges": (
json!({
"comment": "",
"end": "",
"start": ""
})
),
"subnet": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId \
--header 'content-type: application/json' \
--data '{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}'
echo '{
"enabled": false,
"fixedIpAssignments": {},
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "enabled": false,\n "fixedIpAssignments": {},\n "gatewayIp": "",\n "name": "",\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ],\n "subnet": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"enabled": false,
"fixedIpAssignments": [],
"gatewayIp": "",
"name": "",
"reservedIpRanges": [
[
"comment": "",
"end": "",
"start": ""
]
],
"subnet": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/staticRoutes/:staticRouteId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"gatewayIp": "1.2.3.5",
"id": "d7fa4948-7921-4dfa-af6b-ae8b16c20c39",
"ipVersion": 4,
"name": "My route",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24"
}
GET
List per-port VLAN settings for all ports of a MX.
{{baseUrl}}/networks/:networkId/appliancePorts
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/appliancePorts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/appliancePorts")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/appliancePorts"
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}}/networks/:networkId/appliancePorts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/appliancePorts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/appliancePorts"
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/networks/:networkId/appliancePorts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/appliancePorts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/appliancePorts"))
.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}}/networks/:networkId/appliancePorts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/appliancePorts")
.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}}/networks/:networkId/appliancePorts');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/appliancePorts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/appliancePorts';
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}}/networks/:networkId/appliancePorts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliancePorts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/appliancePorts',
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}}/networks/:networkId/appliancePorts'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/appliancePorts');
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}}/networks/:networkId/appliancePorts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/appliancePorts';
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}}/networks/:networkId/appliancePorts"]
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}}/networks/:networkId/appliancePorts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/appliancePorts",
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}}/networks/:networkId/appliancePorts');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/appliancePorts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/appliancePorts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/appliancePorts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/appliancePorts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/appliancePorts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/appliancePorts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/appliancePorts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/appliancePorts")
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/networks/:networkId/appliancePorts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/appliancePorts";
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}}/networks/:networkId/appliancePorts
http GET {{baseUrl}}/networks/:networkId/appliancePorts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/appliancePorts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/appliancePorts")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"accessPolicy": "open",
"dropUntaggedTraffic": false,
"enabled": true,
"number": 1,
"type": "access",
"vlan": 3
}
]
GET
Return per-port VLAN settings for a single MX port.
{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId
QUERY PARAMS
networkId
appliancePortId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
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}}/networks/:networkId/appliancePorts/:appliancePortId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
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/networks/:networkId/appliancePorts/:appliancePortId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"))
.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}}/networks/:networkId/appliancePorts/:appliancePortId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.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}}/networks/:networkId/appliancePorts/:appliancePortId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId';
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}}/networks/:networkId/appliancePorts/:appliancePortId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/appliancePorts/:appliancePortId',
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}}/networks/:networkId/appliancePorts/:appliancePortId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
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}}/networks/:networkId/appliancePorts/:appliancePortId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId';
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}}/networks/:networkId/appliancePorts/:appliancePortId"]
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}}/networks/:networkId/appliancePorts/:appliancePortId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId",
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}}/networks/:networkId/appliancePorts/:appliancePortId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/appliancePorts/:appliancePortId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
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/networks/:networkId/appliancePorts/:appliancePortId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId";
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}}/networks/:networkId/appliancePorts/:appliancePortId
http GET {{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accessPolicy": "open",
"dropUntaggedTraffic": false,
"enabled": true,
"number": 1,
"type": "access",
"vlan": 3
}
PUT
Update the per-port VLAN settings for a single MX port.
{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId
QUERY PARAMS
networkId
appliancePortId
BODY json
{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId" {:content-type :json
:form-params {:accessPolicy ""
:allowedVlans ""
:dropUntaggedTraffic false
:enabled false
:type ""
:vlan 0}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"),
Content = new StringContent("{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
payload := strings.NewReader("{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/appliancePorts/:appliancePortId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 125
{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.header("content-type", "application/json")
.body("{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}")
.asString();
const data = JSON.stringify({
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId',
headers: {'content-type': 'application/json'},
data: {
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accessPolicy":"","allowedVlans":"","dropUntaggedTraffic":false,"enabled":false,"type":"","vlan":0}'
};
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}}/networks/:networkId/appliancePorts/:appliancePortId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accessPolicy": "",\n "allowedVlans": "",\n "dropUntaggedTraffic": false,\n "enabled": false,\n "type": "",\n "vlan": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/appliancePorts/:appliancePortId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId',
headers: {'content-type': 'application/json'},
body: {
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId',
headers: {'content-type': 'application/json'},
data: {
accessPolicy: '',
allowedVlans: '',
dropUntaggedTraffic: false,
enabled: false,
type: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accessPolicy":"","allowedVlans":"","dropUntaggedTraffic":false,"enabled":false,"type":"","vlan":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accessPolicy": @"",
@"allowedVlans": @"",
@"dropUntaggedTraffic": @NO,
@"enabled": @NO,
@"type": @"",
@"vlan": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accessPolicy' => '',
'allowedVlans' => '',
'dropUntaggedTraffic' => null,
'enabled' => null,
'type' => '',
'vlan' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId', [
'body' => '{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accessPolicy' => '',
'allowedVlans' => '',
'dropUntaggedTraffic' => null,
'enabled' => null,
'type' => '',
'vlan' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accessPolicy' => '',
'allowedVlans' => '',
'dropUntaggedTraffic' => null,
'enabled' => null,
'type' => '',
'vlan' => 0
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/appliancePorts/:appliancePortId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
payload = {
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": False,
"enabled": False,
"type": "",
"vlan": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId"
payload <- "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/appliancePorts/:appliancePortId') do |req|
req.body = "{\n \"accessPolicy\": \"\",\n \"allowedVlans\": \"\",\n \"dropUntaggedTraffic\": false,\n \"enabled\": false,\n \"type\": \"\",\n \"vlan\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId";
let payload = json!({
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId \
--header 'content-type: application/json' \
--data '{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}'
echo '{
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
}' | \
http PUT {{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accessPolicy": "",\n "allowedVlans": "",\n "dropUntaggedTraffic": false,\n "enabled": false,\n "type": "",\n "vlan": 0\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accessPolicy": "",
"allowedVlans": "",
"dropUntaggedTraffic": false,
"enabled": false,
"type": "",
"vlan": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/appliancePorts/:appliancePortId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accessPolicy": "open",
"dropUntaggedTraffic": false,
"enabled": true,
"number": 1,
"type": "access",
"vlan": 3
}
GET
Return the firewall rules for an organization's site-to-site VPN
{{baseUrl}}/organizations/:organizationId/vpnFirewallRules
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
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}}/organizations/:organizationId/vpnFirewallRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
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/organizations/:organizationId/vpnFirewallRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"))
.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}}/organizations/:organizationId/vpnFirewallRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.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}}/organizations/:organizationId/vpnFirewallRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules';
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}}/organizations/:organizationId/vpnFirewallRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/vpnFirewallRules',
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}}/organizations/:organizationId/vpnFirewallRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
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}}/organizations/:organizationId/vpnFirewallRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules';
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}}/organizations/:organizationId/vpnFirewallRules"]
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}}/organizations/:organizationId/vpnFirewallRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/vpnFirewallRules",
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}}/organizations/:organizationId/vpnFirewallRules');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/vpnFirewallRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
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/organizations/:organizationId/vpnFirewallRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules";
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}}/organizations/:organizationId/vpnFirewallRules
http GET {{baseUrl}}/organizations/:organizationId/vpnFirewallRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/vpnFirewallRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
PUT
Update the firewall rules of an organization's site-to-site VPN
{{baseUrl}}/organizations/:organizationId/vpnFirewallRules
QUERY PARAMS
organizationId
BODY json
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules" {:content-type :json
:form-params {:rules [{:comment ""
:destCidr ""
:destPort ""
:policy ""
:protocol ""
:srcCidr ""
:srcPort ""
:syslogEnabled false}]
:syslogDefaultRule false}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"),
Content = new StringContent("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/vpnFirewallRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 240
{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.header("content-type", "application/json")
.body("{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
.asString();
const data = JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
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}}/organizations/:organizationId/vpnFirewallRules',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/vpnFirewallRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules',
headers: {'content-type': 'application/json'},
body: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules',
headers: {'content-type': 'application/json'},
data: {
rules: [
{
comment: '',
destCidr: '',
destPort: '',
policy: '',
protocol: '',
srcCidr: '',
srcPort: '',
syslogEnabled: false
}
],
syslogDefaultRule: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"rules":[{"comment":"","destCidr":"","destPort":"","policy":"","protocol":"","srcCidr":"","srcPort":"","syslogEnabled":false}],"syslogDefaultRule":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"rules": @[ @{ @"comment": @"", @"destCidr": @"", @"destPort": @"", @"policy": @"", @"protocol": @"", @"srcCidr": @"", @"srcPort": @"", @"syslogEnabled": @NO } ],
@"syslogDefaultRule": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/vpnFirewallRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules', [
'body' => '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'rules' => [
[
'comment' => '',
'destCidr' => '',
'destPort' => '',
'policy' => '',
'protocol' => '',
'srcCidr' => '',
'srcPort' => '',
'syslogEnabled' => null
]
],
'syslogDefaultRule' => null
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/vpnFirewallRules');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/vpnFirewallRules' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/vpnFirewallRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
payload = {
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": False
}
],
"syslogDefaultRule": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules"
payload <- "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/vpnFirewallRules') do |req|
req.body = "{\n \"rules\": [\n {\n \"comment\": \"\",\n \"destCidr\": \"\",\n \"destPort\": \"\",\n \"policy\": \"\",\n \"protocol\": \"\",\n \"srcCidr\": \"\",\n \"srcPort\": \"\",\n \"syslogEnabled\": false\n }\n ],\n \"syslogDefaultRule\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules";
let payload = json!({
"rules": (
json!({
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
})
),
"syslogDefaultRule": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/vpnFirewallRules \
--header 'content-type: application/json' \
--data '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}'
echo '{
"rules": [
{
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
}
],
"syslogDefaultRule": false
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/vpnFirewallRules \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "rules": [\n {\n "comment": "",\n "destCidr": "",\n "destPort": "",\n "policy": "",\n "protocol": "",\n "srcCidr": "",\n "srcPort": "",\n "syslogEnabled": false\n }\n ],\n "syslogDefaultRule": false\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/vpnFirewallRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"rules": [
[
"comment": "",
"destCidr": "",
"destPort": "",
"policy": "",
"protocol": "",
"srcCidr": "",
"srcPort": "",
"syslogEnabled": false
]
],
"syslogDefaultRule": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/vpnFirewallRules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"comment": "Allow TCP traffic to subnet with HTTP servers.",
"destCidr": "192.168.1.0/24",
"destPort": "443",
"policy": "allow",
"protocol": "tcp",
"srcCidr": "Any",
"srcPort": "Any",
"syslogEnabled": false
}
]
GET
Return MX warm spare settings
{{baseUrl}}/networks/:networkId/warmSpareSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/warmSpareSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/warmSpareSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/warmSpareSettings"
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}}/networks/:networkId/warmSpareSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/warmSpareSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/warmSpareSettings"
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/networks/:networkId/warmSpareSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/warmSpareSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/warmSpareSettings"))
.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}}/networks/:networkId/warmSpareSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/warmSpareSettings")
.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}}/networks/:networkId/warmSpareSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/warmSpareSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/warmSpareSettings';
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}}/networks/:networkId/warmSpareSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/warmSpareSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/warmSpareSettings',
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}}/networks/:networkId/warmSpareSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/warmSpareSettings');
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}}/networks/:networkId/warmSpareSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/warmSpareSettings';
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}}/networks/:networkId/warmSpareSettings"]
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}}/networks/:networkId/warmSpareSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/warmSpareSettings",
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}}/networks/:networkId/warmSpareSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/warmSpareSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/warmSpareSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/warmSpareSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/warmSpareSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/warmSpareSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/warmSpareSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/warmSpareSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/warmSpareSettings")
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/networks/:networkId/warmSpareSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/warmSpareSettings";
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}}/networks/:networkId/warmSpareSettings
http GET {{baseUrl}}/networks/:networkId/warmSpareSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/warmSpareSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/warmSpareSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"primarySerial": "Q234-ABCD-5678",
"spareSerial": "Q234-ABCD-5678",
"uplinkMode": "virtual",
"wan1": {
"ip": "1.2.3.4",
"subnet": "192.168.1.0/24"
},
"wan2": {
"ip": "1.2.3.4",
"subnet": "192.168.128.0/24"
}
}
POST
Swap MX primary and warm spare appliances
{{baseUrl}}/networks/:networkId/swapWarmSpare
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/swapWarmSpare");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/swapWarmSpare")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/swapWarmSpare"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/swapWarmSpare"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/swapWarmSpare");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/swapWarmSpare"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/swapWarmSpare HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/swapWarmSpare")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/swapWarmSpare"))
.method("POST", 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}}/networks/:networkId/swapWarmSpare")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/swapWarmSpare")
.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('POST', '{{baseUrl}}/networks/:networkId/swapWarmSpare');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/swapWarmSpare'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/swapWarmSpare';
const options = {method: 'POST'};
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}}/networks/:networkId/swapWarmSpare',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/swapWarmSpare")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/swapWarmSpare',
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: 'POST',
url: '{{baseUrl}}/networks/:networkId/swapWarmSpare'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/swapWarmSpare');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/swapWarmSpare'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/swapWarmSpare';
const options = {method: 'POST'};
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}}/networks/:networkId/swapWarmSpare"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/swapWarmSpare" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/swapWarmSpare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/swapWarmSpare');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/swapWarmSpare');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/swapWarmSpare');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/swapWarmSpare' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/swapWarmSpare' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/swapWarmSpare")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/swapWarmSpare"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/swapWarmSpare"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/swapWarmSpare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/swapWarmSpare') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/swapWarmSpare";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/swapWarmSpare
http POST {{baseUrl}}/networks/:networkId/swapWarmSpare
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/swapWarmSpare
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/swapWarmSpare")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
PUT
Update MX warm spare settings
{{baseUrl}}/networks/:networkId/warmSpareSettings
QUERY PARAMS
networkId
BODY json
{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/warmSpareSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/warmSpareSettings" {:content-type :json
:form-params {:enabled false
:spareSerial ""
:uplinkMode ""
:virtualIp1 ""
:virtualIp2 ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/warmSpareSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/warmSpareSettings"),
Content = new StringContent("{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/warmSpareSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/warmSpareSettings"
payload := strings.NewReader("{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/warmSpareSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 103
{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/warmSpareSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/warmSpareSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/warmSpareSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/warmSpareSettings")
.header("content-type", "application/json")
.body("{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}")
.asString();
const data = JSON.stringify({
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/warmSpareSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/warmSpareSettings',
headers: {'content-type': 'application/json'},
data: {
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/warmSpareSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false,"spareSerial":"","uplinkMode":"","virtualIp1":"","virtualIp2":""}'
};
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}}/networks/:networkId/warmSpareSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "enabled": false,\n "spareSerial": "",\n "uplinkMode": "",\n "virtualIp1": "",\n "virtualIp2": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/warmSpareSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/warmSpareSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/warmSpareSettings',
headers: {'content-type': 'application/json'},
body: {
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/warmSpareSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/warmSpareSettings',
headers: {'content-type': 'application/json'},
data: {
enabled: false,
spareSerial: '',
uplinkMode: '',
virtualIp1: '',
virtualIp2: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/warmSpareSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false,"spareSerial":"","uplinkMode":"","virtualIp1":"","virtualIp2":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"enabled": @NO,
@"spareSerial": @"",
@"uplinkMode": @"",
@"virtualIp1": @"",
@"virtualIp2": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/warmSpareSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/warmSpareSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/warmSpareSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => null,
'spareSerial' => '',
'uplinkMode' => '',
'virtualIp1' => '',
'virtualIp2' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/warmSpareSettings', [
'body' => '{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/warmSpareSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'enabled' => null,
'spareSerial' => '',
'uplinkMode' => '',
'virtualIp1' => '',
'virtualIp2' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'enabled' => null,
'spareSerial' => '',
'uplinkMode' => '',
'virtualIp1' => '',
'virtualIp2' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/warmSpareSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/warmSpareSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/warmSpareSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/warmSpareSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/warmSpareSettings"
payload = {
"enabled": False,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/warmSpareSettings"
payload <- "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/warmSpareSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/warmSpareSettings') do |req|
req.body = "{\n \"enabled\": false,\n \"spareSerial\": \"\",\n \"uplinkMode\": \"\",\n \"virtualIp1\": \"\",\n \"virtualIp2\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/warmSpareSettings";
let payload = json!({
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/warmSpareSettings \
--header 'content-type: application/json' \
--data '{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}'
echo '{
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/warmSpareSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "enabled": false,\n "spareSerial": "",\n "uplinkMode": "",\n "virtualIp1": "",\n "virtualIp2": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/warmSpareSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"enabled": false,
"spareSerial": "",
"uplinkMode": "",
"virtualIp1": "",
"virtualIp2": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/warmSpareSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"primarySerial": "Q234-ABCD-5678",
"spareSerial": "Q234-ABCD-5678",
"uplinkMode": "virtual",
"wan1": {
"ip": "1.2.3.4",
"subnet": "192.168.1.0/24"
},
"wan2": {
"ip": "1.2.3.4",
"subnet": "192.168.128.0/24"
}
}
POST
Add a target group
{{baseUrl}}/networks/:networkId/sm/targetGroups
QUERY PARAMS
networkId
BODY json
{
"name": "",
"scope": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/targetGroups");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"scope\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/sm/targetGroups" {:content-type :json
:form-params {:name ""
:scope ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/targetGroups"),
Content = new StringContent("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/targetGroups");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"scope\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/targetGroups"
payload := strings.NewReader("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/sm/targetGroups HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 31
{
"name": "",
"scope": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/sm/targetGroups")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/targetGroups"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"scope\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"scope\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/sm/targetGroups")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
scope: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/sm/targetGroups');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups',
headers: {'content-type': 'application/json'},
data: {name: '', scope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","scope":""}'
};
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}}/networks/:networkId/sm/targetGroups',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "scope": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"scope\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/targetGroups',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: '', scope: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups',
headers: {'content-type': 'application/json'},
body: {name: '', scope: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/sm/targetGroups');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
scope: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups',
headers: {'content-type': 'application/json'},
data: {name: '', scope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","scope":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"scope": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/targetGroups"]
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}}/networks/:networkId/sm/targetGroups" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"scope\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/targetGroups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'scope' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/sm/targetGroups', [
'body' => '{
"name": "",
"scope": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'scope' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'scope' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"scope": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"scope": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/sm/targetGroups", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups"
payload = {
"name": "",
"scope": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/targetGroups"
payload <- "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/targetGroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/sm/targetGroups') do |req|
req.body = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/targetGroups";
let payload = json!({
"name": "",
"scope": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/sm/targetGroups \
--header 'content-type: application/json' \
--data '{
"name": "",
"scope": ""
}'
echo '{
"name": "",
"scope": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/sm/targetGroups \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "scope": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/targetGroups
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"scope": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/targetGroups")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"name": "My target group",
"scope": "none",
"tags": "[]",
"type": "devices"
}
DELETE
Delete a target group from a network
{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
QUERY PARAMS
networkId
targetGroupId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
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}}/networks/:networkId/sm/targetGroups/:targetGroupId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
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/networks/:networkId/sm/targetGroups/:targetGroupId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"))
.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}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.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}}/networks/:networkId/sm/targetGroups/:targetGroupId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
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}}/networks/:networkId/sm/targetGroups/:targetGroupId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId',
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}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
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}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
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}}/networks/:networkId/sm/targetGroups/:targetGroupId"]
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}}/networks/:networkId/sm/targetGroups/:targetGroupId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId",
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}}/networks/:networkId/sm/targetGroups/:targetGroupId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
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/networks/:networkId/sm/targetGroups/:targetGroupId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId";
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}}/networks/:networkId/sm/targetGroups/:targetGroupId
http DELETE {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")! 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
List the target groups in this network
{{baseUrl}}/networks/:networkId/sm/targetGroups
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/targetGroups");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/targetGroups")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups"
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}}/networks/:networkId/sm/targetGroups"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/targetGroups");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/targetGroups"
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/networks/:networkId/sm/targetGroups HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/targetGroups")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/targetGroups"))
.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}}/networks/:networkId/sm/targetGroups")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/targetGroups")
.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}}/networks/:networkId/sm/targetGroups');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups';
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}}/networks/:networkId/sm/targetGroups',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/targetGroups',
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}}/networks/:networkId/sm/targetGroups'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/targetGroups');
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}}/networks/:networkId/sm/targetGroups'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups';
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}}/networks/:networkId/sm/targetGroups"]
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}}/networks/:networkId/sm/targetGroups" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/targetGroups",
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}}/networks/:networkId/sm/targetGroups');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/targetGroups")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/targetGroups"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/targetGroups")
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/networks/:networkId/sm/targetGroups') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/targetGroups";
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}}/networks/:networkId/sm/targetGroups
http GET {{baseUrl}}/networks/:networkId/sm/targetGroups
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/targetGroups
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/targetGroups")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"name": "My target group",
"scope": "none",
"tags": "[]",
"type": "devices"
}
]
GET
Return a target group
{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
QUERY PARAMS
networkId
targetGroupId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
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}}/networks/:networkId/sm/targetGroups/:targetGroupId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
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/networks/:networkId/sm/targetGroups/:targetGroupId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"))
.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}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.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}}/networks/:networkId/sm/targetGroups/:targetGroupId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
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}}/networks/:networkId/sm/targetGroups/:targetGroupId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId',
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}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
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}}/networks/:networkId/sm/targetGroups/:targetGroupId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
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}}/networks/:networkId/sm/targetGroups/:targetGroupId"]
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}}/networks/:networkId/sm/targetGroups/:targetGroupId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId",
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}}/networks/:networkId/sm/targetGroups/:targetGroupId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
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/networks/:networkId/sm/targetGroups/:targetGroupId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId";
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}}/networks/:networkId/sm/targetGroups/:targetGroupId
http GET {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"name": "My target group",
"scope": "none",
"tags": "[]",
"type": "devices"
}
PUT
Update a target group
{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
QUERY PARAMS
networkId
targetGroupId
BODY json
{
"name": "",
"scope": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"scope\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId" {:content-type :json
:form-params {:name ""
:scope ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"),
Content = new StringContent("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"scope\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
payload := strings.NewReader("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 31
{
"name": "",
"scope": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"scope\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"scope\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"scope\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
scope: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId',
headers: {'content-type': 'application/json'},
data: {name: '', scope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","scope":""}'
};
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}}/networks/:networkId/sm/targetGroups/:targetGroupId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "scope": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"scope\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: '', scope: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId',
headers: {'content-type': 'application/json'},
body: {name: '', scope: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
scope: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId',
headers: {'content-type': 'application/json'},
data: {name: '', scope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","scope":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"scope": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"scope\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'scope' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId', [
'body' => '{
"name": "",
"scope": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'scope' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'scope' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"scope": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"scope": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
payload = {
"name": "",
"scope": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId"
payload <- "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/sm/targetGroups/:targetGroupId') do |req|
req.body = "{\n \"name\": \"\",\n \"scope\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId";
let payload = json!({
"name": "",
"scope": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId \
--header 'content-type: application/json' \
--data '{
"name": "",
"scope": ""
}'
echo '{
"name": "",
"scope": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "scope": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"scope": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/targetGroups/:targetGroupId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"name": "My target group",
"scope": "none",
"tags": "[]",
"type": "devices"
}
POST
Bind a network to a template.
{{baseUrl}}/networks/:networkId/bind
QUERY PARAMS
networkId
BODY json
{
"autoBind": false,
"configTemplateId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/bind");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/bind" {:content-type :json
:form-params {:autoBind false
:configTemplateId "N_23952905"}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/bind"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/bind"),
Content = new StringContent("{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/bind");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/bind"
payload := strings.NewReader("{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/bind HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"autoBind": false,
"configTemplateId": "N_23952905"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/bind")
.setHeader("content-type", "application/json")
.setBody("{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/bind"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bind")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/bind")
.header("content-type", "application/json")
.body("{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}")
.asString();
const data = JSON.stringify({
autoBind: false,
configTemplateId: 'N_23952905'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/bind');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/bind',
headers: {'content-type': 'application/json'},
data: {autoBind: false, configTemplateId: 'N_23952905'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/bind';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"autoBind":false,"configTemplateId":"N_23952905"}'
};
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}}/networks/:networkId/bind',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "autoBind": false,\n "configTemplateId": "N_23952905"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/bind")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/bind',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({autoBind: false, configTemplateId: 'N_23952905'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/bind',
headers: {'content-type': 'application/json'},
body: {autoBind: false, configTemplateId: 'N_23952905'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/bind');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
autoBind: false,
configTemplateId: 'N_23952905'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/bind',
headers: {'content-type': 'application/json'},
data: {autoBind: false, configTemplateId: 'N_23952905'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/bind';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"autoBind":false,"configTemplateId":"N_23952905"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"autoBind": @NO,
@"configTemplateId": @"N_23952905" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/bind"]
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}}/networks/:networkId/bind" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/bind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'autoBind' => null,
'configTemplateId' => 'N_23952905'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/bind', [
'body' => '{
"autoBind": false,
"configTemplateId": "N_23952905"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/bind');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'autoBind' => null,
'configTemplateId' => 'N_23952905'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'autoBind' => null,
'configTemplateId' => 'N_23952905'
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/bind');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/bind' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoBind": false,
"configTemplateId": "N_23952905"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/bind' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoBind": false,
"configTemplateId": "N_23952905"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/bind", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/bind"
payload = {
"autoBind": False,
"configTemplateId": "N_23952905"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/bind"
payload <- "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/bind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/bind') do |req|
req.body = "{\n \"autoBind\": false,\n \"configTemplateId\": \"N_23952905\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/bind";
let payload = json!({
"autoBind": false,
"configTemplateId": "N_23952905"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/bind \
--header 'content-type: application/json' \
--data '{
"autoBind": false,
"configTemplateId": "N_23952905"
}'
echo '{
"autoBind": false,
"configTemplateId": "N_23952905"
}' | \
http POST {{baseUrl}}/networks/:networkId/bind \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "autoBind": false,\n "configTemplateId": "N_23952905"\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/bind
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"autoBind": false,
"configTemplateId": "N_23952905"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/bind")! 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
Combine multiple networks into a single network
{{baseUrl}}/organizations/:organizationId/networks/combine
QUERY PARAMS
organizationId
BODY json
{
"enrollmentString": "",
"name": "",
"networkIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/networks/combine");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/networks/combine" {:content-type :json
:form-params {:enrollmentString ""
:name ""
:networkIds []}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/networks/combine"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/networks/combine"),
Content = new StringContent("{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/networks/combine");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/networks/combine"
payload := strings.NewReader("{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/networks/combine HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"enrollmentString": "",
"name": "",
"networkIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/networks/combine")
.setHeader("content-type", "application/json")
.setBody("{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/networks/combine"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/networks/combine")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/networks/combine")
.header("content-type", "application/json")
.body("{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}")
.asString();
const data = JSON.stringify({
enrollmentString: '',
name: '',
networkIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/networks/combine');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks/combine',
headers: {'content-type': 'application/json'},
data: {enrollmentString: '', name: '', networkIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/networks/combine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"enrollmentString":"","name":"","networkIds":[]}'
};
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}}/organizations/:organizationId/networks/combine',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "enrollmentString": "",\n "name": "",\n "networkIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/networks/combine")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/networks/combine',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({enrollmentString: '', name: '', networkIds: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks/combine',
headers: {'content-type': 'application/json'},
body: {enrollmentString: '', name: '', networkIds: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/networks/combine');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
enrollmentString: '',
name: '',
networkIds: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks/combine',
headers: {'content-type': 'application/json'},
data: {enrollmentString: '', name: '', networkIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/networks/combine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"enrollmentString":"","name":"","networkIds":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"enrollmentString": @"",
@"name": @"",
@"networkIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/networks/combine"]
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}}/organizations/:organizationId/networks/combine" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/networks/combine",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'enrollmentString' => '',
'name' => '',
'networkIds' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/networks/combine', [
'body' => '{
"enrollmentString": "",
"name": "",
"networkIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/networks/combine');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'enrollmentString' => '',
'name' => '',
'networkIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'enrollmentString' => '',
'name' => '',
'networkIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/networks/combine');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/networks/combine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"enrollmentString": "",
"name": "",
"networkIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/networks/combine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"enrollmentString": "",
"name": "",
"networkIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/networks/combine", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/networks/combine"
payload = {
"enrollmentString": "",
"name": "",
"networkIds": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/networks/combine"
payload <- "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/networks/combine")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/networks/combine') do |req|
req.body = "{\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"networkIds\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/networks/combine";
let payload = json!({
"enrollmentString": "",
"name": "",
"networkIds": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/networks/combine \
--header 'content-type: application/json' \
--data '{
"enrollmentString": "",
"name": "",
"networkIds": []
}'
echo '{
"enrollmentString": "",
"name": "",
"networkIds": []
}' | \
http POST {{baseUrl}}/organizations/:organizationId/networks/combine \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "enrollmentString": "",\n "name": "",\n "networkIds": []\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/networks/combine
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"enrollmentString": "",
"name": "",
"networkIds": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/networks/combine")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"resultingNetwork": {
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_24329156",
"name": "Main Office",
"organizationId": "2930418",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "combined"
}
}
POST
Create a network
{{baseUrl}}/organizations/:organizationId/networks
QUERY PARAMS
organizationId
BODY json
{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/networks");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/networks" {:content-type :json
:form-params {:copyFromNetworkId ""
:disableMyMerakiCom false
:disableRemoteStatusPage false
:name ""
:tags ""
:timeZone ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/networks"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/networks"),
Content = new StringContent("{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/networks");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/networks"
payload := strings.NewReader("{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/networks HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 156
{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/networks")
.setHeader("content-type", "application/json")
.setBody("{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/networks"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/networks")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/networks")
.header("content-type", "application/json")
.body("{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
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}}/organizations/:organizationId/networks');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks',
headers: {'content-type': 'application/json'},
data: {
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/networks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"copyFromNetworkId":"","disableMyMerakiCom":false,"disableRemoteStatusPage":false,"name":"","tags":"","timeZone":"","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}}/organizations/:organizationId/networks',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "copyFromNetworkId": "",\n "disableMyMerakiCom": false,\n "disableRemoteStatusPage": false,\n "name": "",\n "tags": "",\n "timeZone": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/networks")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/networks',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks',
headers: {'content-type': 'application/json'},
body: {
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/networks');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/networks',
headers: {'content-type': 'application/json'},
data: {
copyFromNetworkId: '',
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
name: '',
tags: '',
timeZone: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/networks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"copyFromNetworkId":"","disableMyMerakiCom":false,"disableRemoteStatusPage":false,"name":"","tags":"","timeZone":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"copyFromNetworkId": @"",
@"disableMyMerakiCom": @NO,
@"disableRemoteStatusPage": @NO,
@"name": @"",
@"tags": @"",
@"timeZone": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/networks"]
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}}/organizations/:organizationId/networks" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/networks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'copyFromNetworkId' => '',
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'name' => '',
'tags' => '',
'timeZone' => '',
'type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/networks', [
'body' => '{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/networks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'copyFromNetworkId' => '',
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'name' => '',
'tags' => '',
'timeZone' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'copyFromNetworkId' => '',
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'name' => '',
'tags' => '',
'timeZone' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/networks');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/networks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/networks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/networks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/networks"
payload = {
"copyFromNetworkId": "",
"disableMyMerakiCom": False,
"disableRemoteStatusPage": False,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/networks"
payload <- "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/networks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/networks') do |req|
req.body = "{\n \"copyFromNetworkId\": \"\",\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/networks";
let payload = json!({
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/networks \
--header 'content-type: application/json' \
--data '{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}'
echo '{
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationId/networks \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "copyFromNetworkId": "",\n "disableMyMerakiCom": false,\n "disableRemoteStatusPage": false,\n "name": "",\n "tags": "",\n "timeZone": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/networks
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"copyFromNetworkId": "",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"name": "",
"tags": "",
"timeZone": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/networks")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_24329156",
"name": "Main Office",
"organizationId": "2930418",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "combined"
}
DELETE
Delete a network
{{baseUrl}}/networks/:networkId
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId"
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}}/networks/:networkId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId"
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/networks/:networkId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId"))
.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}}/networks/:networkId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId")
.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}}/networks/:networkId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/networks/:networkId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId';
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}}/networks/:networkId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId',
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}}/networks/:networkId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId');
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}}/networks/:networkId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId';
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}}/networks/:networkId"]
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}}/networks/:networkId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId",
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}}/networks/:networkId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId")
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/networks/:networkId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId";
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}}/networks/:networkId
http DELETE {{baseUrl}}/networks/:networkId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId")! 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
List Air Marshal scan results from a network
{{baseUrl}}/networks/:networkId/airMarshal
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/airMarshal");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/airMarshal")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/airMarshal"
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}}/networks/:networkId/airMarshal"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/airMarshal");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/airMarshal"
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/networks/:networkId/airMarshal HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/airMarshal")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/airMarshal"))
.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}}/networks/:networkId/airMarshal")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/airMarshal")
.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}}/networks/:networkId/airMarshal');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/airMarshal'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/airMarshal';
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}}/networks/:networkId/airMarshal',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/airMarshal")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/airMarshal',
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}}/networks/:networkId/airMarshal'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/airMarshal');
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}}/networks/:networkId/airMarshal'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/airMarshal';
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}}/networks/:networkId/airMarshal"]
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}}/networks/:networkId/airMarshal" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/airMarshal",
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}}/networks/:networkId/airMarshal');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/airMarshal');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/airMarshal');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/airMarshal' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/airMarshal' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/airMarshal")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/airMarshal"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/airMarshal"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/airMarshal")
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/networks/:networkId/airMarshal') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/airMarshal";
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}}/networks/:networkId/airMarshal
http GET {{baseUrl}}/networks/:networkId/airMarshal
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/airMarshal
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/airMarshal")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"bssids": [
{
"bssid": "00:11:22:33:44:55",
"contained": false,
"detectedBy": [
{
"device": "Q234-ABCD-5678",
"rssi": 17
}
]
}
],
"channels": [
36,
40
],
"firstSeen": 1518365681,
"lastSeen": 1526087474,
"ssid": "linksys",
"wiredLastSeen": 1526087474,
"wiredMacs": [
"00:11:22:33:44:55"
],
"wiredVlans": [
0,
108
]
}
]
GET
List the networks in an organization
{{baseUrl}}/organizations/:organizationId/networks
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/networks");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/networks")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/networks"
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}}/organizations/:organizationId/networks"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/networks");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/networks"
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/organizations/:organizationId/networks HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/networks")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/networks"))
.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}}/organizations/:organizationId/networks")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/networks")
.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}}/organizations/:organizationId/networks');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/networks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/networks';
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}}/organizations/:organizationId/networks',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/networks")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/networks',
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}}/organizations/:organizationId/networks'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/networks');
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}}/organizations/:organizationId/networks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/networks';
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}}/organizations/:organizationId/networks"]
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}}/organizations/:organizationId/networks" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/networks",
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}}/organizations/:organizationId/networks');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/networks');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/networks');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/networks' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/networks' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/networks")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/networks"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/networks"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/networks")
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/organizations/:organizationId/networks') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/networks";
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}}/organizations/:organizationId/networks
http GET {{baseUrl}}/organizations/:organizationId/networks
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/networks
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/networks")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_24329156",
"name": "Main Office",
"organizationId": "2930418",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "combined"
}
]
GET
Return a network
{{baseUrl}}/networks/:networkId
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId"
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}}/networks/:networkId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId"
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/networks/:networkId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId"))
.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}}/networks/:networkId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId")
.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}}/networks/:networkId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId';
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}}/networks/:networkId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId',
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}}/networks/:networkId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId');
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}}/networks/:networkId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId';
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}}/networks/:networkId"]
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}}/networks/:networkId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId",
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}}/networks/:networkId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId")
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/networks/:networkId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId";
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}}/networks/:networkId
http GET {{baseUrl}}/networks/:networkId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_24329156",
"name": "Main Office",
"organizationId": "2930418",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "combined"
}
GET
Return the site-to-site VPN settings of a network
{{baseUrl}}/networks/:networkId/siteToSiteVpn
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/siteToSiteVpn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/siteToSiteVpn")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
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}}/networks/:networkId/siteToSiteVpn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/siteToSiteVpn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
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/networks/:networkId/siteToSiteVpn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/siteToSiteVpn"))
.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}}/networks/:networkId/siteToSiteVpn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.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}}/networks/:networkId/siteToSiteVpn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/siteToSiteVpn'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/siteToSiteVpn';
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}}/networks/:networkId/siteToSiteVpn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/siteToSiteVpn',
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}}/networks/:networkId/siteToSiteVpn'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/siteToSiteVpn');
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}}/networks/:networkId/siteToSiteVpn'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/siteToSiteVpn';
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}}/networks/:networkId/siteToSiteVpn"]
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}}/networks/:networkId/siteToSiteVpn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/siteToSiteVpn",
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}}/networks/:networkId/siteToSiteVpn');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/siteToSiteVpn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/siteToSiteVpn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/siteToSiteVpn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/siteToSiteVpn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/siteToSiteVpn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
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/networks/:networkId/siteToSiteVpn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn";
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}}/networks/:networkId/siteToSiteVpn
http GET {{baseUrl}}/networks/:networkId/siteToSiteVpn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/siteToSiteVpn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/siteToSiteVpn")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hubs": [
{
"hubId": "N_4901849",
"useDefaultRoute": true
},
{
"hubId": "N_1892489",
"useDefaultRoute": false
}
],
"mode": "spoke",
"peerSgtCapable": true,
"subnets": [
{
"localSubnet": "192.168.1.0/24",
"useVpn": true
},
{
"localSubnet": "192.168.128.0/24",
"useVpn": true
}
]
}
GET
Return the traffic analysis data for this network
{{baseUrl}}/networks/:networkId/traffic
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/traffic");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/traffic")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/traffic"
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}}/networks/:networkId/traffic"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/traffic");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/traffic"
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/networks/:networkId/traffic HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/traffic")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/traffic"))
.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}}/networks/:networkId/traffic")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/traffic")
.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}}/networks/:networkId/traffic');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/traffic'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/traffic';
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}}/networks/:networkId/traffic',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/traffic")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/traffic',
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}}/networks/:networkId/traffic'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/traffic');
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}}/networks/:networkId/traffic'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/traffic';
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}}/networks/:networkId/traffic"]
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}}/networks/:networkId/traffic" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/traffic",
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}}/networks/:networkId/traffic');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/traffic');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/traffic');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/traffic' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/traffic' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/traffic")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/traffic"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/traffic"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/traffic")
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/networks/:networkId/traffic') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/traffic";
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}}/networks/:networkId/traffic
http GET {{baseUrl}}/networks/:networkId/traffic
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/traffic
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/traffic")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"activeTime": 77000,
"application": "Gmail",
"destination": null,
"flows": 300,
"numClients": 7,
"port": 443,
"protocol": "TCP",
"recv": 61,
"sent": 138
}
]
POST
Split a combined network into individual networks for each type of device
{{baseUrl}}/networks/:networkId/split
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/split");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/split")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/split"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/split"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/split");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/split"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/split HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/split")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/split"))
.method("POST", 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}}/networks/:networkId/split")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/split")
.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('POST', '{{baseUrl}}/networks/:networkId/split');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/networks/:networkId/split'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/split';
const options = {method: 'POST'};
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}}/networks/:networkId/split',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/split")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/split',
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: 'POST', url: '{{baseUrl}}/networks/:networkId/split'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/split');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/networks/:networkId/split'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/split';
const options = {method: 'POST'};
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}}/networks/:networkId/split"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/split" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/split",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/split');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/split');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/split');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/split' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/split' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/split")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/split"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/split"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/split")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/split') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/split";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/split
http POST {{baseUrl}}/networks/:networkId/split
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/split
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/split")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"resultingNetworks": [
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_1234",
"name": "Main Office - switch",
"organizationId": "2930418",
"productTypes": [
"switch"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "switch"
},
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_5678",
"name": "Main Office - wireless",
"organizationId": "2930418",
"productTypes": [
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "wireless"
}
]
}
POST
Unbind a network from a template.
{{baseUrl}}/networks/:networkId/unbind
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/unbind");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/unbind")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/unbind"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/unbind"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/unbind");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/unbind"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/unbind HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/unbind")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/unbind"))
.method("POST", 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}}/networks/:networkId/unbind")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/unbind")
.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('POST', '{{baseUrl}}/networks/:networkId/unbind');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/networks/:networkId/unbind'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/unbind';
const options = {method: 'POST'};
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}}/networks/:networkId/unbind',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/unbind")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/unbind',
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: 'POST', url: '{{baseUrl}}/networks/:networkId/unbind'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/unbind');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/networks/:networkId/unbind'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/unbind';
const options = {method: 'POST'};
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}}/networks/:networkId/unbind"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/unbind" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/unbind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/unbind');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/unbind');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/unbind');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/unbind' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/unbind' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/unbind")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/unbind"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/unbind"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/unbind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/unbind') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/unbind";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/unbind
http POST {{baseUrl}}/networks/:networkId/unbind
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/unbind
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/unbind")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update a network
{{baseUrl}}/networks/:networkId
QUERY PARAMS
networkId
BODY json
{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId" {:content-type :json
:form-params {:disableMyMerakiCom false
:disableRemoteStatusPage false
:enrollmentString ""
:name ""
:tags ""
:timeZone ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId"),
Content = new StringContent("{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId"
payload := strings.NewReader("{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 141
{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId")
.setHeader("content-type", "application/json")
.setBody("{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId")
.header("content-type", "application/json")
.body("{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}")
.asString();
const data = JSON.stringify({
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId',
headers: {'content-type': 'application/json'},
data: {
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"disableMyMerakiCom":false,"disableRemoteStatusPage":false,"enrollmentString":"","name":"","tags":"","timeZone":""}'
};
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}}/networks/:networkId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "disableMyMerakiCom": false,\n "disableRemoteStatusPage": false,\n "enrollmentString": "",\n "name": "",\n "tags": "",\n "timeZone": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId',
headers: {'content-type': 'application/json'},
body: {
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId',
headers: {'content-type': 'application/json'},
data: {
disableMyMerakiCom: false,
disableRemoteStatusPage: false,
enrollmentString: '',
name: '',
tags: '',
timeZone: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"disableMyMerakiCom":false,"disableRemoteStatusPage":false,"enrollmentString":"","name":"","tags":"","timeZone":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"disableMyMerakiCom": @NO,
@"disableRemoteStatusPage": @NO,
@"enrollmentString": @"",
@"name": @"",
@"tags": @"",
@"timeZone": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'enrollmentString' => '',
'name' => '',
'tags' => '',
'timeZone' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId', [
'body' => '{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'enrollmentString' => '',
'name' => '',
'tags' => '',
'timeZone' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'disableMyMerakiCom' => null,
'disableRemoteStatusPage' => null,
'enrollmentString' => '',
'name' => '',
'tags' => '',
'timeZone' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId"
payload = {
"disableMyMerakiCom": False,
"disableRemoteStatusPage": False,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId"
payload <- "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId') do |req|
req.body = "{\n \"disableMyMerakiCom\": false,\n \"disableRemoteStatusPage\": false,\n \"enrollmentString\": \"\",\n \"name\": \"\",\n \"tags\": \"\",\n \"timeZone\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId";
let payload = json!({
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId \
--header 'content-type: application/json' \
--data '{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}'
echo '{
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "disableMyMerakiCom": false,\n "disableRemoteStatusPage": false,\n "enrollmentString": "",\n "name": "",\n "tags": "",\n "timeZone": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"disableMyMerakiCom": false,
"disableRemoteStatusPage": false,
"enrollmentString": "",
"name": "",
"tags": "",
"timeZone": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"disableMyMerakiCom": false,
"enrollmentString": "my-enrollment-string",
"id": "N_24329156",
"name": "Main Office",
"organizationId": "2930418",
"productTypes": [
"appliance",
"switch",
"wireless"
],
"tags": " tag1 tag2 ",
"timeZone": "America/Los_Angeles",
"type": "combined"
}
PUT
Update the site-to-site VPN settings of a network
{{baseUrl}}/networks/:networkId/siteToSiteVpn
QUERY PARAMS
networkId
BODY json
{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/siteToSiteVpn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/siteToSiteVpn" {:content-type :json
:form-params {:hubs [{:hubId ""
:useDefaultRoute false}]
:mode ""
:subnets [{:localSubnet ""
:useVpn false}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/siteToSiteVpn"),
Content = new StringContent("{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/siteToSiteVpn");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
payload := strings.NewReader("{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/siteToSiteVpn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 174
{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.setHeader("content-type", "application/json")
.setBody("{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/siteToSiteVpn"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.header("content-type", "application/json")
.body("{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}")
.asString();
const data = JSON.stringify({
hubs: [
{
hubId: '',
useDefaultRoute: false
}
],
mode: '',
subnets: [
{
localSubnet: '',
useVpn: false
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/siteToSiteVpn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/siteToSiteVpn',
headers: {'content-type': 'application/json'},
data: {
hubs: [{hubId: '', useDefaultRoute: false}],
mode: '',
subnets: [{localSubnet: '', useVpn: false}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/siteToSiteVpn';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"hubs":[{"hubId":"","useDefaultRoute":false}],"mode":"","subnets":[{"localSubnet":"","useVpn":false}]}'
};
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}}/networks/:networkId/siteToSiteVpn',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "hubs": [\n {\n "hubId": "",\n "useDefaultRoute": false\n }\n ],\n "mode": "",\n "subnets": [\n {\n "localSubnet": "",\n "useVpn": false\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/siteToSiteVpn',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
hubs: [{hubId: '', useDefaultRoute: false}],
mode: '',
subnets: [{localSubnet: '', useVpn: false}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/siteToSiteVpn',
headers: {'content-type': 'application/json'},
body: {
hubs: [{hubId: '', useDefaultRoute: false}],
mode: '',
subnets: [{localSubnet: '', useVpn: false}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/siteToSiteVpn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
hubs: [
{
hubId: '',
useDefaultRoute: false
}
],
mode: '',
subnets: [
{
localSubnet: '',
useVpn: false
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/siteToSiteVpn',
headers: {'content-type': 'application/json'},
data: {
hubs: [{hubId: '', useDefaultRoute: false}],
mode: '',
subnets: [{localSubnet: '', useVpn: false}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/siteToSiteVpn';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"hubs":[{"hubId":"","useDefaultRoute":false}],"mode":"","subnets":[{"localSubnet":"","useVpn":false}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hubs": @[ @{ @"hubId": @"", @"useDefaultRoute": @NO } ],
@"mode": @"",
@"subnets": @[ @{ @"localSubnet": @"", @"useVpn": @NO } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/siteToSiteVpn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/siteToSiteVpn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/siteToSiteVpn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'hubs' => [
[
'hubId' => '',
'useDefaultRoute' => null
]
],
'mode' => '',
'subnets' => [
[
'localSubnet' => '',
'useVpn' => null
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/siteToSiteVpn', [
'body' => '{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/siteToSiteVpn');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hubs' => [
[
'hubId' => '',
'useDefaultRoute' => null
]
],
'mode' => '',
'subnets' => [
[
'localSubnet' => '',
'useVpn' => null
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hubs' => [
[
'hubId' => '',
'useDefaultRoute' => null
]
],
'mode' => '',
'subnets' => [
[
'localSubnet' => '',
'useVpn' => null
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/siteToSiteVpn');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/siteToSiteVpn' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/siteToSiteVpn' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/siteToSiteVpn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
payload = {
"hubs": [
{
"hubId": "",
"useDefaultRoute": False
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": False
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/siteToSiteVpn"
payload <- "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/siteToSiteVpn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/siteToSiteVpn') do |req|
req.body = "{\n \"hubs\": [\n {\n \"hubId\": \"\",\n \"useDefaultRoute\": false\n }\n ],\n \"mode\": \"\",\n \"subnets\": [\n {\n \"localSubnet\": \"\",\n \"useVpn\": false\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/siteToSiteVpn";
let payload = json!({
"hubs": (
json!({
"hubId": "",
"useDefaultRoute": false
})
),
"mode": "",
"subnets": (
json!({
"localSubnet": "",
"useVpn": false
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/siteToSiteVpn \
--header 'content-type: application/json' \
--data '{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}'
echo '{
"hubs": [
{
"hubId": "",
"useDefaultRoute": false
}
],
"mode": "",
"subnets": [
{
"localSubnet": "",
"useVpn": false
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/siteToSiteVpn \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "hubs": [\n {\n "hubId": "",\n "useDefaultRoute": false\n }\n ],\n "mode": "",\n "subnets": [\n {\n "localSubnet": "",\n "useVpn": false\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/siteToSiteVpn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"hubs": [
[
"hubId": "",
"useDefaultRoute": false
]
],
"mode": "",
"subnets": [
[
"localSubnet": "",
"useVpn": false
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/siteToSiteVpn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hubs": [
{
"hubId": "N_4901849",
"useDefaultRoute": true
},
{
"hubId": "N_1892489",
"useDefaultRoute": false
}
],
"mode": "spoke",
"peerSgtCapable": true,
"subnets": [
{
"localSubnet": "192.168.1.0/24",
"useVpn": true
},
{
"localSubnet": "192.168.128.0/24",
"useVpn": true
}
]
}
GET
Return the OpenAPI 2.0 Specification of the organization's API documentation in JSON
{{baseUrl}}/organizations/:organizationId/openapiSpec
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/openapiSpec");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/openapiSpec")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/openapiSpec"
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}}/organizations/:organizationId/openapiSpec"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/openapiSpec");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/openapiSpec"
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/organizations/:organizationId/openapiSpec HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/openapiSpec")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/openapiSpec"))
.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}}/organizations/:organizationId/openapiSpec")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/openapiSpec")
.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}}/organizations/:organizationId/openapiSpec');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/openapiSpec'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/openapiSpec';
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}}/organizations/:organizationId/openapiSpec',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/openapiSpec")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/openapiSpec',
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}}/organizations/:organizationId/openapiSpec'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/openapiSpec');
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}}/organizations/:organizationId/openapiSpec'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/openapiSpec';
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}}/organizations/:organizationId/openapiSpec"]
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}}/organizations/:organizationId/openapiSpec" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/openapiSpec",
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}}/organizations/:organizationId/openapiSpec');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/openapiSpec');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/openapiSpec');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/openapiSpec' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/openapiSpec' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/openapiSpec")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/openapiSpec"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/openapiSpec"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/openapiSpec")
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/organizations/:organizationId/openapiSpec') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/openapiSpec";
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}}/organizations/:organizationId/openapiSpec
http GET {{baseUrl}}/organizations/:organizationId/openapiSpec
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/openapiSpec
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/openapiSpec")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"info": {
"description": "This collection of API calls provides an easy way to interact with a Cisco Meraki network",
"title": "Meraki Dashboard API",
"version": "v0"
},
"paths": {
"/organizations": {
"get": {
"description": "List the organizations that the user has privileges on",
"operationId": "getOrganizations",
"responses": {
"200": {
"description": "Successful operation",
"examples": {
"application/json": [
{
"id": "2930418",
"name": "My organization"
}
]
}
}
}
}
}
},
"swagger": "2.0"
}
POST
Claim a list of devices, licenses, and-or orders into an organization
{{baseUrl}}/organizations/:organizationId/claim
QUERY PARAMS
organizationId
BODY json
{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/claim");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/claim" {:content-type :json
:form-params {:licenses [{:key ""
:mode ""}]
:orders []
:serials []}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/claim"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/claim"),
Content = new StringContent("{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/claim");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/claim"
payload := strings.NewReader("{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/claim HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 102
{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/claim")
.setHeader("content-type", "application/json")
.setBody("{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/claim"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/claim")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/claim")
.header("content-type", "application/json")
.body("{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}")
.asString();
const data = JSON.stringify({
licenses: [
{
key: '',
mode: ''
}
],
orders: [],
serials: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/claim');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/claim',
headers: {'content-type': 'application/json'},
data: {licenses: [{key: '', mode: ''}], orders: [], serials: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/claim';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenses":[{"key":"","mode":""}],"orders":[],"serials":[]}'
};
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}}/organizations/:organizationId/claim',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "licenses": [\n {\n "key": "",\n "mode": ""\n }\n ],\n "orders": [],\n "serials": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/claim")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/claim',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({licenses: [{key: '', mode: ''}], orders: [], serials: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/claim',
headers: {'content-type': 'application/json'},
body: {licenses: [{key: '', mode: ''}], orders: [], serials: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/claim');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
licenses: [
{
key: '',
mode: ''
}
],
orders: [],
serials: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/claim',
headers: {'content-type': 'application/json'},
data: {licenses: [{key: '', mode: ''}], orders: [], serials: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/claim';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"licenses":[{"key":"","mode":""}],"orders":[],"serials":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"licenses": @[ @{ @"key": @"", @"mode": @"" } ],
@"orders": @[ ],
@"serials": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/claim"]
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}}/organizations/:organizationId/claim" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/claim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'licenses' => [
[
'key' => '',
'mode' => ''
]
],
'orders' => [
],
'serials' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/claim', [
'body' => '{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/claim');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'licenses' => [
[
'key' => '',
'mode' => ''
]
],
'orders' => [
],
'serials' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'licenses' => [
[
'key' => '',
'mode' => ''
]
],
'orders' => [
],
'serials' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/claim');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/claim' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/claim' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/claim", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/claim"
payload = {
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/claim"
payload <- "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/claim') do |req|
req.body = "{\n \"licenses\": [\n {\n \"key\": \"\",\n \"mode\": \"\"\n }\n ],\n \"orders\": [],\n \"serials\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/claim";
let payload = json!({
"licenses": (
json!({
"key": "",
"mode": ""
})
),
"orders": (),
"serials": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/claim \
--header 'content-type: application/json' \
--data '{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}'
echo '{
"licenses": [
{
"key": "",
"mode": ""
}
],
"orders": [],
"serials": []
}' | \
http POST {{baseUrl}}/organizations/:organizationId/claim \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "licenses": [\n {\n "key": "",\n "mode": ""\n }\n ],\n "orders": [],\n "serials": []\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/claim
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"licenses": [
[
"key": "",
"mode": ""
]
],
"orders": [],
"serials": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/claim")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"licenses": [
{
"key": "Z2XXXXXXXXXX",
"mode": "addDevices"
}
],
"orders": [
"4CXXXXXXX"
],
"serials": [
"Q234-ABCD-5678"
]
}
POST
Create a new organization by cloning the addressed organization
{{baseUrl}}/organizations/:organizationId/clone
QUERY PARAMS
organizationId
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/clone");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/clone" {:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/clone"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/clone"),
Content = new StringContent("{\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/clone");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/clone"
payload := strings.NewReader("{\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/clone HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/clone")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/clone"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/clone")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/clone")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationId/clone');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/clone',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
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}}/organizations/:organizationId/clone',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/clone")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/clone',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/clone',
headers: {'content-type': 'application/json'},
body: {name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/clone');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/clone',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/clone"]
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}}/organizations/:organizationId/clone" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/clone', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/clone');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/clone');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/clone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/clone"
payload = { "name": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/clone"
payload <- "{\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/clone') do |req|
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/clone";
let payload = json!({"name": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/clone \
--header 'content-type: application/json' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationId/clone \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/clone
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/clone")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "2930418",
"name": "My organization",
"url": "https://dashboard.meraki.com/o/VjjsAd/manage/organization/overview"
}
GET
List the organizations that the user has privileges on
{{baseUrl}}/organizations
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations")
require "http/client"
url = "{{baseUrl}}/organizations"
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}}/organizations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations"
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/organizations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations"))
.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}}/organizations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations")
.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}}/organizations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/organizations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations';
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}}/organizations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations',
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}}/organizations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations');
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}}/organizations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations';
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}}/organizations"]
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}}/organizations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations",
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}}/organizations');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations")
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/organizations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations";
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}}/organizations
http GET {{baseUrl}}/organizations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "2930418",
"name": "My organization",
"url": "https://dashboard.meraki.com/o/VjjsAd/manage/organization/overview"
}
]
GET
List the status of every Meraki device in the organization
{{baseUrl}}/organizations/:organizationId/deviceStatuses
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/deviceStatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/deviceStatuses")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/deviceStatuses"
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}}/organizations/:organizationId/deviceStatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/deviceStatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/deviceStatuses"
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/organizations/:organizationId/deviceStatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/deviceStatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/deviceStatuses"))
.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}}/organizations/:organizationId/deviceStatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/deviceStatuses")
.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}}/organizations/:organizationId/deviceStatuses');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/deviceStatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/deviceStatuses';
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}}/organizations/:organizationId/deviceStatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/deviceStatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/deviceStatuses',
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}}/organizations/:organizationId/deviceStatuses'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/deviceStatuses');
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}}/organizations/:organizationId/deviceStatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/deviceStatuses';
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}}/organizations/:organizationId/deviceStatuses"]
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}}/organizations/:organizationId/deviceStatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/deviceStatuses",
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}}/organizations/:organizationId/deviceStatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/deviceStatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/deviceStatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/deviceStatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/deviceStatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/deviceStatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/deviceStatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/deviceStatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/deviceStatuses")
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/organizations/:organizationId/deviceStatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/deviceStatuses";
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}}/organizations/:organizationId/deviceStatuses
http GET {{baseUrl}}/organizations/:organizationId/deviceStatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/deviceStatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/deviceStatuses")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"lanIp": "1.2.3.4",
"mac": "00:11:22:33:44:55",
"name": "My AP",
"networkId": "N_24329156",
"publicIp": "123.123.123.1",
"serial": "Q234-ABCD-5678",
"status": "online"
}
]
GET
Return an organization
{{baseUrl}}/organizations/:organizationId
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId"
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}}/organizations/:organizationId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId"
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/organizations/:organizationId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId"))
.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}}/organizations/:organizationId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId")
.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}}/organizations/:organizationId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId';
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}}/organizations/:organizationId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId',
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}}/organizations/:organizationId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId');
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}}/organizations/:organizationId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId';
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}}/organizations/:organizationId"]
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}}/organizations/:organizationId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId",
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}}/organizations/:organizationId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId")
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/organizations/:organizationId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId";
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}}/organizations/:organizationId
http GET {{baseUrl}}/organizations/:organizationId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "2930418",
"name": "My organization",
"url": "https://dashboard.meraki.com/o/VjjsAd/manage/organization/overview"
}
GET
Return the inventory for an organization
{{baseUrl}}/organizations/:organizationId/inventory
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/inventory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/inventory")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/inventory"
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}}/organizations/:organizationId/inventory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/inventory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/inventory"
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/organizations/:organizationId/inventory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/inventory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/inventory"))
.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}}/organizations/:organizationId/inventory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/inventory")
.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}}/organizations/:organizationId/inventory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/inventory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/inventory';
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}}/organizations/:organizationId/inventory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/inventory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/inventory',
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}}/organizations/:organizationId/inventory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/inventory');
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}}/organizations/:organizationId/inventory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/inventory';
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}}/organizations/:organizationId/inventory"]
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}}/organizations/:organizationId/inventory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/inventory",
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}}/organizations/:organizationId/inventory');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/inventory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/inventory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/inventory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/inventory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/inventory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/inventory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/inventory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/inventory")
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/organizations/:organizationId/inventory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/inventory";
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}}/organizations/:organizationId/inventory
http GET {{baseUrl}}/organizations/:organizationId/inventory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/inventory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/inventory")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"claimedAt": 1518365681,
"mac": "00:11:22:33:44:55",
"model": "MR34",
"name": "My AP",
"networkId": "N_24329156",
"publicIp": "123.123.123.1",
"serial": "Q234-ABCD-5678"
}
]
GET
Return the third party VPN peers for an organization
{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
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}}/organizations/:organizationId/thirdPartyVPNPeers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
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/organizations/:organizationId/thirdPartyVPNPeers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"))
.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}}/organizations/:organizationId/thirdPartyVPNPeers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.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}}/organizations/:organizationId/thirdPartyVPNPeers');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers';
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}}/organizations/:organizationId/thirdPartyVPNPeers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/thirdPartyVPNPeers',
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}}/organizations/:organizationId/thirdPartyVPNPeers'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
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}}/organizations/:organizationId/thirdPartyVPNPeers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers';
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}}/organizations/:organizationId/thirdPartyVPNPeers"]
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}}/organizations/:organizationId/thirdPartyVPNPeers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers",
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}}/organizations/:organizationId/thirdPartyVPNPeers');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/thirdPartyVPNPeers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
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/organizations/:organizationId/thirdPartyVPNPeers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers";
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}}/organizations/:organizationId/thirdPartyVPNPeers
http GET {{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"ikeVersion": "2",
"ipsecPolicies": {
"childAuthAlgo": [
"sha1"
],
"childCipherAlgo": [
"aes128"
],
"childLifetime": 28800,
"childPfsGroup": [
"disabled"
],
"ikeAuthAlgo": [
"sha1"
],
"ikeCipherAlgo": [
"tripledes"
],
"ikeDiffieHellmanGroup": [
"group2"
],
"ikeLifetime": 28800,
"ikePrfAlgo": [
"prfsha1"
]
},
"name": "My peer 1",
"networkTags": [
"all"
],
"privateSubnets": [
"192.168.1.0/24",
"192.168.128.0/24"
],
"publicIp": "123.123.123.1",
"secret": "asdf1234"
},
{
"ikeVersion": "1",
"ipsecPoliciesPreset": "default",
"name": "My peer 2",
"networkTags": [
"none"
],
"privateSubnets": [
"192.168.2.0/24",
"192.168.129.0/24"
],
"publicIp": "123.123.123.2",
"remoteId": "miles@meraki.com",
"secret": "asdf56785678567856785678"
}
]
GET
Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago
{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency"
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}}/organizations/:organizationId/uplinksLossAndLatency"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency"
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/organizations/:organizationId/uplinksLossAndLatency HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency"))
.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}}/organizations/:organizationId/uplinksLossAndLatency")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")
.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}}/organizations/:organizationId/uplinksLossAndLatency');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency';
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}}/organizations/:organizationId/uplinksLossAndLatency',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/uplinksLossAndLatency',
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}}/organizations/:organizationId/uplinksLossAndLatency'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency');
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}}/organizations/:organizationId/uplinksLossAndLatency'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency';
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}}/organizations/:organizationId/uplinksLossAndLatency"]
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}}/organizations/:organizationId/uplinksLossAndLatency" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency",
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}}/organizations/:organizationId/uplinksLossAndLatency');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/uplinksLossAndLatency")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")
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/organizations/:organizationId/uplinksLossAndLatency') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency";
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}}/organizations/:organizationId/uplinksLossAndLatency
http GET {{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/uplinksLossAndLatency")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"ip": "8.8.8.8",
"networkId": "N_12345",
"serial": "Q2AB-CDEF-GHIJ",
"timeSeries": [
{
"latencyMs": 194.9,
"lossPercent": 5.3,
"ts": "2019-01-31T18:46:13Z"
}
],
"uplink": "wan1"
}
]
PUT
Update the third party VPN peers for an organization
{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers
QUERY PARAMS
organizationId
BODY json
{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers" {:content-type :json
:form-params {:peers [{:ikeVersion ""
:ipsecPolicies {:childAuthAlgo []
:childCipherAlgo []
:childLifetime 0
:childPfsGroup []
:ikeAuthAlgo []
:ikeCipherAlgo []
:ikeDiffieHellmanGroup []
:ikeLifetime 0
:ikePrfAlgo []}
:ipsecPoliciesPreset ""
:name ""
:networkTags []
:privateSubnets []
:publicIp ""
:remoteId ""
:secret ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"),
Content = new StringContent("{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
payload := strings.NewReader("{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/thirdPartyVPNPeers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 518
{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.setHeader("content-type", "application/json")
.setBody("{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.header("content-type", "application/json")
.body("{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers',
headers: {'content-type': 'application/json'},
data: {
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"peers":[{"ikeVersion":"","ipsecPolicies":{"childAuthAlgo":[],"childCipherAlgo":[],"childLifetime":0,"childPfsGroup":[],"ikeAuthAlgo":[],"ikeCipherAlgo":[],"ikeDiffieHellmanGroup":[],"ikeLifetime":0,"ikePrfAlgo":[]},"ipsecPoliciesPreset":"","name":"","networkTags":[],"privateSubnets":[],"publicIp":"","remoteId":"","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}}/organizations/:organizationId/thirdPartyVPNPeers',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "peers": [\n {\n "ikeVersion": "",\n "ipsecPolicies": {\n "childAuthAlgo": [],\n "childCipherAlgo": [],\n "childLifetime": 0,\n "childPfsGroup": [],\n "ikeAuthAlgo": [],\n "ikeCipherAlgo": [],\n "ikeDiffieHellmanGroup": [],\n "ikeLifetime": 0,\n "ikePrfAlgo": []\n },\n "ipsecPoliciesPreset": "",\n "name": "",\n "networkTags": [],\n "privateSubnets": [],\n "publicIp": "",\n "remoteId": "",\n "secret": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/thirdPartyVPNPeers',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers',
headers: {'content-type': 'application/json'},
body: {
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers',
headers: {'content-type': 'application/json'},
data: {
peers: [
{
ikeVersion: '',
ipsecPolicies: {
childAuthAlgo: [],
childCipherAlgo: [],
childLifetime: 0,
childPfsGroup: [],
ikeAuthAlgo: [],
ikeCipherAlgo: [],
ikeDiffieHellmanGroup: [],
ikeLifetime: 0,
ikePrfAlgo: []
},
ipsecPoliciesPreset: '',
name: '',
networkTags: [],
privateSubnets: [],
publicIp: '',
remoteId: '',
secret: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"peers":[{"ikeVersion":"","ipsecPolicies":{"childAuthAlgo":[],"childCipherAlgo":[],"childLifetime":0,"childPfsGroup":[],"ikeAuthAlgo":[],"ikeCipherAlgo":[],"ikeDiffieHellmanGroup":[],"ikeLifetime":0,"ikePrfAlgo":[]},"ipsecPoliciesPreset":"","name":"","networkTags":[],"privateSubnets":[],"publicIp":"","remoteId":"","secret":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"peers": @[ @{ @"ikeVersion": @"", @"ipsecPolicies": @{ @"childAuthAlgo": @[ ], @"childCipherAlgo": @[ ], @"childLifetime": @0, @"childPfsGroup": @[ ], @"ikeAuthAlgo": @[ ], @"ikeCipherAlgo": @[ ], @"ikeDiffieHellmanGroup": @[ ], @"ikeLifetime": @0, @"ikePrfAlgo": @[ ] }, @"ipsecPoliciesPreset": @"", @"name": @"", @"networkTags": @[ ], @"privateSubnets": @[ ], @"publicIp": @"", @"remoteId": @"", @"secret": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'peers' => [
[
'ikeVersion' => '',
'ipsecPolicies' => [
'childAuthAlgo' => [
],
'childCipherAlgo' => [
],
'childLifetime' => 0,
'childPfsGroup' => [
],
'ikeAuthAlgo' => [
],
'ikeCipherAlgo' => [
],
'ikeDiffieHellmanGroup' => [
],
'ikeLifetime' => 0,
'ikePrfAlgo' => [
]
],
'ipsecPoliciesPreset' => '',
'name' => '',
'networkTags' => [
],
'privateSubnets' => [
],
'publicIp' => '',
'remoteId' => '',
'secret' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers', [
'body' => '{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'peers' => [
[
'ikeVersion' => '',
'ipsecPolicies' => [
'childAuthAlgo' => [
],
'childCipherAlgo' => [
],
'childLifetime' => 0,
'childPfsGroup' => [
],
'ikeAuthAlgo' => [
],
'ikeCipherAlgo' => [
],
'ikeDiffieHellmanGroup' => [
],
'ikeLifetime' => 0,
'ikePrfAlgo' => [
]
],
'ipsecPoliciesPreset' => '',
'name' => '',
'networkTags' => [
],
'privateSubnets' => [
],
'publicIp' => '',
'remoteId' => '',
'secret' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'peers' => [
[
'ikeVersion' => '',
'ipsecPolicies' => [
'childAuthAlgo' => [
],
'childCipherAlgo' => [
],
'childLifetime' => 0,
'childPfsGroup' => [
],
'ikeAuthAlgo' => [
],
'ikeCipherAlgo' => [
],
'ikeDiffieHellmanGroup' => [
],
'ikeLifetime' => 0,
'ikePrfAlgo' => [
]
],
'ipsecPoliciesPreset' => '',
'name' => '',
'networkTags' => [
],
'privateSubnets' => [
],
'publicIp' => '',
'remoteId' => '',
'secret' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/thirdPartyVPNPeers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
payload = { "peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers"
payload <- "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/thirdPartyVPNPeers') do |req|
req.body = "{\n \"peers\": [\n {\n \"ikeVersion\": \"\",\n \"ipsecPolicies\": {\n \"childAuthAlgo\": [],\n \"childCipherAlgo\": [],\n \"childLifetime\": 0,\n \"childPfsGroup\": [],\n \"ikeAuthAlgo\": [],\n \"ikeCipherAlgo\": [],\n \"ikeDiffieHellmanGroup\": [],\n \"ikeLifetime\": 0,\n \"ikePrfAlgo\": []\n },\n \"ipsecPoliciesPreset\": \"\",\n \"name\": \"\",\n \"networkTags\": [],\n \"privateSubnets\": [],\n \"publicIp\": \"\",\n \"remoteId\": \"\",\n \"secret\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers";
let payload = json!({"peers": (
json!({
"ikeVersion": "",
"ipsecPolicies": json!({
"childAuthAlgo": (),
"childCipherAlgo": (),
"childLifetime": 0,
"childPfsGroup": (),
"ikeAuthAlgo": (),
"ikeCipherAlgo": (),
"ikeDiffieHellmanGroup": (),
"ikeLifetime": 0,
"ikePrfAlgo": ()
}),
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": (),
"privateSubnets": (),
"publicIp": "",
"remoteId": "",
"secret": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers \
--header 'content-type: application/json' \
--data '{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}'
echo '{
"peers": [
{
"ikeVersion": "",
"ipsecPolicies": {
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
},
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
}
]
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "peers": [\n {\n "ikeVersion": "",\n "ipsecPolicies": {\n "childAuthAlgo": [],\n "childCipherAlgo": [],\n "childLifetime": 0,\n "childPfsGroup": [],\n "ikeAuthAlgo": [],\n "ikeCipherAlgo": [],\n "ikeDiffieHellmanGroup": [],\n "ikeLifetime": 0,\n "ikePrfAlgo": []\n },\n "ipsecPoliciesPreset": "",\n "name": "",\n "networkTags": [],\n "privateSubnets": [],\n "publicIp": "",\n "remoteId": "",\n "secret": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["peers": [
[
"ikeVersion": "",
"ipsecPolicies": [
"childAuthAlgo": [],
"childCipherAlgo": [],
"childLifetime": 0,
"childPfsGroup": [],
"ikeAuthAlgo": [],
"ikeCipherAlgo": [],
"ikeDiffieHellmanGroup": [],
"ikeLifetime": 0,
"ikePrfAlgo": []
],
"ipsecPoliciesPreset": "",
"name": "",
"networkTags": [],
"privateSubnets": [],
"publicIp": "",
"remoteId": "",
"secret": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/thirdPartyVPNPeers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"ikeVersion": "2",
"ipsecPolicies": {
"childAuthAlgo": [
"sha1"
],
"childCipherAlgo": [
"aes128"
],
"childLifetime": 28800,
"childPfsGroup": [
"disabled"
],
"ikeAuthAlgo": [
"sha1"
],
"ikeCipherAlgo": [
"tripledes"
],
"ikeDiffieHellmanGroup": [
"group2"
],
"ikeLifetime": 28800,
"ikePrfAlgo": [
"prfsha1"
]
},
"name": "My peer 1",
"networkTags": [
"all"
],
"privateSubnets": [
"192.168.1.0/24",
"192.168.128.0/24"
],
"publicIp": "123.123.123.1",
"secret": "asdf1234"
},
{
"ikeVersion": "1",
"ipsecPoliciesPreset": "default",
"name": "My peer 2",
"networkTags": [
"none"
],
"privateSubnets": [
"192.168.2.0/24",
"192.168.129.0/24"
],
"publicIp": "123.123.123.2",
"remoteId": "miles@meraki.com",
"secret": "asdf56785678567856785678"
}
]
DELETE
Delete a restrict processing PII request
{{baseUrl}}/networks/:networkId/pii/requests/:requestId
QUERY PARAMS
networkId
requestId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/requests/:requestId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
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}}/networks/:networkId/pii/requests/:requestId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/requests/:requestId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
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/networks/:networkId/pii/requests/:requestId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/requests/:requestId"))
.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}}/networks/:networkId/pii/requests/:requestId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.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}}/networks/:networkId/pii/requests/:requestId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/pii/requests/:requestId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/requests/:requestId';
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}}/networks/:networkId/pii/requests/:requestId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/requests/:requestId',
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}}/networks/:networkId/pii/requests/:requestId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
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}}/networks/:networkId/pii/requests/:requestId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/requests/:requestId';
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}}/networks/:networkId/pii/requests/:requestId"]
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}}/networks/:networkId/pii/requests/:requestId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/requests/:requestId",
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}}/networks/:networkId/pii/requests/:requestId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/requests/:requestId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/requests/:requestId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/pii/requests/:requestId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
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/networks/:networkId/pii/requests/:requestId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId";
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}}/networks/:networkId/pii/requests/:requestId
http DELETE {{baseUrl}}/networks/:networkId/pii/requests/:requestId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/requests/:requestId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")! 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
Given a piece of Personally Identifiable Information (PII), return the Systems Manager device ID(s) associated with that identifier
{{baseUrl}}/networks/:networkId/pii/smDevicesForKey
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey"
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}}/networks/:networkId/pii/smDevicesForKey"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/smDevicesForKey");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey"
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/networks/:networkId/pii/smDevicesForKey HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/smDevicesForKey"))
.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}}/networks/:networkId/pii/smDevicesForKey")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")
.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}}/networks/:networkId/pii/smDevicesForKey');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey';
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}}/networks/:networkId/pii/smDevicesForKey',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/smDevicesForKey',
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}}/networks/:networkId/pii/smDevicesForKey'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey');
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}}/networks/:networkId/pii/smDevicesForKey'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey';
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}}/networks/:networkId/pii/smDevicesForKey"]
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}}/networks/:networkId/pii/smDevicesForKey" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/smDevicesForKey",
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}}/networks/:networkId/pii/smDevicesForKey');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/smDevicesForKey');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/smDevicesForKey');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/smDevicesForKey' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/pii/smDevicesForKey")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")
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/networks/:networkId/pii/smDevicesForKey') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey";
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}}/networks/:networkId/pii/smDevicesForKey
http GET {{baseUrl}}/networks/:networkId/pii/smDevicesForKey
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/smDevicesForKey
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/smDevicesForKey")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"N_1234": [
"1099541095293",
"8348382288234"
]
}
GET
Given a piece of Personally Identifiable Information (PII), return the Systems Manager owner ID(s) associated with that identifier
{{baseUrl}}/networks/:networkId/pii/smOwnersForKey
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey"
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}}/networks/:networkId/pii/smOwnersForKey"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/smOwnersForKey");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey"
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/networks/:networkId/pii/smOwnersForKey HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/smOwnersForKey"))
.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}}/networks/:networkId/pii/smOwnersForKey")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")
.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}}/networks/:networkId/pii/smOwnersForKey');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey';
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}}/networks/:networkId/pii/smOwnersForKey',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/smOwnersForKey',
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}}/networks/:networkId/pii/smOwnersForKey'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey');
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}}/networks/:networkId/pii/smOwnersForKey'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey';
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}}/networks/:networkId/pii/smOwnersForKey"]
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}}/networks/:networkId/pii/smOwnersForKey" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/smOwnersForKey",
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}}/networks/:networkId/pii/smOwnersForKey');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/smOwnersForKey');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/smOwnersForKey');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/smOwnersForKey' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/pii/smOwnersForKey")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")
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/networks/:networkId/pii/smOwnersForKey') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey";
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}}/networks/:networkId/pii/smOwnersForKey
http GET {{baseUrl}}/networks/:networkId/pii/smOwnersForKey
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/smOwnersForKey
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/smOwnersForKey")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"N_1234": [
"1099541095293"
]
}
GET
List the PII requests for this network or organization
{{baseUrl}}/networks/:networkId/pii/requests
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/requests");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/pii/requests")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/requests"
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}}/networks/:networkId/pii/requests"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/requests");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/requests"
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/networks/:networkId/pii/requests HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/pii/requests")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/requests"))
.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}}/networks/:networkId/pii/requests")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/pii/requests")
.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}}/networks/:networkId/pii/requests');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/pii/requests'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/requests';
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}}/networks/:networkId/pii/requests',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/requests")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/requests',
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}}/networks/:networkId/pii/requests'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/pii/requests');
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}}/networks/:networkId/pii/requests'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/requests';
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}}/networks/:networkId/pii/requests"]
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}}/networks/:networkId/pii/requests" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/requests",
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}}/networks/:networkId/pii/requests');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/requests');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/requests');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/requests' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/requests' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/pii/requests")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/requests"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/requests"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/requests")
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/networks/:networkId/pii/requests') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/requests";
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}}/networks/:networkId/pii/requests
http GET {{baseUrl}}/networks/:networkId/pii/requests
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/requests
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/requests")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"completedAt": 1524702227,
"createdAt": 1524692227,
"datasets": "['usage', 'events']",
"id": "1234",
"mac": "00:77:00:77:00:77",
"networkId": "N_1234",
"organizationWide": false,
"status": "Completed",
"type": "delete"
}
]
GET
List the keys required to access Personally Identifiable Information (PII) for a given identifier
{{baseUrl}}/networks/:networkId/pii/piiKeys
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/piiKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/pii/piiKeys")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/piiKeys"
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}}/networks/:networkId/pii/piiKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/piiKeys");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/piiKeys"
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/networks/:networkId/pii/piiKeys HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/pii/piiKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/piiKeys"))
.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}}/networks/:networkId/pii/piiKeys")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/pii/piiKeys")
.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}}/networks/:networkId/pii/piiKeys');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/pii/piiKeys'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/piiKeys';
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}}/networks/:networkId/pii/piiKeys',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/piiKeys")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/piiKeys',
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}}/networks/:networkId/pii/piiKeys'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/pii/piiKeys');
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}}/networks/:networkId/pii/piiKeys'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/piiKeys';
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}}/networks/:networkId/pii/piiKeys"]
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}}/networks/:networkId/pii/piiKeys" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/piiKeys",
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}}/networks/:networkId/pii/piiKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/piiKeys');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/piiKeys');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/piiKeys' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/piiKeys' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/pii/piiKeys")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/piiKeys"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/piiKeys"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/piiKeys")
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/networks/:networkId/pii/piiKeys') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/piiKeys";
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}}/networks/:networkId/pii/piiKeys
http GET {{baseUrl}}/networks/:networkId/pii/piiKeys
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/piiKeys
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/piiKeys")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"N_1234": {
"bluetoothMacs": [
"00:77:00:77:00:77"
],
"emails": [
"fake@example.com"
],
"imeis": [
"990000862471854"
],
"macs": [
"00:77:00:77:00:77"
],
"serials": [
"abcd1234"
],
"usernames": [
"fakename"
]
}
}
GET
Return a PII request
{{baseUrl}}/networks/:networkId/pii/requests/:requestId
QUERY PARAMS
networkId
requestId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/requests/:requestId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
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}}/networks/:networkId/pii/requests/:requestId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/requests/:requestId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
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/networks/:networkId/pii/requests/:requestId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/requests/:requestId"))
.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}}/networks/:networkId/pii/requests/:requestId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.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}}/networks/:networkId/pii/requests/:requestId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/pii/requests/:requestId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/requests/:requestId';
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}}/networks/:networkId/pii/requests/:requestId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/requests/:requestId',
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}}/networks/:networkId/pii/requests/:requestId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
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}}/networks/:networkId/pii/requests/:requestId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/requests/:requestId';
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}}/networks/:networkId/pii/requests/:requestId"]
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}}/networks/:networkId/pii/requests/:requestId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/requests/:requestId",
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}}/networks/:networkId/pii/requests/:requestId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/pii/requests/:requestId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/requests/:requestId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/requests/:requestId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/pii/requests/:requestId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/requests/:requestId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/requests/:requestId")
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/networks/:networkId/pii/requests/:requestId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/requests/:requestId";
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}}/networks/:networkId/pii/requests/:requestId
http GET {{baseUrl}}/networks/:networkId/pii/requests/:requestId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/requests/:requestId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/requests/:requestId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"completedAt": 1524702227,
"createdAt": 1524692227,
"datasets": "['usage', 'events']",
"id": "1234",
"mac": "00:77:00:77:00:77",
"networkId": "N_1234",
"organizationWide": false,
"status": "Completed",
"type": "delete"
}
POST
Submit a new delete or restrict processing PII request
{{baseUrl}}/networks/:networkId/pii/requests
QUERY PARAMS
networkId
BODY json
{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/pii/requests");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/pii/requests" {:content-type :json
:form-params {:datasets []
:email ""
:mac ""
:smDeviceId ""
:smUserId ""
:type ""
:username ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/pii/requests"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/pii/requests"),
Content = new StringContent("{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/pii/requests");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/pii/requests"
payload := strings.NewReader("{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/pii/requests HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 118
{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/pii/requests")
.setHeader("content-type", "application/json")
.setBody("{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/pii/requests"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/requests")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/pii/requests")
.header("content-type", "application/json")
.body("{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}")
.asString();
const data = JSON.stringify({
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/pii/requests');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/pii/requests',
headers: {'content-type': 'application/json'},
data: {
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/pii/requests';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"datasets":[],"email":"","mac":"","smDeviceId":"","smUserId":"","type":"","username":""}'
};
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}}/networks/:networkId/pii/requests',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "datasets": [],\n "email": "",\n "mac": "",\n "smDeviceId": "",\n "smUserId": "",\n "type": "",\n "username": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/pii/requests")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/pii/requests',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/pii/requests',
headers: {'content-type': 'application/json'},
body: {
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/pii/requests');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/pii/requests',
headers: {'content-type': 'application/json'},
data: {
datasets: [],
email: '',
mac: '',
smDeviceId: '',
smUserId: '',
type: '',
username: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/pii/requests';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"datasets":[],"email":"","mac":"","smDeviceId":"","smUserId":"","type":"","username":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"datasets": @[ ],
@"email": @"",
@"mac": @"",
@"smDeviceId": @"",
@"smUserId": @"",
@"type": @"",
@"username": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/pii/requests"]
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}}/networks/:networkId/pii/requests" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/pii/requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'datasets' => [
],
'email' => '',
'mac' => '',
'smDeviceId' => '',
'smUserId' => '',
'type' => '',
'username' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/pii/requests', [
'body' => '{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/pii/requests');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'datasets' => [
],
'email' => '',
'mac' => '',
'smDeviceId' => '',
'smUserId' => '',
'type' => '',
'username' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'datasets' => [
],
'email' => '',
'mac' => '',
'smDeviceId' => '',
'smUserId' => '',
'type' => '',
'username' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/pii/requests');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/pii/requests' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/pii/requests' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/pii/requests", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/pii/requests"
payload = {
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/pii/requests"
payload <- "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/pii/requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/pii/requests') do |req|
req.body = "{\n \"datasets\": [],\n \"email\": \"\",\n \"mac\": \"\",\n \"smDeviceId\": \"\",\n \"smUserId\": \"\",\n \"type\": \"\",\n \"username\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/pii/requests";
let payload = json!({
"datasets": (),
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/pii/requests \
--header 'content-type: application/json' \
--data '{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}'
echo '{
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/pii/requests \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "datasets": [],\n "email": "",\n "mac": "",\n "smDeviceId": "",\n "smUserId": "",\n "type": "",\n "username": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/pii/requests
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"datasets": [],
"email": "",
"mac": "",
"smDeviceId": "",
"smUserId": "",
"type": "",
"username": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/pii/requests")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"completedAt": null,
"createdAt": 1524692227,
"datasets": "['usage', 'events']",
"id": "1234",
"mac": "00:77:00:77:00:77",
"networkId": "N_1234",
"organizationWide": false,
"status": "Not visible in Dashboard; database deletion in process",
"type": "delete"
}
POST
Creates new RF profile for this network
{{baseUrl}}/networks/:networkId/wireless/rfProfiles
QUERY PARAMS
networkId
BODY json
{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/rfProfiles");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/wireless/rfProfiles" {:content-type :json
:form-params {:apBandSettings {:bandOperationMode ""
:bandSteeringEnabled false}
:bandSelectionType ""
:clientBalancingEnabled false
:fiveGhzSettings {:channelWidth ""
:maxPower 0
:minBitrate 0
:minPower 0
:rxsop 0
:validAutoChannels []}
:minBitrateType ""
:name ""
:twoFourGhzSettings {:axEnabled false
:maxPower 0
:minBitrate ""
:minPower 0
:rxsop 0
:validAutoChannels []}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/wireless/rfProfiles"),
Content = new StringContent("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/rfProfiles");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
payload := strings.NewReader("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/wireless/rfProfiles HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 505
{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.setHeader("content-type", "application/json")
.setBody("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/rfProfiles"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.header("content-type", "application/json")
.body("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
.asString();
const data = JSON.stringify({
apBandSettings: {
bandOperationMode: '',
bandSteeringEnabled: false
},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles',
headers: {'content-type': 'application/json'},
data: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"apBandSettings":{"bandOperationMode":"","bandSteeringEnabled":false},"bandSelectionType":"","clientBalancingEnabled":false,"fiveGhzSettings":{"channelWidth":"","maxPower":0,"minBitrate":0,"minPower":0,"rxsop":0,"validAutoChannels":[]},"minBitrateType":"","name":"","twoFourGhzSettings":{"axEnabled":false,"maxPower":0,"minBitrate":"","minPower":0,"rxsop":0,"validAutoChannels":[]}}'
};
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}}/networks/:networkId/wireless/rfProfiles',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "apBandSettings": {\n "bandOperationMode": "",\n "bandSteeringEnabled": false\n },\n "bandSelectionType": "",\n "clientBalancingEnabled": false,\n "fiveGhzSettings": {\n "channelWidth": "",\n "maxPower": 0,\n "minBitrate": 0,\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n },\n "minBitrateType": "",\n "name": "",\n "twoFourGhzSettings": {\n "axEnabled": false,\n "maxPower": 0,\n "minBitrate": "",\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/rfProfiles',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles',
headers: {'content-type': 'application/json'},
body: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
apBandSettings: {
bandOperationMode: '',
bandSteeringEnabled: false
},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles',
headers: {'content-type': 'application/json'},
data: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"apBandSettings":{"bandOperationMode":"","bandSteeringEnabled":false},"bandSelectionType":"","clientBalancingEnabled":false,"fiveGhzSettings":{"channelWidth":"","maxPower":0,"minBitrate":0,"minPower":0,"rxsop":0,"validAutoChannels":[]},"minBitrateType":"","name":"","twoFourGhzSettings":{"axEnabled":false,"maxPower":0,"minBitrate":"","minPower":0,"rxsop":0,"validAutoChannels":[]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"apBandSettings": @{ @"bandOperationMode": @"", @"bandSteeringEnabled": @NO },
@"bandSelectionType": @"",
@"clientBalancingEnabled": @NO,
@"fiveGhzSettings": @{ @"channelWidth": @"", @"maxPower": @0, @"minBitrate": @0, @"minPower": @0, @"rxsop": @0, @"validAutoChannels": @[ ] },
@"minBitrateType": @"",
@"name": @"",
@"twoFourGhzSettings": @{ @"axEnabled": @NO, @"maxPower": @0, @"minBitrate": @"", @"minPower": @0, @"rxsop": @0, @"validAutoChannels": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/wireless/rfProfiles"]
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}}/networks/:networkId/wireless/rfProfiles" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/rfProfiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles', [
'body' => '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/wireless/rfProfiles", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
payload = {
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": False
},
"bandSelectionType": "",
"clientBalancingEnabled": False,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": False,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
payload <- "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/wireless/rfProfiles') do |req|
req.body = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles";
let payload = json!({
"apBandSettings": json!({
"bandOperationMode": "",
"bandSteeringEnabled": false
}),
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": json!({
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": ()
}),
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": json!({
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/wireless/rfProfiles \
--header 'content-type: application/json' \
--data '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
echo '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}' | \
http POST {{baseUrl}}/networks/:networkId/wireless/rfProfiles \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "apBandSettings": {\n "bandOperationMode": "",\n "bandSteeringEnabled": false\n },\n "bandSelectionType": "",\n "clientBalancingEnabled": false,\n "fiveGhzSettings": {\n "channelWidth": "",\n "maxPower": 0,\n "minBitrate": 0,\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n },\n "minBitrateType": "",\n "name": "",\n "twoFourGhzSettings": {\n "axEnabled": false,\n "maxPower": 0,\n "minBitrate": "",\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/rfProfiles
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"apBandSettings": [
"bandOperationMode": "",
"bandSteeringEnabled": false
],
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": [
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
],
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": [
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/rfProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"afcEnabled": true,
"apBandSettings": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true
},
"bandSelectionType": "ap",
"clientBalancingEnabled": true,
"fiveGhzSettings": {
"channelWidth": "auto",
"maxPower": 30,
"minBitrate": 12,
"minPower": 8,
"rxsop": null,
"validAutoChannels": [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144,
149,
153,
157,
161,
165
]
},
"id": "1234",
"minBitrateType": "band",
"name": "Some Custom RF Profile",
"networkId": "N_24329156",
"perSsidSettings": {
"0": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 0"
},
"1": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 1"
},
"2": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 2"
},
"3": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 3"
},
"4": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 4"
},
"5": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 5"
},
"6": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 6"
},
"7": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 7"
},
"8": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 8"
},
"9": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 9"
},
"10": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 10"
},
"11": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 11"
},
"12": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 12"
},
"13": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 13"
},
"14": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 14"
}
},
"transmission": {
"enabled": true
},
"twoFourGhzSettings": {
"axEnabled": true,
"maxPower": 30,
"minBitrate": 11,
"minPower": 5,
"rxsop": null,
"validAutoChannels": [
1,
6,
11
]
}
}
DELETE
Delete a RF Profile
{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
QUERY PARAMS
networkId
rfProfileId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
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/networks/:networkId/wireless/rfProfiles/:rfProfileId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"))
.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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId',
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"]
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId",
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
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/networks/:networkId/wireless/rfProfiles/:rfProfileId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId";
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
http DELETE {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")! 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
List the non-basic RF profiles for this network
{{baseUrl}}/networks/:networkId/wireless/rfProfiles
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/rfProfiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
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}}/networks/:networkId/wireless/rfProfiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/rfProfiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
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/networks/:networkId/wireless/rfProfiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/rfProfiles"))
.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}}/networks/:networkId/wireless/rfProfiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.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}}/networks/:networkId/wireless/rfProfiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles';
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}}/networks/:networkId/wireless/rfProfiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/rfProfiles',
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}}/networks/:networkId/wireless/rfProfiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
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}}/networks/:networkId/wireless/rfProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles';
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}}/networks/:networkId/wireless/rfProfiles"]
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}}/networks/:networkId/wireless/rfProfiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/rfProfiles",
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}}/networks/:networkId/wireless/rfProfiles');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/wireless/rfProfiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/rfProfiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/rfProfiles")
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/networks/:networkId/wireless/rfProfiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles";
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}}/networks/:networkId/wireless/rfProfiles
http GET {{baseUrl}}/networks/:networkId/wireless/rfProfiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/rfProfiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/rfProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"afcEnabled": true,
"apBandSettings": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true
},
"bandSelectionType": "ap",
"clientBalancingEnabled": true,
"fiveGhzSettings": {
"channelWidth": "auto",
"maxPower": 30,
"minBitrate": 12,
"minPower": 8,
"rxsop": null,
"validAutoChannels": [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144,
149,
153,
157,
161,
165
]
},
"id": "1234",
"minBitrateType": "band",
"name": "Some Custom RF Profile",
"networkId": "N_24329156",
"perSsidSettings": {
"0": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 0"
},
"1": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 1"
},
"2": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 2"
},
"3": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 3"
},
"4": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 4"
},
"5": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 5"
},
"6": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 6"
},
"7": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 7"
},
"8": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 8"
},
"9": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 9"
},
"10": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 10"
},
"11": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 11"
},
"12": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 12"
},
"13": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 13"
},
"14": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 14"
}
},
"transmission": {
"enabled": true
},
"twoFourGhzSettings": {
"axEnabled": true,
"maxPower": 30,
"minBitrate": 11,
"minPower": 5,
"rxsop": null,
"validAutoChannels": [
1,
6,
11
]
}
}
]
GET
Return a RF profile
{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
QUERY PARAMS
networkId
rfProfileId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
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/networks/:networkId/wireless/rfProfiles/:rfProfileId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"))
.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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId',
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"]
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId",
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
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/networks/:networkId/wireless/rfProfiles/:rfProfileId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId";
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
http GET {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"afcEnabled": true,
"apBandSettings": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true
},
"bandSelectionType": "ap",
"clientBalancingEnabled": true,
"fiveGhzSettings": {
"channelWidth": "auto",
"maxPower": 30,
"minBitrate": 12,
"minPower": 8,
"rxsop": null,
"validAutoChannels": [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144,
149,
153,
157,
161,
165
]
},
"id": "1234",
"minBitrateType": "band",
"name": "Some Custom RF Profile",
"networkId": "N_24329156",
"perSsidSettings": {
"0": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 0"
},
"1": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 1"
},
"2": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 2"
},
"3": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 3"
},
"4": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 4"
},
"5": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 5"
},
"6": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 6"
},
"7": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 7"
},
"8": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 8"
},
"9": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 9"
},
"10": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 10"
},
"11": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 11"
},
"12": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 12"
},
"13": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 13"
},
"14": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 14"
}
},
"transmission": {
"enabled": true
},
"twoFourGhzSettings": {
"axEnabled": true,
"maxPower": 30,
"minBitrate": 11,
"minPower": 5,
"rxsop": null,
"validAutoChannels": [
1,
6,
11
]
}
}
PUT
Updates specified RF profile for this network
{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
QUERY PARAMS
networkId
rfProfileId
BODY json
{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId" {:content-type :json
:form-params {:apBandSettings {:bandOperationMode ""
:bandSteeringEnabled false}
:bandSelectionType ""
:clientBalancingEnabled false
:fiveGhzSettings {:channelWidth ""
:maxPower 0
:minBitrate 0
:minPower 0
:rxsop 0
:validAutoChannels []}
:minBitrateType ""
:name ""
:twoFourGhzSettings {:axEnabled false
:maxPower 0
:minBitrate ""
:minPower 0
:rxsop 0
:validAutoChannels []}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"),
Content = new StringContent("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
payload := strings.NewReader("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 505
{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.setHeader("content-type", "application/json")
.setBody("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.header("content-type", "application/json")
.body("{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
.asString();
const data = JSON.stringify({
apBandSettings: {
bandOperationMode: '',
bandSteeringEnabled: false
},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
headers: {'content-type': 'application/json'},
data: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"apBandSettings":{"bandOperationMode":"","bandSteeringEnabled":false},"bandSelectionType":"","clientBalancingEnabled":false,"fiveGhzSettings":{"channelWidth":"","maxPower":0,"minBitrate":0,"minPower":0,"rxsop":0,"validAutoChannels":[]},"minBitrateType":"","name":"","twoFourGhzSettings":{"axEnabled":false,"maxPower":0,"minBitrate":"","minPower":0,"rxsop":0,"validAutoChannels":[]}}'
};
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}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "apBandSettings": {\n "bandOperationMode": "",\n "bandSteeringEnabled": false\n },\n "bandSelectionType": "",\n "clientBalancingEnabled": false,\n "fiveGhzSettings": {\n "channelWidth": "",\n "maxPower": 0,\n "minBitrate": 0,\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n },\n "minBitrateType": "",\n "name": "",\n "twoFourGhzSettings": {\n "axEnabled": false,\n "maxPower": 0,\n "minBitrate": "",\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
headers: {'content-type': 'application/json'},
body: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
apBandSettings: {
bandOperationMode: '',
bandSteeringEnabled: false
},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId',
headers: {'content-type': 'application/json'},
data: {
apBandSettings: {bandOperationMode: '', bandSteeringEnabled: false},
bandSelectionType: '',
clientBalancingEnabled: false,
fiveGhzSettings: {
channelWidth: '',
maxPower: 0,
minBitrate: 0,
minPower: 0,
rxsop: 0,
validAutoChannels: []
},
minBitrateType: '',
name: '',
twoFourGhzSettings: {
axEnabled: false,
maxPower: 0,
minBitrate: '',
minPower: 0,
rxsop: 0,
validAutoChannels: []
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"apBandSettings":{"bandOperationMode":"","bandSteeringEnabled":false},"bandSelectionType":"","clientBalancingEnabled":false,"fiveGhzSettings":{"channelWidth":"","maxPower":0,"minBitrate":0,"minPower":0,"rxsop":0,"validAutoChannels":[]},"minBitrateType":"","name":"","twoFourGhzSettings":{"axEnabled":false,"maxPower":0,"minBitrate":"","minPower":0,"rxsop":0,"validAutoChannels":[]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"apBandSettings": @{ @"bandOperationMode": @"", @"bandSteeringEnabled": @NO },
@"bandSelectionType": @"",
@"clientBalancingEnabled": @NO,
@"fiveGhzSettings": @{ @"channelWidth": @"", @"maxPower": @0, @"minBitrate": @0, @"minPower": @0, @"rxsop": @0, @"validAutoChannels": @[ ] },
@"minBitrateType": @"",
@"name": @"",
@"twoFourGhzSettings": @{ @"axEnabled": @NO, @"maxPower": @0, @"minBitrate": @"", @"minPower": @0, @"rxsop": @0, @"validAutoChannels": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId', [
'body' => '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'apBandSettings' => [
'bandOperationMode' => '',
'bandSteeringEnabled' => null
],
'bandSelectionType' => '',
'clientBalancingEnabled' => null,
'fiveGhzSettings' => [
'channelWidth' => '',
'maxPower' => 0,
'minBitrate' => 0,
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
],
'minBitrateType' => '',
'name' => '',
'twoFourGhzSettings' => [
'axEnabled' => null,
'maxPower' => 0,
'minBitrate' => '',
'minPower' => 0,
'rxsop' => 0,
'validAutoChannels' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
payload = {
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": False
},
"bandSelectionType": "",
"clientBalancingEnabled": False,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": False,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId"
payload <- "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/wireless/rfProfiles/:rfProfileId') do |req|
req.body = "{\n \"apBandSettings\": {\n \"bandOperationMode\": \"\",\n \"bandSteeringEnabled\": false\n },\n \"bandSelectionType\": \"\",\n \"clientBalancingEnabled\": false,\n \"fiveGhzSettings\": {\n \"channelWidth\": \"\",\n \"maxPower\": 0,\n \"minBitrate\": 0,\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n },\n \"minBitrateType\": \"\",\n \"name\": \"\",\n \"twoFourGhzSettings\": {\n \"axEnabled\": false,\n \"maxPower\": 0,\n \"minBitrate\": \"\",\n \"minPower\": 0,\n \"rxsop\": 0,\n \"validAutoChannels\": []\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId";
let payload = json!({
"apBandSettings": json!({
"bandOperationMode": "",
"bandSteeringEnabled": false
}),
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": json!({
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": ()
}),
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": json!({
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId \
--header 'content-type: application/json' \
--data '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}'
echo '{
"apBandSettings": {
"bandOperationMode": "",
"bandSteeringEnabled": false
},
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": {
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
},
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": {
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "apBandSettings": {\n "bandOperationMode": "",\n "bandSteeringEnabled": false\n },\n "bandSelectionType": "",\n "clientBalancingEnabled": false,\n "fiveGhzSettings": {\n "channelWidth": "",\n "maxPower": 0,\n "minBitrate": 0,\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n },\n "minBitrateType": "",\n "name": "",\n "twoFourGhzSettings": {\n "axEnabled": false,\n "maxPower": 0,\n "minBitrate": "",\n "minPower": 0,\n "rxsop": 0,\n "validAutoChannels": []\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"apBandSettings": [
"bandOperationMode": "",
"bandSteeringEnabled": false
],
"bandSelectionType": "",
"clientBalancingEnabled": false,
"fiveGhzSettings": [
"channelWidth": "",
"maxPower": 0,
"minBitrate": 0,
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
],
"minBitrateType": "",
"name": "",
"twoFourGhzSettings": [
"axEnabled": false,
"maxPower": 0,
"minBitrate": "",
"minPower": 0,
"rxsop": 0,
"validAutoChannels": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/rfProfiles/:rfProfileId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"afcEnabled": true,
"apBandSettings": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true
},
"bandSelectionType": "ap",
"clientBalancingEnabled": true,
"fiveGhzSettings": {
"channelWidth": "auto",
"maxPower": 30,
"minBitrate": 12,
"minPower": 8,
"rxsop": null,
"validAutoChannels": [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144,
149,
153,
157,
161,
165
]
},
"id": "1234",
"minBitrateType": "band",
"name": "Some Custom RF Profile",
"networkId": "N_24329156",
"perSsidSettings": {
"0": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 0"
},
"1": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 1"
},
"2": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 2"
},
"3": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 3"
},
"4": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 4"
},
"5": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 5"
},
"6": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 6"
},
"7": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 7"
},
"8": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 8"
},
"9": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 9"
},
"10": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 10"
},
"11": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 11"
},
"12": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 12"
},
"13": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 13"
},
"14": {
"bandOperationMode": "dual",
"bandSteeringEnabled": true,
"minBitrate": 11,
"name": "SSID 14"
}
},
"transmission": {
"enabled": true
},
"twoFourGhzSettings": {
"axEnabled": true,
"maxPower": 30,
"minBitrate": 11,
"minPower": 5,
"rxsop": null,
"validAutoChannels": [
1,
6,
11
]
}
}
POST
Create a SAML role
{{baseUrl}}/organizations/:organizationId/samlRoles
QUERY PARAMS
organizationId
BODY json
{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/samlRoles");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationId/samlRoles" {:content-type :json
:form-params {:networks [{:access ""
:id ""}]
:orgAccess ""
:role ""
:tags [{:access ""
:tag ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/samlRoles"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/samlRoles"),
Content = new StringContent("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/samlRoles");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/samlRoles"
payload := strings.NewReader("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/organizations/:organizationId/samlRoles HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 168
{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationId/samlRoles")
.setHeader("content-type", "application/json")
.setBody("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/samlRoles"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationId/samlRoles")
.header("content-type", "application/json")
.body("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
role: '',
tags: [
{
access: '',
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}}/organizations/:organizationId/samlRoles');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles',
headers: {'content-type': 'application/json'},
data: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"networks":[{"access":"","id":""}],"orgAccess":"","role":"","tags":[{"access":"","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}}/organizations/:organizationId/samlRoles',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "role": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/samlRoles',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles',
headers: {'content-type': 'application/json'},
body: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/organizations/:organizationId/samlRoles');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
role: '',
tags: [
{
access: '',
tag: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles',
headers: {'content-type': 'application/json'},
data: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"networks":[{"access":"","id":""}],"orgAccess":"","role":"","tags":[{"access":"","tag":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"networks": @[ @{ @"access": @"", @"id": @"" } ],
@"orgAccess": @"",
@"role": @"",
@"tags": @[ @{ @"access": @"", @"tag": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/samlRoles"]
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}}/organizations/:organizationId/samlRoles" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/samlRoles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/organizations/:organizationId/samlRoles', [
'body' => '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/samlRoles');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/samlRoles');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationId/samlRoles", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/samlRoles"
payload = {
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/samlRoles"
payload <- "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/samlRoles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/organizations/:organizationId/samlRoles') do |req|
req.body = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/samlRoles";
let payload = json!({
"networks": (
json!({
"access": "",
"id": ""
})
),
"orgAccess": "",
"role": "",
"tags": (
json!({
"access": "",
"tag": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/organizations/:organizationId/samlRoles \
--header 'content-type: application/json' \
--data '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
echo '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}' | \
http POST {{baseUrl}}/organizations/:organizationId/samlRoles \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "role": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/samlRoles
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"networks": [
[
"access": "",
"id": ""
]
],
"orgAccess": "",
"role": "",
"tags": [
[
"access": "",
"tag": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/samlRoles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "1284392014819",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"role": "myrole",
"tags": [
{
"access": "read-only",
"tag": "west"
}
]
}
GET
List the SAML roles for this organization
{{baseUrl}}/organizations/:organizationId/samlRoles
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/samlRoles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/samlRoles")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/samlRoles"
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}}/organizations/:organizationId/samlRoles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/samlRoles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/samlRoles"
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/organizations/:organizationId/samlRoles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/samlRoles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/samlRoles"))
.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}}/organizations/:organizationId/samlRoles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/samlRoles")
.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}}/organizations/:organizationId/samlRoles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles';
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}}/organizations/:organizationId/samlRoles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/samlRoles',
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}}/organizations/:organizationId/samlRoles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/samlRoles');
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}}/organizations/:organizationId/samlRoles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles';
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}}/organizations/:organizationId/samlRoles"]
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}}/organizations/:organizationId/samlRoles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/samlRoles",
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}}/organizations/:organizationId/samlRoles');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/samlRoles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/samlRoles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/samlRoles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/samlRoles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/samlRoles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/samlRoles")
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/organizations/:organizationId/samlRoles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/samlRoles";
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}}/organizations/:organizationId/samlRoles
http GET {{baseUrl}}/organizations/:organizationId/samlRoles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/samlRoles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/samlRoles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "1284392014819",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"role": "myrole",
"tags": [
{
"access": "read-only",
"tag": "west"
}
]
}
]
GET
Return a SAML role
{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId
QUERY PARAMS
organizationId
samlRoleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
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}}/organizations/:organizationId/samlRoles/:samlRoleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
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/organizations/:organizationId/samlRoles/:samlRoleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"))
.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}}/organizations/:organizationId/samlRoles/:samlRoleId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.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}}/organizations/:organizationId/samlRoles/:samlRoleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId';
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}}/organizations/:organizationId/samlRoles/:samlRoleId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/samlRoles/:samlRoleId',
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}}/organizations/:organizationId/samlRoles/:samlRoleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
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}}/organizations/:organizationId/samlRoles/:samlRoleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId';
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}}/organizations/:organizationId/samlRoles/:samlRoleId"]
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}}/organizations/:organizationId/samlRoles/:samlRoleId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId",
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}}/organizations/:organizationId/samlRoles/:samlRoleId');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/samlRoles/:samlRoleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
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/organizations/:organizationId/samlRoles/:samlRoleId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId";
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}}/organizations/:organizationId/samlRoles/:samlRoleId
http GET {{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "1284392014819",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"role": "myrole",
"tags": [
{
"access": "read-only",
"tag": "west"
}
]
}
PUT
Update a SAML role
{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId
QUERY PARAMS
organizationId
samlRoleId
BODY json
{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId" {:content-type :json
:form-params {:networks [{:access ""
:id ""}]
:orgAccess ""
:role ""
:tags [{:access ""
:tag ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"),
Content = new StringContent("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
payload := strings.NewReader("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/organizations/:organizationId/samlRoles/:samlRoleId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 168
{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.setHeader("content-type", "application/json")
.setBody("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.header("content-type", "application/json")
.body("{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
role: '',
tags: [
{
access: '',
tag: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId',
headers: {'content-type': 'application/json'},
data: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"networks":[{"access":"","id":""}],"orgAccess":"","role":"","tags":[{"access":"","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}}/organizations/:organizationId/samlRoles/:samlRoleId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "role": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/samlRoles/:samlRoleId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId',
headers: {'content-type': 'application/json'},
body: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
networks: [
{
access: '',
id: ''
}
],
orgAccess: '',
role: '',
tags: [
{
access: '',
tag: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId',
headers: {'content-type': 'application/json'},
data: {
networks: [{access: '', id: ''}],
orgAccess: '',
role: '',
tags: [{access: '', tag: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"networks":[{"access":"","id":""}],"orgAccess":"","role":"","tags":[{"access":"","tag":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"networks": @[ @{ @"access": @"", @"id": @"" } ],
@"orgAccess": @"",
@"role": @"",
@"tags": @[ @{ @"access": @"", @"tag": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId', [
'body' => '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'networks' => [
[
'access' => '',
'id' => ''
]
],
'orgAccess' => '',
'role' => '',
'tags' => [
[
'access' => '',
'tag' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationId/samlRoles/:samlRoleId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
payload = {
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId"
payload <- "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/organizations/:organizationId/samlRoles/:samlRoleId') do |req|
req.body = "{\n \"networks\": [\n {\n \"access\": \"\",\n \"id\": \"\"\n }\n ],\n \"orgAccess\": \"\",\n \"role\": \"\",\n \"tags\": [\n {\n \"access\": \"\",\n \"tag\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId";
let payload = json!({
"networks": (
json!({
"access": "",
"id": ""
})
),
"orgAccess": "",
"role": "",
"tags": (
json!({
"access": "",
"tag": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId \
--header 'content-type: application/json' \
--data '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}'
echo '{
"networks": [
{
"access": "",
"id": ""
}
],
"orgAccess": "",
"role": "",
"tags": [
{
"access": "",
"tag": ""
}
]
}' | \
http PUT {{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "networks": [\n {\n "access": "",\n "id": ""\n }\n ],\n "orgAccess": "",\n "role": "",\n "tags": [\n {\n "access": "",\n "tag": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"networks": [
[
"access": "",
"id": ""
]
],
"orgAccess": "",
"role": "",
"tags": [
[
"access": "",
"tag": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/samlRoles/:samlRoleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "1284392014819",
"networks": [
{
"access": "full",
"id": "N_24329156"
}
],
"orgAccess": "none",
"role": "myrole",
"tags": [
{
"access": "read-only",
"tag": "west"
}
]
}
GET
List the security events (intrusion detection only) for a network
{{baseUrl}}/networks/:networkId/securityEvents
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/securityEvents");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/securityEvents")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/securityEvents"
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}}/networks/:networkId/securityEvents"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/securityEvents");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/securityEvents"
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/networks/:networkId/securityEvents HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/securityEvents")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/securityEvents"))
.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}}/networks/:networkId/securityEvents")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/securityEvents")
.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}}/networks/:networkId/securityEvents');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/securityEvents'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/securityEvents';
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}}/networks/:networkId/securityEvents',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/securityEvents")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/securityEvents',
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}}/networks/:networkId/securityEvents'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/securityEvents');
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}}/networks/:networkId/securityEvents'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/securityEvents';
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}}/networks/:networkId/securityEvents"]
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}}/networks/:networkId/securityEvents" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/securityEvents",
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}}/networks/:networkId/securityEvents');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/securityEvents');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/securityEvents');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/securityEvents' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/securityEvents' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/securityEvents")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/securityEvents"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/securityEvents"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/securityEvents")
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/networks/:networkId/securityEvents') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/securityEvents";
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}}/networks/:networkId/securityEvents
http GET {{baseUrl}}/networks/:networkId/securityEvents
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/securityEvents
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/securityEvents")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"blocked": true,
"classification": "4",
"clientMac": "A1:B2:C3:D4:E5:F6",
"destIp": "10.20.30.40:80",
"deviceMac": "00:18:0a:01:02:03",
"message": "SERVER-WEBAPP JBoss JMX console access attempt",
"priority": "2",
"protocol": "tcp/ip",
"ruleId": "meraki:intrusion/snort/GID/1/SID/26267",
"sigSource": "",
"signature": "1:21516:9",
"srcIp": "1.2.3.4:34195",
"ts": 1547683314.270398
},
{
"blocked": true,
"classification": "33",
"clientMac": "A1:B2:C3:D4:E5:F6",
"destIp": "10.20.30.40:80",
"deviceMac": "00:18:0a:01:02:03",
"message": "POLICY-OTHER Adobe ColdFusion admin interface access attempt",
"priority": "1",
"protocol": "tcp/ip",
"ruleId": "meraki:intrusion/snort/GID/1/SID/26267",
"sigSource": "",
"signature": "1:25975:2",
"srcIp": "1.2.3.4:56023",
"ts": 1547683827.723265
}
]
GET
List the security events (intrusion detection only) for an organization
{{baseUrl}}/organizations/:organizationId/securityEvents
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/securityEvents");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/securityEvents")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/securityEvents"
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}}/organizations/:organizationId/securityEvents"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/securityEvents");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/securityEvents"
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/organizations/:organizationId/securityEvents HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/securityEvents")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/securityEvents"))
.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}}/organizations/:organizationId/securityEvents")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/securityEvents")
.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}}/organizations/:organizationId/securityEvents');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/securityEvents'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/securityEvents';
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}}/organizations/:organizationId/securityEvents',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/securityEvents")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/securityEvents',
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}}/organizations/:organizationId/securityEvents'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/securityEvents');
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}}/organizations/:organizationId/securityEvents'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/securityEvents';
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}}/organizations/:organizationId/securityEvents"]
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}}/organizations/:organizationId/securityEvents" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/securityEvents",
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}}/organizations/:organizationId/securityEvents');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/securityEvents');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/securityEvents');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/securityEvents' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/securityEvents' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/securityEvents")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/securityEvents"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/securityEvents"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/securityEvents")
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/organizations/:organizationId/securityEvents') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/securityEvents";
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}}/organizations/:organizationId/securityEvents
http GET {{baseUrl}}/organizations/:organizationId/securityEvents
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/securityEvents
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/securityEvents")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"blocked": true,
"classification": "4",
"clientMac": "A1:B2:C3:D4:E5:F6",
"destIp": "10.20.30.40:80",
"deviceMac": "00:18:0a:01:02:03",
"message": "SERVER-WEBAPP JBoss JMX console access attempt",
"priority": "2",
"protocol": "tcp/ip",
"ruleId": "meraki:intrusion/snort/GID/1/SID/26267",
"sigSource": "",
"signature": "1:21516:9",
"srcIp": "1.2.3.4:34195",
"ts": 1547683314.270398
},
{
"blocked": true,
"classification": "33",
"clientMac": "A1:B2:C3:D4:E5:F6",
"destIp": "10.20.30.40:80",
"deviceMac": "00:18:0a:01:02:03",
"message": "POLICY-OTHER Adobe ColdFusion admin interface access attempt",
"priority": "1",
"protocol": "tcp/ip",
"ruleId": "meraki:intrusion/snort/GID/1/SID/26267",
"sigSource": "",
"signature": "1:25975:2",
"srcIp": "1.2.3.4:56023",
"ts": 1547683827.723265
}
]
PUT
Add, delete, or update the tags of a set of devices
{{baseUrl}}/networks/:networkId/sm/devices/tags
QUERY PARAMS
networkId
BODY json
{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/devices/tags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/sm/devices/tags" {:content-type :json
:form-params {:ids ""
:scope ""
:serials ""
:tags ""
:updateAction ""
:wifiMacs ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/devices/tags"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/devices/tags"),
Content = new StringContent("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/devices/tags");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/devices/tags"
payload := strings.NewReader("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/sm/devices/tags HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 101
{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/sm/devices/tags")
.setHeader("content-type", "application/json")
.setBody("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/devices/tags"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices/tags")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/sm/devices/tags")
.header("content-type", "application/json")
.body("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}")
.asString();
const data = JSON.stringify({
ids: '',
scope: '',
serials: '',
tags: '',
updateAction: '',
wifiMacs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/tags');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/tags',
headers: {'content-type': 'application/json'},
data: {ids: '', scope: '', serials: '', tags: '', updateAction: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/devices/tags';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","scope":"","serials":"","tags":"","updateAction":"","wifiMacs":""}'
};
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}}/networks/:networkId/sm/devices/tags',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ids": "",\n "scope": "",\n "serials": "",\n "tags": "",\n "updateAction": "",\n "wifiMacs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices/tags")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/devices/tags',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ids: '', scope: '', serials: '', tags: '', updateAction: '', wifiMacs: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/tags',
headers: {'content-type': 'application/json'},
body: {ids: '', scope: '', serials: '', tags: '', updateAction: '', wifiMacs: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/tags');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ids: '',
scope: '',
serials: '',
tags: '',
updateAction: '',
wifiMacs: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/tags',
headers: {'content-type': 'application/json'},
data: {ids: '', scope: '', serials: '', tags: '', updateAction: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/devices/tags';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","scope":"","serials":"","tags":"","updateAction":"","wifiMacs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ids": @"",
@"scope": @"",
@"serials": @"",
@"tags": @"",
@"updateAction": @"",
@"wifiMacs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/devices/tags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/sm/devices/tags" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/devices/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'tags' => '',
'updateAction' => '',
'wifiMacs' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/tags', [
'body' => '{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/devices/tags');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'tags' => '',
'updateAction' => '',
'wifiMacs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'tags' => '',
'updateAction' => '',
'wifiMacs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/devices/tags');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/devices/tags' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/devices/tags' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/sm/devices/tags", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/devices/tags"
payload = {
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/devices/tags"
payload <- "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/devices/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/sm/devices/tags') do |req|
req.body = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"tags\": \"\",\n \"updateAction\": \"\",\n \"wifiMacs\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/devices/tags";
let payload = json!({
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/sm/devices/tags \
--header 'content-type: application/json' \
--data '{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}'
echo '{
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/sm/devices/tags \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ids": "",\n "scope": "",\n "serials": "",\n "tags": "",\n "updateAction": "",\n "wifiMacs": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/devices/tags
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ids": "",
"scope": "",
"serials": "",
"tags": "",
"updateAction": "",
"wifiMacs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/devices/tags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": [
{
"id": "1284392014819",
"serial": "F5XKHEBX",
"tags": [
"tag1",
"tag2"
],
"wifiMac": "00:11:22:33:44:55"
}
]
}
GET
Bypass activation lock attempt status
{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId
QUERY PARAMS
networkId
attemptId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"
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/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"))
.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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
.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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId';
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId',
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId');
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId';
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"]
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId",
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")
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/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId";
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}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId
http GET {{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts/:attemptId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"2090938209": {
"errors": [
"Activation lock bypass code not known for this device"
],
"success": false
},
"38290139892": {
"success": true
}
},
"id": "1234",
"status": "complete"
}
POST
Bypass activation lock attempt
{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts
QUERY PARAMS
networkId
BODY json
{
"ids": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ids\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts" {:content-type :json
:form-params {:ids []}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ids\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"),
Content = new StringContent("{\n \"ids\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ids\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"
payload := strings.NewReader("{\n \"ids\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/sm/bypassActivationLockAttempts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"ids": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")
.setHeader("content-type", "application/json")
.setBody("{\n \"ids\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ids\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ids\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")
.header("content-type", "application/json")
.body("{\n \"ids\": []\n}")
.asString();
const data = JSON.stringify({
ids: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts',
headers: {'content-type': 'application/json'},
data: {ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ids":[]}'
};
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}}/networks/:networkId/sm/bypassActivationLockAttempts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ids": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ids\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/bypassActivationLockAttempts',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ids: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts',
headers: {'content-type': 'application/json'},
body: {ids: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ids: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts',
headers: {'content-type': 'application/json'},
data: {ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ids":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ids": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"]
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}}/networks/:networkId/sm/bypassActivationLockAttempts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ids\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts', [
'body' => '{
"ids": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ids' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ids' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ids": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ids": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ids\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/sm/bypassActivationLockAttempts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"
payload = { "ids": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts"
payload <- "{\n \"ids\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ids\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/sm/bypassActivationLockAttempts') do |req|
req.body = "{\n \"ids\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts";
let payload = json!({"ids": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts \
--header 'content-type: application/json' \
--data '{
"ids": []
}'
echo '{
"ids": []
}' | \
http POST {{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ids": []\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ids": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/bypassActivationLockAttempts")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {},
"id": "1234",
"status": "pending"
}
PUT
Force check-in a set of devices
{{baseUrl}}/networks/:networkId/sm/devices/checkin
QUERY PARAMS
networkId
BODY json
{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/devices/checkin");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/sm/devices/checkin" {:content-type :json
:form-params {:ids ""
:scope ""
:serials ""
:wifiMacs ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/devices/checkin"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/devices/checkin"),
Content = new StringContent("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/devices/checkin");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/devices/checkin"
payload := strings.NewReader("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/sm/devices/checkin HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/sm/devices/checkin")
.setHeader("content-type", "application/json")
.setBody("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/devices/checkin"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices/checkin")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/sm/devices/checkin")
.header("content-type", "application/json")
.body("{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
.asString();
const data = JSON.stringify({
ids: '',
scope: '',
serials: '',
wifiMacs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/checkin');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/checkin',
headers: {'content-type': 'application/json'},
data: {ids: '', scope: '', serials: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/devices/checkin';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","scope":"","serials":"","wifiMacs":""}'
};
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}}/networks/:networkId/sm/devices/checkin',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ids": "",\n "scope": "",\n "serials": "",\n "wifiMacs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices/checkin")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/devices/checkin',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ids: '', scope: '', serials: '', wifiMacs: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/checkin',
headers: {'content-type': 'application/json'},
body: {ids: '', scope: '', serials: '', wifiMacs: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/checkin');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ids: '',
scope: '',
serials: '',
wifiMacs: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/devices/checkin',
headers: {'content-type': 'application/json'},
data: {ids: '', scope: '', serials: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/devices/checkin';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","scope":"","serials":"","wifiMacs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ids": @"",
@"scope": @"",
@"serials": @"",
@"wifiMacs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/devices/checkin"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/sm/devices/checkin" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/devices/checkin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/sm/devices/checkin', [
'body' => '{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/devices/checkin');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ids' => '',
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/devices/checkin');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/devices/checkin' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/devices/checkin' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/sm/devices/checkin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/devices/checkin"
payload = {
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/devices/checkin"
payload <- "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/devices/checkin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/sm/devices/checkin') do |req|
req.body = "{\n \"ids\": \"\",\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/devices/checkin";
let payload = json!({
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/sm/devices/checkin \
--header 'content-type: application/json' \
--data '{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}'
echo '{
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/sm/devices/checkin \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ids": "",\n "scope": "",\n "serials": "",\n "wifiMacs": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/devices/checkin
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ids": "",
"scope": "",
"serials": "",
"wifiMacs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/devices/checkin")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
GET
Get a list of softwares associated with a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares"
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}}/networks/:networkId/sm/:deviceId/softwares"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares"
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/networks/:networkId/sm/:deviceId/softwares HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares"))
.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}}/networks/:networkId/sm/:deviceId/softwares")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")
.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}}/networks/:networkId/sm/:deviceId/softwares');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares';
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}}/networks/:networkId/sm/:deviceId/softwares',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/softwares',
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}}/networks/:networkId/sm/:deviceId/softwares'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares');
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}}/networks/:networkId/sm/:deviceId/softwares'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares';
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}}/networks/:networkId/sm/:deviceId/softwares"]
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}}/networks/:networkId/sm/:deviceId/softwares" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares",
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}}/networks/:networkId/sm/:deviceId/softwares');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/softwares")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")
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/networks/:networkId/sm/:deviceId/softwares') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares";
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}}/networks/:networkId/sm/:deviceId/softwares
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/softwares
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/softwares
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/softwares")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"appId": "1234",
"bundleSize": null,
"createdAt": "2018-02-11T00:00:00Z",
"deviceId": "1234",
"dynamicSize": null,
"id": "1284392014819",
"identifier": "com.test.app",
"installedAt": "2018-05-12T00:00:00Z",
"iosRedemptionCode": null,
"isManaged": true,
"itunesId": null,
"licenseKey": null,
"name": "My app",
"path": "/Path/to/app.app",
"redemptionCode": null,
"shortVersion": null,
"status": null,
"toInstall": null,
"toUninstall": false,
"uninstalledAt": null,
"updatedAt": "2018-05-12T00:00:00Z",
"vendor": "Apple",
"version": "0.1"
}
]
GET
Get a list of softwares associated with a user
{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares
QUERY PARAMS
networkId
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares"
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}}/networks/:networkId/sm/user/:userId/softwares"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares"
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/networks/:networkId/sm/user/:userId/softwares HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares"))
.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}}/networks/:networkId/sm/user/:userId/softwares")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")
.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}}/networks/:networkId/sm/user/:userId/softwares');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares';
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}}/networks/:networkId/sm/user/:userId/softwares',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/user/:userId/softwares',
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}}/networks/:networkId/sm/user/:userId/softwares'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares');
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}}/networks/:networkId/sm/user/:userId/softwares'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares';
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}}/networks/:networkId/sm/user/:userId/softwares"]
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}}/networks/:networkId/sm/user/:userId/softwares" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares",
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}}/networks/:networkId/sm/user/:userId/softwares');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/user/:userId/softwares")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")
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/networks/:networkId/sm/user/:userId/softwares') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares";
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}}/networks/:networkId/sm/user/:userId/softwares
http GET {{baseUrl}}/networks/:networkId/sm/user/:userId/softwares
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/user/:userId/softwares
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/user/:userId/softwares")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"appId": "1234",
"bundleSize": null,
"createdAt": "2018-02-11T00:00:00Z",
"deviceId": "1234",
"dynamicSize": null,
"id": "1284392014819",
"identifier": "com.test.app",
"installedAt": "2018-05-12T00:00:00Z",
"iosRedemptionCode": null,
"isManaged": true,
"itunesId": null,
"licenseKey": null,
"name": "My app",
"path": "/Path/to/app.app",
"redemptionCode": null,
"shortVersion": null,
"status": null,
"toInstall": null,
"toUninstall": false,
"uninstalledAt": null,
"updatedAt": "2018-05-12T00:00:00Z",
"vendor": "Apple",
"version": "0.1"
}
]
GET
Get the profiles associated with a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles"
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}}/networks/:networkId/sm/:deviceId/deviceProfiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles"
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/networks/:networkId/sm/:deviceId/deviceProfiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles"))
.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}}/networks/:networkId/sm/:deviceId/deviceProfiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")
.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}}/networks/:networkId/sm/:deviceId/deviceProfiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles';
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}}/networks/:networkId/sm/:deviceId/deviceProfiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/deviceProfiles',
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}}/networks/:networkId/sm/:deviceId/deviceProfiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles');
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}}/networks/:networkId/sm/:deviceId/deviceProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles';
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}}/networks/:networkId/sm/:deviceId/deviceProfiles"]
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}}/networks/:networkId/sm/:deviceId/deviceProfiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles",
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}}/networks/:networkId/sm/:deviceId/deviceProfiles');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/deviceProfiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")
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/networks/:networkId/sm/:deviceId/deviceProfiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles";
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}}/networks/:networkId/sm/:deviceId/deviceProfiles
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/deviceProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"deviceId": "1234",
"id": "1284392014819",
"isEncrypted": true,
"isManaged": true,
"name": "My profile",
"profileData": "{}",
"profileIdentifier": "com.test.app",
"version": "0.0.1"
}
]
GET
Get the profiles associated with a user
{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles
QUERY PARAMS
networkId
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles"
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}}/networks/:networkId/sm/user/:userId/deviceProfiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles"
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/networks/:networkId/sm/user/:userId/deviceProfiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles"))
.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}}/networks/:networkId/sm/user/:userId/deviceProfiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")
.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}}/networks/:networkId/sm/user/:userId/deviceProfiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles';
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}}/networks/:networkId/sm/user/:userId/deviceProfiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/user/:userId/deviceProfiles',
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}}/networks/:networkId/sm/user/:userId/deviceProfiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles');
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}}/networks/:networkId/sm/user/:userId/deviceProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles';
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}}/networks/:networkId/sm/user/:userId/deviceProfiles"]
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}}/networks/:networkId/sm/user/:userId/deviceProfiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles",
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}}/networks/:networkId/sm/user/:userId/deviceProfiles');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/user/:userId/deviceProfiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")
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/networks/:networkId/sm/user/:userId/deviceProfiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles";
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}}/networks/:networkId/sm/user/:userId/deviceProfiles
http GET {{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/user/:userId/deviceProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"deviceId": "1234",
"id": "1284392014819",
"isEncrypted": true,
"isManaged": true,
"name": "My profile",
"profileData": "{}",
"profileIdentifier": "com.test.app",
"version": "0.0.1"
}
]
GET
List all the profiles in the network
{{baseUrl}}/networks/:networkId/sm/profiles
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/profiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/profiles")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/profiles"
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}}/networks/:networkId/sm/profiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/profiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/profiles"
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/networks/:networkId/sm/profiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/profiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/profiles"))
.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}}/networks/:networkId/sm/profiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/profiles")
.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}}/networks/:networkId/sm/profiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/profiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/profiles';
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}}/networks/:networkId/sm/profiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/profiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/profiles',
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}}/networks/:networkId/sm/profiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/profiles');
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}}/networks/:networkId/sm/profiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/profiles';
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}}/networks/:networkId/sm/profiles"]
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}}/networks/:networkId/sm/profiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/profiles",
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}}/networks/:networkId/sm/profiles');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/profiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/profiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/profiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/profiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/profiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/profiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/profiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/profiles")
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/networks/:networkId/sm/profiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/profiles";
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}}/networks/:networkId/sm/profiles
http GET {{baseUrl}}/networks/:networkId/sm/profiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/profiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/profiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"profiles": [
{
"id": "1234",
"payload_description": "API docs test",
"payload_display_name": "API Profile",
"payload_identifier": "com.meraki.sm.1",
"payload_types": [
"Privacy",
"Document"
],
"scope": "some",
"tags": [
"tag1",
"tag2"
],
"wifis": []
}
]
}
GET
List the certs on a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/certs
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs"
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}}/networks/:networkId/sm/:deviceId/certs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/certs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs"
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/networks/:networkId/sm/:deviceId/certs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/certs"))
.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}}/networks/:networkId/sm/:deviceId/certs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")
.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}}/networks/:networkId/sm/:deviceId/certs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs';
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}}/networks/:networkId/sm/:deviceId/certs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/certs',
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}}/networks/:networkId/sm/:deviceId/certs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs');
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}}/networks/:networkId/sm/:deviceId/certs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs';
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}}/networks/:networkId/sm/:deviceId/certs"]
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}}/networks/:networkId/sm/:deviceId/certs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/certs",
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}}/networks/:networkId/sm/:deviceId/certs');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/certs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/certs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/certs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/certs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")
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/networks/:networkId/sm/:deviceId/certs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs";
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}}/networks/:networkId/sm/:deviceId/certs
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/certs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/certs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/certs")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"certPem": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"deviceId": "1234",
"id": "15",
"issuer": "",
"name": "My Cert",
"notValidAfter": "May 12, 2018",
"notValidBefore": "Feb 11, 2018",
"subject": ""
}
]
GET
List the devices enrolled in an SM network with various specified fields and filters
{{baseUrl}}/networks/:networkId/sm/devices
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/devices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/devices")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/devices"
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}}/networks/:networkId/sm/devices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/devices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/devices"
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/networks/:networkId/sm/devices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/devices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/devices"))
.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}}/networks/:networkId/sm/devices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/devices")
.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}}/networks/:networkId/sm/devices');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/devices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/devices';
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}}/networks/:networkId/sm/devices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/devices',
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}}/networks/:networkId/sm/devices'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/devices');
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}}/networks/:networkId/sm/devices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/devices';
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}}/networks/:networkId/sm/devices"]
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}}/networks/:networkId/sm/devices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/devices",
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}}/networks/:networkId/sm/devices');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/devices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/devices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/devices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/devices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/devices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/devices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/devices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/devices")
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/networks/:networkId/sm/devices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/devices";
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}}/networks/:networkId/sm/devices
http GET {{baseUrl}}/networks/:networkId/sm/devices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/devices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/devices")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"batchToken": "MMbCbpHZtG3TKUCr9B9uc5",
"devices": [
{
"id": "1284392014819",
"ip": "1.2.3.4",
"name": "Miles's phone",
"osName": "iOS 9.3.5",
"serialNumber": "F5XKHEBX",
"ssid": "My SSID",
"systemModel": "iPhone",
"tags": [
"tag1",
"tag2"
],
"uuid": "3d990628ede4c628d52",
"wifiMac": "00:11:22:33:44:55"
}
]
}
GET
List the network adapters of a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters"
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}}/networks/:networkId/sm/:deviceId/networkAdapters"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters"
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/networks/:networkId/sm/:deviceId/networkAdapters HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters"))
.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}}/networks/:networkId/sm/:deviceId/networkAdapters")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")
.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}}/networks/:networkId/sm/:deviceId/networkAdapters');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters';
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}}/networks/:networkId/sm/:deviceId/networkAdapters',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/networkAdapters',
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}}/networks/:networkId/sm/:deviceId/networkAdapters'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters');
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}}/networks/:networkId/sm/:deviceId/networkAdapters'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters';
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}}/networks/:networkId/sm/:deviceId/networkAdapters"]
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}}/networks/:networkId/sm/:deviceId/networkAdapters" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters",
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}}/networks/:networkId/sm/:deviceId/networkAdapters');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/networkAdapters")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")
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/networks/:networkId/sm/:deviceId/networkAdapters') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters";
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}}/networks/:networkId/sm/:deviceId/networkAdapters
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/networkAdapters")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"dhcpServer": "123.123.123.1",
"dnsServer": "8.8.8.8, 8.8.4.4",
"gateway": "1.2.3.5",
"id": "1284392014819",
"ip": "1.2.3.4",
"mac": "00:11:22:33:44:55",
"name": "en0",
"subnet": "255.255.255.0"
}
]
GET
List the owners in an SM network with various specified fields and filters
{{baseUrl}}/networks/:networkId/sm/users
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/users");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/users")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/users"
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}}/networks/:networkId/sm/users"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/users");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/users"
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/networks/:networkId/sm/users HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/users")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/users"))
.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}}/networks/:networkId/sm/users")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/users")
.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}}/networks/:networkId/sm/users');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/sm/users'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/users';
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}}/networks/:networkId/sm/users',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/users")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/users',
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}}/networks/:networkId/sm/users'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/users');
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}}/networks/:networkId/sm/users'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/users';
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}}/networks/:networkId/sm/users"]
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}}/networks/:networkId/sm/users" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/users",
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}}/networks/:networkId/sm/users');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/users');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/users');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/users' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/users' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/users")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/users"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/users"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/users")
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/networks/:networkId/sm/users') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/users";
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}}/networks/:networkId/sm/users
http GET {{baseUrl}}/networks/:networkId/sm/users
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/users
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/users")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"adGroups": [],
"asmGroups": [],
"azureAdGroups": [],
"displayName": "Miles Meraki ",
"email": "miles@meraki.com",
"fullName": "Miles Meraki",
"hasIdentityCertificate": false,
"hasPassword": false,
"id": "1234",
"isExternal": false,
"samlGroups": [],
"tags": [
"tag1",
"tag2"
],
"userThumbnail": "https://s3.amazonaws.com/image.extension",
"username": ""
}
]
GET
List the restrictions on a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions"
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}}/networks/:networkId/sm/:deviceId/restrictions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions"
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/networks/:networkId/sm/:deviceId/restrictions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions"))
.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}}/networks/:networkId/sm/:deviceId/restrictions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")
.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}}/networks/:networkId/sm/:deviceId/restrictions');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions';
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}}/networks/:networkId/sm/:deviceId/restrictions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/restrictions',
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}}/networks/:networkId/sm/:deviceId/restrictions'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions');
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}}/networks/:networkId/sm/:deviceId/restrictions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions';
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}}/networks/:networkId/sm/:deviceId/restrictions"]
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}}/networks/:networkId/sm/:deviceId/restrictions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions",
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}}/networks/:networkId/sm/:deviceId/restrictions');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/restrictions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")
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/networks/:networkId/sm/:deviceId/restrictions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions";
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}}/networks/:networkId/sm/:deviceId/restrictions
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/restrictions")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"profile": "com.meraki.sm.1",
"restrictions": {
"myRestriction": {
"value": true
}
}
}
]
GET
List the saved SSID names on a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists"
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}}/networks/:networkId/sm/:deviceId/wlanLists"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists"
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/networks/:networkId/sm/:deviceId/wlanLists HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists"))
.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}}/networks/:networkId/sm/:deviceId/wlanLists")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")
.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}}/networks/:networkId/sm/:deviceId/wlanLists');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists';
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}}/networks/:networkId/sm/:deviceId/wlanLists',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/wlanLists',
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}}/networks/:networkId/sm/:deviceId/wlanLists'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists');
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}}/networks/:networkId/sm/:deviceId/wlanLists'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists';
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}}/networks/:networkId/sm/:deviceId/wlanLists"]
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}}/networks/:networkId/sm/:deviceId/wlanLists" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists",
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}}/networks/:networkId/sm/:deviceId/wlanLists');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/wlanLists")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")
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/networks/:networkId/sm/:deviceId/wlanLists') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists";
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}}/networks/:networkId/sm/:deviceId/wlanLists
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/wlanLists")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"createdAt": "2018-02-11T00:00:00Z",
"id": "1284392014819",
"xml": "Preferred networks on en0:"
}
]
GET
List the security centers on a device
{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters"
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}}/networks/:networkId/sm/:deviceId/securityCenters"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters"
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/networks/:networkId/sm/:deviceId/securityCenters HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters"))
.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}}/networks/:networkId/sm/:deviceId/securityCenters")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")
.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}}/networks/:networkId/sm/:deviceId/securityCenters');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters';
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}}/networks/:networkId/sm/:deviceId/securityCenters',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/securityCenters',
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}}/networks/:networkId/sm/:deviceId/securityCenters'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters');
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}}/networks/:networkId/sm/:deviceId/securityCenters'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters';
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}}/networks/:networkId/sm/:deviceId/securityCenters"]
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}}/networks/:networkId/sm/:deviceId/securityCenters" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters",
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}}/networks/:networkId/sm/:deviceId/securityCenters');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/securityCenters")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")
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/networks/:networkId/sm/:deviceId/securityCenters') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters";
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}}/networks/:networkId/sm/:deviceId/securityCenters
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/securityCenters")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"antiVirusName": "meraki_av",
"fireWallName": "meraki_fw",
"hasAntiVirus": true,
"hasFireWallInstalled": true,
"id": "1284392014819",
"isAutoLoginDisabled": true,
"isDiskEncrypted": true,
"isFireWallEnabled": true,
"isRooted": true,
"runningProcs": "/software,/software_2"
}
]
PUT
Lock a set of devices
{{baseUrl}}/networks/:network_id/sm/devices/lock
QUERY PARAMS
network_id
BODY json
{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:network_id/sm/devices/lock");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:network_id/sm/devices/lock" {:content-type :json
:form-params {:ids ""
:pin 0
:scope ""
:serials ""
:wifiMacs ""}})
require "http/client"
url = "{{baseUrl}}/networks/:network_id/sm/devices/lock"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:network_id/sm/devices/lock"),
Content = new StringContent("{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:network_id/sm/devices/lock");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:network_id/sm/devices/lock"
payload := strings.NewReader("{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:network_id/sm/devices/lock HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 77
{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:network_id/sm/devices/lock")
.setHeader("content-type", "application/json")
.setBody("{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:network_id/sm/devices/lock"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/devices/lock")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:network_id/sm/devices/lock")
.header("content-type", "application/json")
.body("{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
.asString();
const data = JSON.stringify({
ids: '',
pin: 0,
scope: '',
serials: '',
wifiMacs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:network_id/sm/devices/lock');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:network_id/sm/devices/lock',
headers: {'content-type': 'application/json'},
data: {ids: '', pin: 0, scope: '', serials: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:network_id/sm/devices/lock';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","pin":0,"scope":"","serials":"","wifiMacs":""}'
};
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}}/networks/:network_id/sm/devices/lock',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ids": "",\n "pin": 0,\n "scope": "",\n "serials": "",\n "wifiMacs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/devices/lock")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:network_id/sm/devices/lock',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ids: '', pin: 0, scope: '', serials: '', wifiMacs: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:network_id/sm/devices/lock',
headers: {'content-type': 'application/json'},
body: {ids: '', pin: 0, scope: '', serials: '', wifiMacs: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:network_id/sm/devices/lock');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ids: '',
pin: 0,
scope: '',
serials: '',
wifiMacs: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:network_id/sm/devices/lock',
headers: {'content-type': 'application/json'},
data: {ids: '', pin: 0, scope: '', serials: '', wifiMacs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:network_id/sm/devices/lock';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ids":"","pin":0,"scope":"","serials":"","wifiMacs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ids": @"",
@"pin": @0,
@"scope": @"",
@"serials": @"",
@"wifiMacs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:network_id/sm/devices/lock"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:network_id/sm/devices/lock" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:network_id/sm/devices/lock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => '',
'pin' => 0,
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:network_id/sm/devices/lock', [
'body' => '{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:network_id/sm/devices/lock');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ids' => '',
'pin' => 0,
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ids' => '',
'pin' => 0,
'scope' => '',
'serials' => '',
'wifiMacs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:network_id/sm/devices/lock');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:network_id/sm/devices/lock' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:network_id/sm/devices/lock' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:network_id/sm/devices/lock", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:network_id/sm/devices/lock"
payload = {
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:network_id/sm/devices/lock"
payload <- "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:network_id/sm/devices/lock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:network_id/sm/devices/lock') do |req|
req.body = "{\n \"ids\": \"\",\n \"pin\": 0,\n \"scope\": \"\",\n \"serials\": \"\",\n \"wifiMacs\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:network_id/sm/devices/lock";
let payload = json!({
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:network_id/sm/devices/lock \
--header 'content-type: application/json' \
--data '{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}'
echo '{
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
}' | \
http PUT {{baseUrl}}/networks/:network_id/sm/devices/lock \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ids": "",\n "pin": 0,\n "scope": "",\n "serials": "",\n "wifiMacs": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:network_id/sm/devices/lock
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ids": "",
"pin": 0,
"scope": "",
"serials": "",
"wifiMacs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:network_id/sm/devices/lock")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
PUT
Modify the fields of a device
{{baseUrl}}/networks/:networkId/sm/device/fields
QUERY PARAMS
networkId
BODY json
{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/device/fields");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/sm/device/fields" {:content-type :json
:form-params {:deviceFields {:name ""
:notes ""}
:id ""
:serial ""
:wifiMac ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/device/fields"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/device/fields"),
Content = new StringContent("{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/device/fields");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/device/fields"
payload := strings.NewReader("{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/sm/device/fields HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 104
{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/sm/device/fields")
.setHeader("content-type", "application/json")
.setBody("{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/device/fields"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/device/fields")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/sm/device/fields")
.header("content-type", "application/json")
.body("{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
.asString();
const data = JSON.stringify({
deviceFields: {
name: '',
notes: ''
},
id: '',
serial: '',
wifiMac: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/sm/device/fields');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/fields',
headers: {'content-type': 'application/json'},
data: {deviceFields: {name: '', notes: ''}, id: '', serial: '', wifiMac: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/device/fields';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"deviceFields":{"name":"","notes":""},"id":"","serial":"","wifiMac":""}'
};
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}}/networks/:networkId/sm/device/fields',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "deviceFields": {\n "name": "",\n "notes": ""\n },\n "id": "",\n "serial": "",\n "wifiMac": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/device/fields")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/device/fields',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({deviceFields: {name: '', notes: ''}, id: '', serial: '', wifiMac: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/fields',
headers: {'content-type': 'application/json'},
body: {deviceFields: {name: '', notes: ''}, id: '', serial: '', wifiMac: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/sm/device/fields');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
deviceFields: {
name: '',
notes: ''
},
id: '',
serial: '',
wifiMac: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/fields',
headers: {'content-type': 'application/json'},
data: {deviceFields: {name: '', notes: ''}, id: '', serial: '', wifiMac: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/device/fields';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"deviceFields":{"name":"","notes":""},"id":"","serial":"","wifiMac":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"deviceFields": @{ @"name": @"", @"notes": @"" },
@"id": @"",
@"serial": @"",
@"wifiMac": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/device/fields"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/sm/device/fields" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/device/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'deviceFields' => [
'name' => '',
'notes' => ''
],
'id' => '',
'serial' => '',
'wifiMac' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/sm/device/fields', [
'body' => '{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/device/fields');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'deviceFields' => [
'name' => '',
'notes' => ''
],
'id' => '',
'serial' => '',
'wifiMac' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'deviceFields' => [
'name' => '',
'notes' => ''
],
'id' => '',
'serial' => '',
'wifiMac' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/device/fields');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/device/fields' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/device/fields' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/sm/device/fields", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/device/fields"
payload = {
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/device/fields"
payload <- "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/device/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/sm/device/fields') do |req|
req.body = "{\n \"deviceFields\": {\n \"name\": \"\",\n \"notes\": \"\"\n },\n \"id\": \"\",\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/device/fields";
let payload = json!({
"deviceFields": json!({
"name": "",
"notes": ""
}),
"id": "",
"serial": "",
"wifiMac": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/sm/device/fields \
--header 'content-type: application/json' \
--data '{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}'
echo '{
"deviceFields": {
"name": "",
"notes": ""
},
"id": "",
"serial": "",
"wifiMac": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/sm/device/fields \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "deviceFields": {\n "name": "",\n "notes": ""\n },\n "id": "",\n "serial": "",\n "wifiMac": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/device/fields
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"deviceFields": [
"name": "",
"notes": ""
],
"id": "",
"serial": "",
"wifiMac": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/device/fields")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": [
{
"id": "1284392014819",
"name": "Miles's phone",
"notes": "Here's some info about my device",
"serial": "F5XKHEBX",
"wifiMac": "00:11:22:33:44:55"
}
]
}
POST
Refresh the details of a device
{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/sm/device/:deviceId/refreshDetails HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"))
.method("POST", 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}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
.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('POST', '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails';
const options = {method: 'POST'};
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}}/networks/:networkId/sm/device/:deviceId/refreshDetails',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/device/:deviceId/refreshDetails',
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: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails';
const options = {method: 'POST'};
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}}/networks/:networkId/sm/device/:deviceId/refreshDetails"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/sm/device/:deviceId/refreshDetails" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/sm/device/:deviceId/refreshDetails")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/sm/device/:deviceId/refreshDetails') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails
http POST {{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/device/:deviceId/refreshDetails")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
Return historical records of commands sent to Systems Manager devices
{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs
QUERY PARAMS
network_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")
require "http/client"
url = "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs"
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}}/networks/:network_id/sm/:id/deviceCommandLogs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs"
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/networks/:network_id/sm/:id/deviceCommandLogs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs"))
.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}}/networks/:network_id/sm/:id/deviceCommandLogs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")
.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}}/networks/:network_id/sm/:id/deviceCommandLogs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs';
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}}/networks/:network_id/sm/:id/deviceCommandLogs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:network_id/sm/:id/deviceCommandLogs',
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}}/networks/:network_id/sm/:id/deviceCommandLogs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs');
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}}/networks/:network_id/sm/:id/deviceCommandLogs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs';
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}}/networks/:network_id/sm/:id/deviceCommandLogs"]
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}}/networks/:network_id/sm/:id/deviceCommandLogs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs",
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}}/networks/:network_id/sm/:id/deviceCommandLogs');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:network_id/sm/:id/deviceCommandLogs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")
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/networks/:network_id/sm/:id/deviceCommandLogs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs";
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}}/networks/:network_id/sm/:id/deviceCommandLogs
http GET {{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:network_id/sm/:id/deviceCommandLogs")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"action": "UpdateProfile",
"dashboardUser": "Miles Meraki",
"details": "{}",
"name": "My profile",
"ts": 1526087474
}
]
GET
Return historical records of various Systems Manager client metrics for desktop devices.
{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory
QUERY PARAMS
network_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")
require "http/client"
url = "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory"
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}}/networks/:network_id/sm/:id/performanceHistory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory"
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/networks/:network_id/sm/:id/performanceHistory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory"))
.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}}/networks/:network_id/sm/:id/performanceHistory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")
.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}}/networks/:network_id/sm/:id/performanceHistory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory';
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}}/networks/:network_id/sm/:id/performanceHistory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:network_id/sm/:id/performanceHistory',
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}}/networks/:network_id/sm/:id/performanceHistory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory');
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}}/networks/:network_id/sm/:id/performanceHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory';
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}}/networks/:network_id/sm/:id/performanceHistory"]
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}}/networks/:network_id/sm/:id/performanceHistory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory",
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}}/networks/:network_id/sm/:id/performanceHistory');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:network_id/sm/:id/performanceHistory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")
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/networks/:network_id/sm/:id/performanceHistory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory";
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}}/networks/:network_id/sm/:id/performanceHistory
http GET {{baseUrl}}/networks/:network_id/sm/:id/performanceHistory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:network_id/sm/:id/performanceHistory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:network_id/sm/:id/performanceHistory")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"cpuPercentUsed": 0.95,
"diskUsage": {
"c": {
"space": 9096,
"used": 2048
}
},
"memActive": 1024,
"memFree": 1024,
"memInactive": 2048,
"memWired": 4096,
"networkReceived": 512,
"networkSent": 512,
"swapUsed": 768,
"ts": 1526087474
}
]
GET
Return historical records of various Systems Manager network connection details for desktop devices.
{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs
QUERY PARAMS
network_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")
require "http/client"
url = "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs"
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}}/networks/:network_id/sm/:id/desktopLogs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs"
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/networks/:network_id/sm/:id/desktopLogs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs"))
.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}}/networks/:network_id/sm/:id/desktopLogs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")
.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}}/networks/:network_id/sm/:id/desktopLogs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs';
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}}/networks/:network_id/sm/:id/desktopLogs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:network_id/sm/:id/desktopLogs',
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}}/networks/:network_id/sm/:id/desktopLogs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs');
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}}/networks/:network_id/sm/:id/desktopLogs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs';
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}}/networks/:network_id/sm/:id/desktopLogs"]
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}}/networks/:network_id/sm/:id/desktopLogs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs",
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}}/networks/:network_id/sm/:id/desktopLogs');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:network_id/sm/:id/desktopLogs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")
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/networks/:network_id/sm/:id/desktopLogs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs";
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}}/networks/:network_id/sm/:id/desktopLogs
http GET {{baseUrl}}/networks/:network_id/sm/:id/desktopLogs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:network_id/sm/:id/desktopLogs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:network_id/sm/:id/desktopLogs")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"dhcpServer": "1.2.3.4",
"dnsServer": "8",
"gateway": "1.2.3.5",
"ip": "1.2.3.4",
"measuredAt": 1526087474,
"networkDevice": "NIC",
"networkDriver": "Driver",
"networkMTU": "1500",
"publicIP": "123.123.123.1",
"subnet": "192.168.1.0/24",
"ts": 1526087474,
"user": "milesmeraki",
"wifiAuth": "wpa-psk",
"wifiBssid": "00:11:22:33:44:55",
"wifiChannel": "11",
"wifiNoise": "-99",
"wifiRssi": "-11",
"wifiSsid": "ssid"
}
]
GET
Return the client's daily cellular data usage history
{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"
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/networks/:networkId/sm/:deviceId/cellularUsageHistory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"))
.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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
.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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory';
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/:deviceId/cellularUsageHistory',
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory');
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory';
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"]
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory",
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/sm/:deviceId/cellularUsageHistory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")
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/networks/:networkId/sm/:deviceId/cellularUsageHistory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory";
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}}/networks/:networkId/sm/:deviceId/cellularUsageHistory
http GET {{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/:deviceId/cellularUsageHistory")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"received": 61,
"sent": 138,
"ts": 1526087474
}
]
GET
Returns historical connectivity data (whether a device is regularly checking in to Dashboard).
{{baseUrl}}/networks/:network_id/sm/:id/connectivity
QUERY PARAMS
network_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:network_id/sm/:id/connectivity");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:network_id/sm/:id/connectivity")
require "http/client"
url = "{{baseUrl}}/networks/:network_id/sm/:id/connectivity"
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}}/networks/:network_id/sm/:id/connectivity"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:network_id/sm/:id/connectivity");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:network_id/sm/:id/connectivity"
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/networks/:network_id/sm/:id/connectivity HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:network_id/sm/:id/connectivity")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:network_id/sm/:id/connectivity"))
.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}}/networks/:network_id/sm/:id/connectivity")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:network_id/sm/:id/connectivity")
.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}}/networks/:network_id/sm/:id/connectivity');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:network_id/sm/:id/connectivity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:network_id/sm/:id/connectivity';
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}}/networks/:network_id/sm/:id/connectivity',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:network_id/sm/:id/connectivity")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:network_id/sm/:id/connectivity',
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}}/networks/:network_id/sm/:id/connectivity'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:network_id/sm/:id/connectivity');
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}}/networks/:network_id/sm/:id/connectivity'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:network_id/sm/:id/connectivity';
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}}/networks/:network_id/sm/:id/connectivity"]
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}}/networks/:network_id/sm/:id/connectivity" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:network_id/sm/:id/connectivity",
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}}/networks/:network_id/sm/:id/connectivity');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:network_id/sm/:id/connectivity');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:network_id/sm/:id/connectivity');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:network_id/sm/:id/connectivity' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:network_id/sm/:id/connectivity' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:network_id/sm/:id/connectivity")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:network_id/sm/:id/connectivity"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:network_id/sm/:id/connectivity"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:network_id/sm/:id/connectivity")
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/networks/:network_id/sm/:id/connectivity') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:network_id/sm/:id/connectivity";
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}}/networks/:network_id/sm/:id/connectivity
http GET {{baseUrl}}/networks/:network_id/sm/:id/connectivity
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:network_id/sm/:id/connectivity
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:network_id/sm/:id/connectivity")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"firstSeenAt": 1518365681,
"lastSeenAt": 1526087474
}
]
POST
Unenroll a device
{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll
QUERY PARAMS
networkId
deviceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/sm/devices/:deviceId/unenroll HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"))
.method("POST", 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}}/networks/:networkId/sm/devices/:deviceId/unenroll")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")
.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('POST', '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll';
const options = {method: 'POST'};
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}}/networks/:networkId/sm/devices/:deviceId/unenroll',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/devices/:deviceId/unenroll',
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: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll';
const options = {method: 'POST'};
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}}/networks/:networkId/sm/devices/:deviceId/unenroll"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/networks/:networkId/sm/devices/:deviceId/unenroll" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/networks/:networkId/sm/devices/:deviceId/unenroll")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/networks/:networkId/sm/devices/:deviceId/unenroll') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll
http POST {{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/devices/:deviceId/unenroll")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
PUT
Wipe a device
{{baseUrl}}/networks/:networkId/sm/device/wipe
QUERY PARAMS
networkId
BODY json
{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/sm/device/wipe");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/sm/device/wipe" {:content-type :json
:form-params {:id ""
:pin 0
:serial ""
:wifiMac ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/sm/device/wipe"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/sm/device/wipe"),
Content = new StringContent("{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/sm/device/wipe");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/sm/device/wipe"
payload := strings.NewReader("{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/sm/device/wipe HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/sm/device/wipe")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/sm/device/wipe"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/device/wipe")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/sm/device/wipe")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
pin: 0,
serial: '',
wifiMac: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/sm/device/wipe');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/wipe',
headers: {'content-type': 'application/json'},
data: {id: '', pin: 0, serial: '', wifiMac: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/sm/device/wipe';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","pin":0,"serial":"","wifiMac":""}'
};
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}}/networks/:networkId/sm/device/wipe',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "pin": 0,\n "serial": "",\n "wifiMac": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/sm/device/wipe")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/sm/device/wipe',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: '', pin: 0, serial: '', wifiMac: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/wipe',
headers: {'content-type': 'application/json'},
body: {id: '', pin: 0, serial: '', wifiMac: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/sm/device/wipe');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
pin: 0,
serial: '',
wifiMac: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/sm/device/wipe',
headers: {'content-type': 'application/json'},
data: {id: '', pin: 0, serial: '', wifiMac: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/sm/device/wipe';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","pin":0,"serial":"","wifiMac":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"",
@"pin": @0,
@"serial": @"",
@"wifiMac": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/sm/device/wipe"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/sm/device/wipe" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/sm/device/wipe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'pin' => 0,
'serial' => '',
'wifiMac' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/sm/device/wipe', [
'body' => '{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/sm/device/wipe');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'pin' => 0,
'serial' => '',
'wifiMac' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'pin' => 0,
'serial' => '',
'wifiMac' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/sm/device/wipe');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/sm/device/wipe' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/sm/device/wipe' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/sm/device/wipe", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/sm/device/wipe"
payload = {
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/sm/device/wipe"
payload <- "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/sm/device/wipe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/sm/device/wipe') do |req|
req.body = "{\n \"id\": \"\",\n \"pin\": 0,\n \"serial\": \"\",\n \"wifiMac\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/sm/device/wipe";
let payload = json!({
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/sm/device/wipe \
--header 'content-type: application/json' \
--data '{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}'
echo '{
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/sm/device/wipe \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "pin": 0,\n "serial": "",\n "wifiMac": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/sm/device/wipe
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"pin": 0,
"serial": "",
"wifiMac": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/sm/device/wipe")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": true
}
GET
Return the SNMP settings for a network
{{baseUrl}}/networks/:networkId/snmpSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/snmpSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/snmpSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/snmpSettings"
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}}/networks/:networkId/snmpSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/snmpSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/snmpSettings"
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/networks/:networkId/snmpSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/snmpSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/snmpSettings"))
.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}}/networks/:networkId/snmpSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/snmpSettings")
.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}}/networks/:networkId/snmpSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/snmpSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/snmpSettings';
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}}/networks/:networkId/snmpSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/snmpSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/snmpSettings',
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}}/networks/:networkId/snmpSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/snmpSettings');
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}}/networks/:networkId/snmpSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/snmpSettings';
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}}/networks/:networkId/snmpSettings"]
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}}/networks/:networkId/snmpSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/snmpSettings",
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}}/networks/:networkId/snmpSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/snmpSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/snmpSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/snmpSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/snmpSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/snmpSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/snmpSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/snmpSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/snmpSettings")
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/networks/:networkId/snmpSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/snmpSettings";
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}}/networks/:networkId/snmpSettings
http GET {{baseUrl}}/networks/:networkId/snmpSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/snmpSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/snmpSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"access": "users",
"users": [
{
"passphrase": "hunter2",
"username": "AzureDiamond"
}
]
}
GET
Return the SNMP settings for an organization
{{baseUrl}}/organizations/:organizationId/snmp
QUERY PARAMS
organizationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/snmp");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/snmp")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/snmp"
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}}/organizations/:organizationId/snmp"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/snmp");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/snmp"
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/organizations/:organizationId/snmp HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/snmp")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/snmp"))
.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}}/organizations/:organizationId/snmp")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/snmp")
.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}}/organizations/:organizationId/snmp');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/snmp'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/snmp';
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}}/organizations/:organizationId/snmp',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/snmp")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/snmp',
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}}/organizations/:organizationId/snmp'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/snmp');
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}}/organizations/:organizationId/snmp'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/snmp';
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}}/organizations/:organizationId/snmp"]
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}}/organizations/:organizationId/snmp" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/snmp",
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}}/organizations/:organizationId/snmp');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/snmp');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/snmp');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/snmp' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/snmp' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/snmp")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/snmp"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/snmp"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/snmp")
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/organizations/:organizationId/snmp') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/snmp";
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}}/organizations/:organizationId/snmp
http GET {{baseUrl}}/organizations/:organizationId/snmp
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/snmp
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/snmp")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hostname": "snmp.meraki.com",
"peerIps": "123.123.123.1",
"port": 443,
"v2cEnabled": false,
"v3AuthMode": "SHA",
"v3Enabled": true,
"v3PrivMode": "AES128"
}
GET
List the splash login attempts for a network
{{baseUrl}}/networks/:networkId/splashLoginAttempts
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/splashLoginAttempts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/splashLoginAttempts")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/splashLoginAttempts"
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}}/networks/:networkId/splashLoginAttempts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/splashLoginAttempts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/splashLoginAttempts"
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/networks/:networkId/splashLoginAttempts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/splashLoginAttempts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/splashLoginAttempts"))
.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}}/networks/:networkId/splashLoginAttempts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/splashLoginAttempts")
.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}}/networks/:networkId/splashLoginAttempts');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/splashLoginAttempts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/splashLoginAttempts';
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}}/networks/:networkId/splashLoginAttempts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/splashLoginAttempts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/splashLoginAttempts',
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}}/networks/:networkId/splashLoginAttempts'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/splashLoginAttempts');
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}}/networks/:networkId/splashLoginAttempts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/splashLoginAttempts';
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}}/networks/:networkId/splashLoginAttempts"]
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}}/networks/:networkId/splashLoginAttempts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/splashLoginAttempts",
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}}/networks/:networkId/splashLoginAttempts');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/splashLoginAttempts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/splashLoginAttempts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/splashLoginAttempts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/splashLoginAttempts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/splashLoginAttempts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/splashLoginAttempts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/splashLoginAttempts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/splashLoginAttempts")
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/networks/:networkId/splashLoginAttempts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/splashLoginAttempts";
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}}/networks/:networkId/splashLoginAttempts
http GET {{baseUrl}}/networks/:networkId/splashLoginAttempts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/splashLoginAttempts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/splashLoginAttempts")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"authorization": "success",
"clientId": "k74272e",
"clientMac": "22:33:44:55:66:77",
"gatewayDeviceMac": "00:11:22:33:44:55",
"login": "miles@meraki.com",
"loginAt": 1518365681,
"name": "Miles Meraki",
"ssid": "My SSID"
}
]
GET
Display the splash page settings for the given SSID
{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings
QUERY PARAMS
networkId
number
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
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}}/networks/:networkId/ssids/:number/splashSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
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/networks/:networkId/ssids/:number/splashSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"))
.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}}/networks/:networkId/ssids/:number/splashSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.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}}/networks/:networkId/ssids/:number/splashSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings';
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}}/networks/:networkId/ssids/:number/splashSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number/splashSettings',
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}}/networks/:networkId/ssids/:number/splashSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
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}}/networks/:networkId/ssids/:number/splashSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings';
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}}/networks/:networkId/ssids/:number/splashSettings"]
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}}/networks/:networkId/ssids/:number/splashSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings",
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}}/networks/:networkId/ssids/:number/splashSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/ssids/:number/splashSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
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/networks/:networkId/ssids/:number/splashSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings";
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}}/networks/:networkId/ssids/:number/splashSettings
http GET {{baseUrl}}/networks/:networkId/ssids/:number/splashSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number/splashSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"splashPage": "Click-through splash page",
"splashUrl": "https://www.custom_splash_url.com",
"ssidNumber": 0,
"useSplashUrl": true
}
PUT
Modify the splash page settings for the given SSID
{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings
QUERY PARAMS
networkId
number
BODY json
{
"splashUrl": "",
"useSplashUrl": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings" {:content-type :json
:form-params {:splashUrl ""
:useSplashUrl false}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"),
Content = new StringContent("{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
payload := strings.NewReader("{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/ssids/:number/splashSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"splashUrl": "",
"useSplashUrl": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.header("content-type", "application/json")
.body("{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}")
.asString();
const data = JSON.stringify({
splashUrl: '',
useSplashUrl: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings',
headers: {'content-type': 'application/json'},
data: {splashUrl: '', useSplashUrl: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"splashUrl":"","useSplashUrl":false}'
};
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}}/networks/:networkId/ssids/:number/splashSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "splashUrl": "",\n "useSplashUrl": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number/splashSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({splashUrl: '', useSplashUrl: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings',
headers: {'content-type': 'application/json'},
body: {splashUrl: '', useSplashUrl: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
splashUrl: '',
useSplashUrl: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings',
headers: {'content-type': 'application/json'},
data: {splashUrl: '', useSplashUrl: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"splashUrl":"","useSplashUrl":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"splashUrl": @"",
@"useSplashUrl": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'splashUrl' => '',
'useSplashUrl' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings', [
'body' => '{
"splashUrl": "",
"useSplashUrl": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'splashUrl' => '',
'useSplashUrl' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'splashUrl' => '',
'useSplashUrl' => null
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"splashUrl": "",
"useSplashUrl": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"splashUrl": "",
"useSplashUrl": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/ssids/:number/splashSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
payload = {
"splashUrl": "",
"useSplashUrl": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings"
payload <- "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/ssids/:number/splashSettings') do |req|
req.body = "{\n \"splashUrl\": \"\",\n \"useSplashUrl\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings";
let payload = json!({
"splashUrl": "",
"useSplashUrl": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/ssids/:number/splashSettings \
--header 'content-type: application/json' \
--data '{
"splashUrl": "",
"useSplashUrl": false
}'
echo '{
"splashUrl": "",
"useSplashUrl": false
}' | \
http PUT {{baseUrl}}/networks/:networkId/ssids/:number/splashSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "splashUrl": "",\n "useSplashUrl": false\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number/splashSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"splashUrl": "",
"useSplashUrl": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number/splashSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"splashPage": "Click-through splash page",
"splashUrl": "https://www.custom_splash_url.com",
"ssidNumber": 0,
"useSplashUrl": true
}
GET
List the SSIDs in a network
{{baseUrl}}/networks/:networkId/ssids
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/ssids")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids"
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}}/networks/:networkId/ssids"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids"
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/networks/:networkId/ssids HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/ssids")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids"))
.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}}/networks/:networkId/ssids")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/ssids")
.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}}/networks/:networkId/ssids');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/ssids'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids';
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}}/networks/:networkId/ssids',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids',
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}}/networks/:networkId/ssids'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/ssids');
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}}/networks/:networkId/ssids'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids';
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}}/networks/:networkId/ssids"]
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}}/networks/:networkId/ssids" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids",
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}}/networks/:networkId/ssids');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/ssids');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/ssids")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids")
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/networks/:networkId/ssids') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids";
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}}/networks/:networkId/ssids
http GET {{baseUrl}}/networks/:networkId/ssids
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"adminSplashUrl": "http://example.com",
"authMode": "8021x-radius",
"availabilityTags": [
"test-tag"
],
"availableOnAllAps": false,
"bandSelection": "5 GHz band only",
"enabled": true,
"encryptionMode": "wpa-eap",
"ipAssignmentMode": "NAT mode",
"minBitrate": 11,
"name": "My SSID",
"number": 0,
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"radiusAccountingEnabled": false,
"radiusAttributeForGroupPolicies": "Filter-Id",
"radiusEnabled": true,
"radiusFailoverPolicy": "null",
"radiusLoadBalancingPolicy": "null",
"radiusServers": [
{
"host": "0.0.0.0",
"port": 3000
}
],
"splashPage": "Click-through splash page",
"splashTimeout": "30 minutes",
"ssidAdminAccessible": false,
"visible": true,
"walledGardenEnabled": true,
"walledGardenRanges": "example.com",
"wpaEncryptionMode": "WPA2 only"
}
]
GET
Return a single SSID
{{baseUrl}}/networks/:networkId/ssids/:number
QUERY PARAMS
networkId
number
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/ssids/:number")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number"
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}}/networks/:networkId/ssids/:number"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number"
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/networks/:networkId/ssids/:number HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/ssids/:number")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number"))
.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}}/networks/:networkId/ssids/:number")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/ssids/:number")
.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}}/networks/:networkId/ssids/:number');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/ssids/:number'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number';
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}}/networks/:networkId/ssids/:number',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number',
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}}/networks/:networkId/ssids/:number'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/ssids/:number');
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}}/networks/:networkId/ssids/:number'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number';
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}}/networks/:networkId/ssids/:number"]
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}}/networks/:networkId/ssids/:number" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number",
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}}/networks/:networkId/ssids/:number');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/ssids/:number")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number")
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/networks/:networkId/ssids/:number') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number";
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}}/networks/:networkId/ssids/:number
http GET {{baseUrl}}/networks/:networkId/ssids/:number
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"adminSplashUrl": "http://example.com",
"authMode": "8021x-radius",
"availabilityTags": [
"test-tag"
],
"availableOnAllAps": false,
"bandSelection": "5 GHz band only",
"enabled": true,
"encryptionMode": "wpa-eap",
"ipAssignmentMode": "NAT mode",
"minBitrate": 11,
"name": "My SSID",
"number": 0,
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"radiusAccountingEnabled": false,
"radiusAttributeForGroupPolicies": "Filter-Id",
"radiusEnabled": true,
"radiusFailoverPolicy": "null",
"radiusLoadBalancingPolicy": "null",
"radiusServers": [
{
"host": "0.0.0.0",
"port": 3000
}
],
"splashPage": "Click-through splash page",
"splashTimeout": "30 minutes",
"ssidAdminAccessible": false,
"visible": true,
"walledGardenEnabled": true,
"walledGardenRanges": "example.com",
"wpaEncryptionMode": "WPA2 only"
}
GET
Return the SSID statuses of an access point
{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status"
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}}/networks/:networkId/devices/:serial/wireless/status"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status"
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/networks/:networkId/devices/:serial/wireless/status HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status"))
.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}}/networks/:networkId/devices/:serial/wireless/status")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")
.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}}/networks/:networkId/devices/:serial/wireless/status');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status';
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}}/networks/:networkId/devices/:serial/wireless/status',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/wireless/status',
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}}/networks/:networkId/devices/:serial/wireless/status'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status');
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}}/networks/:networkId/devices/:serial/wireless/status'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status';
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}}/networks/:networkId/devices/:serial/wireless/status"]
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}}/networks/:networkId/devices/:serial/wireless/status" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status",
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}}/networks/:networkId/devices/:serial/wireless/status');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/wireless/status")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")
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/networks/:networkId/devices/:serial/wireless/status') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status";
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}}/networks/:networkId/devices/:serial/wireless/status
http GET {{baseUrl}}/networks/:networkId/devices/:serial/wireless/status
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/wireless/status
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/wireless/status")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"basicServiceSets": [
{
"band": "2.4 GHz",
"broadcasting": true,
"bssid": "8A:15:04:00:00:00",
"channel": 11,
"channelWidth": "20 MHz",
"enabled": true,
"power": "18 dBm",
"ssidName": "My SSID",
"ssidNumber": 0,
"visible": true
},
{
"band": "5 GHz",
"broadcasting": true,
"bssid": "8A:15:14:00:00:00",
"channel": 64,
"channelWidth": "40 MHz",
"enabled": true,
"power": "18 dBm",
"ssidName": "My SSID",
"ssidNumber": 0,
"visible": true
},
{
"band": "6 GHz",
"broadcasting": true,
"bssid": "8A:15:24:00:00:00",
"channel": 145,
"channelWidth": "80 MHz",
"enabled": true,
"power": "18 dBm",
"ssidName": "My SSID",
"ssidNumber": 0,
"visible": true
}
]
}
PUT
Update the attributes of an SSID
{{baseUrl}}/networks/:networkId/ssids/:number
QUERY PARAMS
networkId
number
BODY json
{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/ssids/:number");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/ssids/:number" {:content-type :json
:form-params {:apTagsAndVlanIds [{:tags ""
:vlanId 0}]
:authMode ""
:availabilityTags []
:availableOnAllAps false
:bandSelection ""
:concentratorNetworkId ""
:defaultVlanId 0
:disassociateClientsOnVpnFailover false
:enabled false
:encryptionMode ""
:enterpriseAdminAccess ""
:ipAssignmentMode ""
:lanIsolationEnabled false
:minBitrate ""
:name ""
:perClientBandwidthLimitDown 0
:perClientBandwidthLimitUp 0
:psk ""
:radiusAccountingEnabled false
:radiusAccountingServers [{:host ""
:port 0
:secret ""}]
:radiusAttributeForGroupPolicies ""
:radiusCoaEnabled false
:radiusFailoverPolicy ""
:radiusLoadBalancingPolicy ""
:radiusOverride false
:radiusServers [{:host ""
:port 0
:secret ""}]
:secondaryConcentratorNetworkId ""
:splashPage ""
:useVlanTagging false
:visible false
:vlanId 0
:walledGardenEnabled false
:walledGardenRanges ""
:wpaEncryptionMode ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/ssids/:number"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/ssids/:number"),
Content = new StringContent("{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/ssids/:number");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/ssids/:number"
payload := strings.NewReader("{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/ssids/:number HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1125
{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/ssids/:number")
.setHeader("content-type", "application/json")
.setBody("{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/ssids/:number"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/ssids/:number")
.header("content-type", "application/json")
.body("{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}")
.asString();
const data = JSON.stringify({
apTagsAndVlanIds: [
{
tags: '',
vlanId: 0
}
],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [
{
host: '',
port: 0,
secret: ''
}
],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [
{
host: '',
port: 0,
secret: ''
}
],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number',
headers: {'content-type': 'application/json'},
data: {
apTagsAndVlanIds: [{tags: '', vlanId: 0}],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [{host: '', port: 0, secret: ''}],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [{host: '', port: 0, secret: ''}],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/ssids/:number';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"apTagsAndVlanIds":[{"tags":"","vlanId":0}],"authMode":"","availabilityTags":[],"availableOnAllAps":false,"bandSelection":"","concentratorNetworkId":"","defaultVlanId":0,"disassociateClientsOnVpnFailover":false,"enabled":false,"encryptionMode":"","enterpriseAdminAccess":"","ipAssignmentMode":"","lanIsolationEnabled":false,"minBitrate":"","name":"","perClientBandwidthLimitDown":0,"perClientBandwidthLimitUp":0,"psk":"","radiusAccountingEnabled":false,"radiusAccountingServers":[{"host":"","port":0,"secret":""}],"radiusAttributeForGroupPolicies":"","radiusCoaEnabled":false,"radiusFailoverPolicy":"","radiusLoadBalancingPolicy":"","radiusOverride":false,"radiusServers":[{"host":"","port":0,"secret":""}],"secondaryConcentratorNetworkId":"","splashPage":"","useVlanTagging":false,"visible":false,"vlanId":0,"walledGardenEnabled":false,"walledGardenRanges":"","wpaEncryptionMode":""}'
};
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}}/networks/:networkId/ssids/:number',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "apTagsAndVlanIds": [\n {\n "tags": "",\n "vlanId": 0\n }\n ],\n "authMode": "",\n "availabilityTags": [],\n "availableOnAllAps": false,\n "bandSelection": "",\n "concentratorNetworkId": "",\n "defaultVlanId": 0,\n "disassociateClientsOnVpnFailover": false,\n "enabled": false,\n "encryptionMode": "",\n "enterpriseAdminAccess": "",\n "ipAssignmentMode": "",\n "lanIsolationEnabled": false,\n "minBitrate": "",\n "name": "",\n "perClientBandwidthLimitDown": 0,\n "perClientBandwidthLimitUp": 0,\n "psk": "",\n "radiusAccountingEnabled": false,\n "radiusAccountingServers": [\n {\n "host": "",\n "port": 0,\n "secret": ""\n }\n ],\n "radiusAttributeForGroupPolicies": "",\n "radiusCoaEnabled": false,\n "radiusFailoverPolicy": "",\n "radiusLoadBalancingPolicy": "",\n "radiusOverride": false,\n "radiusServers": [\n {\n "host": "",\n "port": 0,\n "secret": ""\n }\n ],\n "secondaryConcentratorNetworkId": "",\n "splashPage": "",\n "useVlanTagging": false,\n "visible": false,\n "vlanId": 0,\n "walledGardenEnabled": false,\n "walledGardenRanges": "",\n "wpaEncryptionMode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/ssids/:number")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/ssids/:number',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
apTagsAndVlanIds: [{tags: '', vlanId: 0}],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [{host: '', port: 0, secret: ''}],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [{host: '', port: 0, secret: ''}],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number',
headers: {'content-type': 'application/json'},
body: {
apTagsAndVlanIds: [{tags: '', vlanId: 0}],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [{host: '', port: 0, secret: ''}],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [{host: '', port: 0, secret: ''}],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
apTagsAndVlanIds: [
{
tags: '',
vlanId: 0
}
],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [
{
host: '',
port: 0,
secret: ''
}
],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [
{
host: '',
port: 0,
secret: ''
}
],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/ssids/:number',
headers: {'content-type': 'application/json'},
data: {
apTagsAndVlanIds: [{tags: '', vlanId: 0}],
authMode: '',
availabilityTags: [],
availableOnAllAps: false,
bandSelection: '',
concentratorNetworkId: '',
defaultVlanId: 0,
disassociateClientsOnVpnFailover: false,
enabled: false,
encryptionMode: '',
enterpriseAdminAccess: '',
ipAssignmentMode: '',
lanIsolationEnabled: false,
minBitrate: '',
name: '',
perClientBandwidthLimitDown: 0,
perClientBandwidthLimitUp: 0,
psk: '',
radiusAccountingEnabled: false,
radiusAccountingServers: [{host: '', port: 0, secret: ''}],
radiusAttributeForGroupPolicies: '',
radiusCoaEnabled: false,
radiusFailoverPolicy: '',
radiusLoadBalancingPolicy: '',
radiusOverride: false,
radiusServers: [{host: '', port: 0, secret: ''}],
secondaryConcentratorNetworkId: '',
splashPage: '',
useVlanTagging: false,
visible: false,
vlanId: 0,
walledGardenEnabled: false,
walledGardenRanges: '',
wpaEncryptionMode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/ssids/:number';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"apTagsAndVlanIds":[{"tags":"","vlanId":0}],"authMode":"","availabilityTags":[],"availableOnAllAps":false,"bandSelection":"","concentratorNetworkId":"","defaultVlanId":0,"disassociateClientsOnVpnFailover":false,"enabled":false,"encryptionMode":"","enterpriseAdminAccess":"","ipAssignmentMode":"","lanIsolationEnabled":false,"minBitrate":"","name":"","perClientBandwidthLimitDown":0,"perClientBandwidthLimitUp":0,"psk":"","radiusAccountingEnabled":false,"radiusAccountingServers":[{"host":"","port":0,"secret":""}],"radiusAttributeForGroupPolicies":"","radiusCoaEnabled":false,"radiusFailoverPolicy":"","radiusLoadBalancingPolicy":"","radiusOverride":false,"radiusServers":[{"host":"","port":0,"secret":""}],"secondaryConcentratorNetworkId":"","splashPage":"","useVlanTagging":false,"visible":false,"vlanId":0,"walledGardenEnabled":false,"walledGardenRanges":"","wpaEncryptionMode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"apTagsAndVlanIds": @[ @{ @"tags": @"", @"vlanId": @0 } ],
@"authMode": @"",
@"availabilityTags": @[ ],
@"availableOnAllAps": @NO,
@"bandSelection": @"",
@"concentratorNetworkId": @"",
@"defaultVlanId": @0,
@"disassociateClientsOnVpnFailover": @NO,
@"enabled": @NO,
@"encryptionMode": @"",
@"enterpriseAdminAccess": @"",
@"ipAssignmentMode": @"",
@"lanIsolationEnabled": @NO,
@"minBitrate": @"",
@"name": @"",
@"perClientBandwidthLimitDown": @0,
@"perClientBandwidthLimitUp": @0,
@"psk": @"",
@"radiusAccountingEnabled": @NO,
@"radiusAccountingServers": @[ @{ @"host": @"", @"port": @0, @"secret": @"" } ],
@"radiusAttributeForGroupPolicies": @"",
@"radiusCoaEnabled": @NO,
@"radiusFailoverPolicy": @"",
@"radiusLoadBalancingPolicy": @"",
@"radiusOverride": @NO,
@"radiusServers": @[ @{ @"host": @"", @"port": @0, @"secret": @"" } ],
@"secondaryConcentratorNetworkId": @"",
@"splashPage": @"",
@"useVlanTagging": @NO,
@"visible": @NO,
@"vlanId": @0,
@"walledGardenEnabled": @NO,
@"walledGardenRanges": @"",
@"wpaEncryptionMode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/ssids/:number"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/ssids/:number" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/ssids/:number",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'apTagsAndVlanIds' => [
[
'tags' => '',
'vlanId' => 0
]
],
'authMode' => '',
'availabilityTags' => [
],
'availableOnAllAps' => null,
'bandSelection' => '',
'concentratorNetworkId' => '',
'defaultVlanId' => 0,
'disassociateClientsOnVpnFailover' => null,
'enabled' => null,
'encryptionMode' => '',
'enterpriseAdminAccess' => '',
'ipAssignmentMode' => '',
'lanIsolationEnabled' => null,
'minBitrate' => '',
'name' => '',
'perClientBandwidthLimitDown' => 0,
'perClientBandwidthLimitUp' => 0,
'psk' => '',
'radiusAccountingEnabled' => null,
'radiusAccountingServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'radiusAttributeForGroupPolicies' => '',
'radiusCoaEnabled' => null,
'radiusFailoverPolicy' => '',
'radiusLoadBalancingPolicy' => '',
'radiusOverride' => null,
'radiusServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'secondaryConcentratorNetworkId' => '',
'splashPage' => '',
'useVlanTagging' => null,
'visible' => null,
'vlanId' => 0,
'walledGardenEnabled' => null,
'walledGardenRanges' => '',
'wpaEncryptionMode' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/ssids/:number', [
'body' => '{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/ssids/:number');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'apTagsAndVlanIds' => [
[
'tags' => '',
'vlanId' => 0
]
],
'authMode' => '',
'availabilityTags' => [
],
'availableOnAllAps' => null,
'bandSelection' => '',
'concentratorNetworkId' => '',
'defaultVlanId' => 0,
'disassociateClientsOnVpnFailover' => null,
'enabled' => null,
'encryptionMode' => '',
'enterpriseAdminAccess' => '',
'ipAssignmentMode' => '',
'lanIsolationEnabled' => null,
'minBitrate' => '',
'name' => '',
'perClientBandwidthLimitDown' => 0,
'perClientBandwidthLimitUp' => 0,
'psk' => '',
'radiusAccountingEnabled' => null,
'radiusAccountingServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'radiusAttributeForGroupPolicies' => '',
'radiusCoaEnabled' => null,
'radiusFailoverPolicy' => '',
'radiusLoadBalancingPolicy' => '',
'radiusOverride' => null,
'radiusServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'secondaryConcentratorNetworkId' => '',
'splashPage' => '',
'useVlanTagging' => null,
'visible' => null,
'vlanId' => 0,
'walledGardenEnabled' => null,
'walledGardenRanges' => '',
'wpaEncryptionMode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'apTagsAndVlanIds' => [
[
'tags' => '',
'vlanId' => 0
]
],
'authMode' => '',
'availabilityTags' => [
],
'availableOnAllAps' => null,
'bandSelection' => '',
'concentratorNetworkId' => '',
'defaultVlanId' => 0,
'disassociateClientsOnVpnFailover' => null,
'enabled' => null,
'encryptionMode' => '',
'enterpriseAdminAccess' => '',
'ipAssignmentMode' => '',
'lanIsolationEnabled' => null,
'minBitrate' => '',
'name' => '',
'perClientBandwidthLimitDown' => 0,
'perClientBandwidthLimitUp' => 0,
'psk' => '',
'radiusAccountingEnabled' => null,
'radiusAccountingServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'radiusAttributeForGroupPolicies' => '',
'radiusCoaEnabled' => null,
'radiusFailoverPolicy' => '',
'radiusLoadBalancingPolicy' => '',
'radiusOverride' => null,
'radiusServers' => [
[
'host' => '',
'port' => 0,
'secret' => ''
]
],
'secondaryConcentratorNetworkId' => '',
'splashPage' => '',
'useVlanTagging' => null,
'visible' => null,
'vlanId' => 0,
'walledGardenEnabled' => null,
'walledGardenRanges' => '',
'wpaEncryptionMode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/ssids/:number');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/ssids/:number' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/ssids/:number' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/ssids/:number", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/ssids/:number"
payload = {
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": False,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": False,
"enabled": False,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": False,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": False,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": False,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": False,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": False,
"visible": False,
"vlanId": 0,
"walledGardenEnabled": False,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/ssids/:number"
payload <- "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/ssids/:number")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/ssids/:number') do |req|
req.body = "{\n \"apTagsAndVlanIds\": [\n {\n \"tags\": \"\",\n \"vlanId\": 0\n }\n ],\n \"authMode\": \"\",\n \"availabilityTags\": [],\n \"availableOnAllAps\": false,\n \"bandSelection\": \"\",\n \"concentratorNetworkId\": \"\",\n \"defaultVlanId\": 0,\n \"disassociateClientsOnVpnFailover\": false,\n \"enabled\": false,\n \"encryptionMode\": \"\",\n \"enterpriseAdminAccess\": \"\",\n \"ipAssignmentMode\": \"\",\n \"lanIsolationEnabled\": false,\n \"minBitrate\": \"\",\n \"name\": \"\",\n \"perClientBandwidthLimitDown\": 0,\n \"perClientBandwidthLimitUp\": 0,\n \"psk\": \"\",\n \"radiusAccountingEnabled\": false,\n \"radiusAccountingServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"radiusAttributeForGroupPolicies\": \"\",\n \"radiusCoaEnabled\": false,\n \"radiusFailoverPolicy\": \"\",\n \"radiusLoadBalancingPolicy\": \"\",\n \"radiusOverride\": false,\n \"radiusServers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"secret\": \"\"\n }\n ],\n \"secondaryConcentratorNetworkId\": \"\",\n \"splashPage\": \"\",\n \"useVlanTagging\": false,\n \"visible\": false,\n \"vlanId\": 0,\n \"walledGardenEnabled\": false,\n \"walledGardenRanges\": \"\",\n \"wpaEncryptionMode\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/ssids/:number";
let payload = json!({
"apTagsAndVlanIds": (
json!({
"tags": "",
"vlanId": 0
})
),
"authMode": "",
"availabilityTags": (),
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": (
json!({
"host": "",
"port": 0,
"secret": ""
})
),
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": (
json!({
"host": "",
"port": 0,
"secret": ""
})
),
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/ssids/:number \
--header 'content-type: application/json' \
--data '{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}'
echo '{
"apTagsAndVlanIds": [
{
"tags": "",
"vlanId": 0
}
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
{
"host": "",
"port": 0,
"secret": ""
}
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/ssids/:number \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "apTagsAndVlanIds": [\n {\n "tags": "",\n "vlanId": 0\n }\n ],\n "authMode": "",\n "availabilityTags": [],\n "availableOnAllAps": false,\n "bandSelection": "",\n "concentratorNetworkId": "",\n "defaultVlanId": 0,\n "disassociateClientsOnVpnFailover": false,\n "enabled": false,\n "encryptionMode": "",\n "enterpriseAdminAccess": "",\n "ipAssignmentMode": "",\n "lanIsolationEnabled": false,\n "minBitrate": "",\n "name": "",\n "perClientBandwidthLimitDown": 0,\n "perClientBandwidthLimitUp": 0,\n "psk": "",\n "radiusAccountingEnabled": false,\n "radiusAccountingServers": [\n {\n "host": "",\n "port": 0,\n "secret": ""\n }\n ],\n "radiusAttributeForGroupPolicies": "",\n "radiusCoaEnabled": false,\n "radiusFailoverPolicy": "",\n "radiusLoadBalancingPolicy": "",\n "radiusOverride": false,\n "radiusServers": [\n {\n "host": "",\n "port": 0,\n "secret": ""\n }\n ],\n "secondaryConcentratorNetworkId": "",\n "splashPage": "",\n "useVlanTagging": false,\n "visible": false,\n "vlanId": 0,\n "walledGardenEnabled": false,\n "walledGardenRanges": "",\n "wpaEncryptionMode": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/ssids/:number
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"apTagsAndVlanIds": [
[
"tags": "",
"vlanId": 0
]
],
"authMode": "",
"availabilityTags": [],
"availableOnAllAps": false,
"bandSelection": "",
"concentratorNetworkId": "",
"defaultVlanId": 0,
"disassociateClientsOnVpnFailover": false,
"enabled": false,
"encryptionMode": "",
"enterpriseAdminAccess": "",
"ipAssignmentMode": "",
"lanIsolationEnabled": false,
"minBitrate": "",
"name": "",
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"psk": "",
"radiusAccountingEnabled": false,
"radiusAccountingServers": [
[
"host": "",
"port": 0,
"secret": ""
]
],
"radiusAttributeForGroupPolicies": "",
"radiusCoaEnabled": false,
"radiusFailoverPolicy": "",
"radiusLoadBalancingPolicy": "",
"radiusOverride": false,
"radiusServers": [
[
"host": "",
"port": 0,
"secret": ""
]
],
"secondaryConcentratorNetworkId": "",
"splashPage": "",
"useVlanTagging": false,
"visible": false,
"vlanId": 0,
"walledGardenEnabled": false,
"walledGardenRanges": "",
"wpaEncryptionMode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/ssids/:number")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"adminSplashUrl": "http://example.com",
"authMode": "8021x-radius",
"availabilityTags": [
"test-tag"
],
"availableOnAllAps": false,
"bandSelection": "5 GHz band only",
"enabled": true,
"encryptionMode": "wpa-eap",
"ipAssignmentMode": "NAT mode",
"minBitrate": 11,
"name": "My SSID",
"number": 0,
"perClientBandwidthLimitDown": 0,
"perClientBandwidthLimitUp": 0,
"radiusAccountingEnabled": false,
"radiusAttributeForGroupPolicies": "Filter-Id",
"radiusEnabled": true,
"radiusFailoverPolicy": "null",
"radiusLoadBalancingPolicy": "null",
"radiusServers": [
{
"host": "0.0.0.0",
"port": 3000
}
],
"splashPage": "Click-through splash page",
"splashTimeout": "30 minutes",
"ssidAdminAccessible": false,
"visible": true,
"walledGardenEnabled": true,
"walledGardenRanges": "example.com",
"wpaEncryptionMode": "WPA2 only"
}
GET
List the access policies for this network
{{baseUrl}}/networks/:networkId/accessPolicies
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/accessPolicies");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/accessPolicies")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/accessPolicies"
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}}/networks/:networkId/accessPolicies"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/accessPolicies");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/accessPolicies"
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/networks/:networkId/accessPolicies HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/accessPolicies")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/accessPolicies"))
.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}}/networks/:networkId/accessPolicies")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/accessPolicies")
.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}}/networks/:networkId/accessPolicies');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/accessPolicies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/accessPolicies';
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}}/networks/:networkId/accessPolicies',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/accessPolicies")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/accessPolicies',
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}}/networks/:networkId/accessPolicies'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/accessPolicies');
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}}/networks/:networkId/accessPolicies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/accessPolicies';
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}}/networks/:networkId/accessPolicies"]
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}}/networks/:networkId/accessPolicies" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/accessPolicies",
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}}/networks/:networkId/accessPolicies');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/accessPolicies');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/accessPolicies');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/accessPolicies' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/accessPolicies' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/accessPolicies")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/accessPolicies"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/accessPolicies"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/accessPolicies")
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/networks/:networkId/accessPolicies') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/accessPolicies";
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}}/networks/:networkId/accessPolicies
http GET {{baseUrl}}/networks/:networkId/accessPolicies
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/accessPolicies
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/accessPolicies")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"accessType": "8021.x",
"guestVlan": 3700,
"name": "My access policy",
"number": 1,
"radiusServers": [
{
"ip": "1.2.3.4",
"port": 1337
},
{
"ip": "2.3.4.5",
"port": 1337
}
]
}
]
POST
Add a switch port schedule
{{baseUrl}}/networks/:networkId/switch/portSchedules
QUERY PARAMS
networkId
BODY json
{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/portSchedules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switch/portSchedules" {:content-type :json
:form-params {:name ""
:portSchedule {:friday {:active false
:from ""
:to ""}
:monday {:active false
:from ""
:to ""}
:saturday {:active false
:from ""
:to ""}
:sunday {:active false
:from ""
:to ""}
:thursday {:active false
:from ""
:to ""}
:tuesday {:active false
:from ""
:to ""}
:wednesday {:active false
:from ""
:to ""}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/portSchedules"),
Content = new StringContent("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/portSchedules");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/portSchedules"
payload := strings.NewReader("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switch/portSchedules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 601
{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switch/portSchedules")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/portSchedules"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switch/portSchedules")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
name: '',
portSchedule: {
friday: {
active: false,
from: '',
to: ''
},
monday: {
active: false,
from: '',
to: ''
},
saturday: {
active: false,
from: '',
to: ''
},
sunday: {
active: false,
from: '',
to: ''
},
thursday: {
active: false,
from: '',
to: ''
},
tuesday: {
active: false,
from: '',
to: ''
},
wednesday: {
active: false,
from: '',
to: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switch/portSchedules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules',
headers: {'content-type': 'application/json'},
data: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","portSchedule":{"friday":{"active":false,"from":"","to":""},"monday":{"active":false,"from":"","to":""},"saturday":{"active":false,"from":"","to":""},"sunday":{"active":false,"from":"","to":""},"thursday":{"active":false,"from":"","to":""},"tuesday":{"active":false,"from":"","to":""},"wednesday":{"active":false,"from":"","to":""}}}'
};
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}}/networks/:networkId/switch/portSchedules',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "portSchedule": {\n "friday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "monday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "saturday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "sunday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "thursday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "tuesday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "wednesday": {\n "active": false,\n "from": "",\n "to": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/portSchedules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules',
headers: {'content-type': 'application/json'},
body: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switch/portSchedules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
portSchedule: {
friday: {
active: false,
from: '',
to: ''
},
monday: {
active: false,
from: '',
to: ''
},
saturday: {
active: false,
from: '',
to: ''
},
sunday: {
active: false,
from: '',
to: ''
},
thursday: {
active: false,
from: '',
to: ''
},
tuesday: {
active: false,
from: '',
to: ''
},
wednesday: {
active: false,
from: '',
to: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules',
headers: {'content-type': 'application/json'},
data: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","portSchedule":{"friday":{"active":false,"from":"","to":""},"monday":{"active":false,"from":"","to":""},"saturday":{"active":false,"from":"","to":""},"sunday":{"active":false,"from":"","to":""},"thursday":{"active":false,"from":"","to":""},"tuesday":{"active":false,"from":"","to":""},"wednesday":{"active":false,"from":"","to":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"portSchedule": @{ @"friday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"monday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"saturday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"sunday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"thursday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"tuesday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"wednesday": @{ @"active": @NO, @"from": @"", @"to": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/portSchedules"]
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}}/networks/:networkId/switch/portSchedules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/portSchedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switch/portSchedules', [
'body' => '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switch/portSchedules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules"
payload = {
"name": "",
"portSchedule": {
"friday": {
"active": False,
"from": "",
"to": ""
},
"monday": {
"active": False,
"from": "",
"to": ""
},
"saturday": {
"active": False,
"from": "",
"to": ""
},
"sunday": {
"active": False,
"from": "",
"to": ""
},
"thursday": {
"active": False,
"from": "",
"to": ""
},
"tuesday": {
"active": False,
"from": "",
"to": ""
},
"wednesday": {
"active": False,
"from": "",
"to": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/portSchedules"
payload <- "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/portSchedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switch/portSchedules') do |req|
req.body = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/portSchedules";
let payload = json!({
"name": "",
"portSchedule": json!({
"friday": json!({
"active": false,
"from": "",
"to": ""
}),
"monday": json!({
"active": false,
"from": "",
"to": ""
}),
"saturday": json!({
"active": false,
"from": "",
"to": ""
}),
"sunday": json!({
"active": false,
"from": "",
"to": ""
}),
"thursday": json!({
"active": false,
"from": "",
"to": ""
}),
"tuesday": json!({
"active": false,
"from": "",
"to": ""
}),
"wednesday": json!({
"active": false,
"from": "",
"to": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switch/portSchedules \
--header 'content-type: application/json' \
--data '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
echo '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}' | \
http POST {{baseUrl}}/networks/:networkId/switch/portSchedules \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "portSchedule": {\n "friday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "monday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "saturday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "sunday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "thursday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "tuesday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "wednesday": {\n "active": false,\n "from": "",\n "to": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/portSchedules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"portSchedule": [
"friday": [
"active": false,
"from": "",
"to": ""
],
"monday": [
"active": false,
"from": "",
"to": ""
],
"saturday": [
"active": false,
"from": "",
"to": ""
],
"sunday": [
"active": false,
"from": "",
"to": ""
],
"thursday": [
"active": false,
"from": "",
"to": ""
],
"tuesday": [
"active": false,
"from": "",
"to": ""
],
"wednesday": [
"active": false,
"from": "",
"to": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/portSchedules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "1234",
"name": "Weekdays schedule",
"networkId": "N_24329156",
"portSchedule": {
"friday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"monday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"saturday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"sunday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"thursday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"tuesday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"wednesday": {
"active": true,
"from": "9:00",
"to": "17:00"
}
}
}
DELETE
Delete a switch port schedule
{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId
QUERY PARAMS
networkId
portScheduleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
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}}/networks/:networkId/switch/portSchedules/:portScheduleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
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/networks/:networkId/switch/portSchedules/:portScheduleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"))
.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}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.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}}/networks/:networkId/switch/portSchedules/:portScheduleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId';
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}}/networks/:networkId/switch/portSchedules/:portScheduleId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId',
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}}/networks/:networkId/switch/portSchedules/:portScheduleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
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}}/networks/:networkId/switch/portSchedules/:portScheduleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId';
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}}/networks/:networkId/switch/portSchedules/:portScheduleId"]
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}}/networks/:networkId/switch/portSchedules/:portScheduleId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId",
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}}/networks/:networkId/switch/portSchedules/:portScheduleId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
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/networks/:networkId/switch/portSchedules/:portScheduleId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId";
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}}/networks/:networkId/switch/portSchedules/:portScheduleId
http DELETE {{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")! 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
List switch port schedules
{{baseUrl}}/networks/:networkId/switch/portSchedules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/portSchedules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/portSchedules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules"
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}}/networks/:networkId/switch/portSchedules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/portSchedules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/portSchedules"
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/networks/:networkId/switch/portSchedules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/portSchedules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/portSchedules"))
.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}}/networks/:networkId/switch/portSchedules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/portSchedules")
.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}}/networks/:networkId/switch/portSchedules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules';
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}}/networks/:networkId/switch/portSchedules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/portSchedules',
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}}/networks/:networkId/switch/portSchedules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/portSchedules');
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}}/networks/:networkId/switch/portSchedules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules';
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}}/networks/:networkId/switch/portSchedules"]
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}}/networks/:networkId/switch/portSchedules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/portSchedules",
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}}/networks/:networkId/switch/portSchedules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/portSchedules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/portSchedules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/portSchedules")
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/networks/:networkId/switch/portSchedules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/portSchedules";
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}}/networks/:networkId/switch/portSchedules
http GET {{baseUrl}}/networks/:networkId/switch/portSchedules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/portSchedules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/portSchedules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "1234",
"name": "Weekdays schedule",
"networkId": "N_24329156",
"portSchedule": {
"friday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"monday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"saturday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"sunday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"thursday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"tuesday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"wednesday": {
"active": true,
"from": "9:00",
"to": "17:00"
}
}
}
]
PUT
Update a switch port schedule
{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId
QUERY PARAMS
networkId
portScheduleId
BODY json
{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId" {:content-type :json
:form-params {:name ""
:portSchedule {:friday {:active false
:from ""
:to ""}
:monday {:active false
:from ""
:to ""}
:saturday {:active false
:from ""
:to ""}
:sunday {:active false
:from ""
:to ""}
:thursday {:active false
:from ""
:to ""}
:tuesday {:active false
:from ""
:to ""}
:wednesday {:active false
:from ""
:to ""}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"),
Content = new StringContent("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
payload := strings.NewReader("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 601
{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
name: '',
portSchedule: {
friday: {
active: false,
from: '',
to: ''
},
monday: {
active: false,
from: '',
to: ''
},
saturday: {
active: false,
from: '',
to: ''
},
sunday: {
active: false,
from: '',
to: ''
},
thursday: {
active: false,
from: '',
to: ''
},
tuesday: {
active: false,
from: '',
to: ''
},
wednesday: {
active: false,
from: '',
to: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId',
headers: {'content-type': 'application/json'},
data: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","portSchedule":{"friday":{"active":false,"from":"","to":""},"monday":{"active":false,"from":"","to":""},"saturday":{"active":false,"from":"","to":""},"sunday":{"active":false,"from":"","to":""},"thursday":{"active":false,"from":"","to":""},"tuesday":{"active":false,"from":"","to":""},"wednesday":{"active":false,"from":"","to":""}}}'
};
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}}/networks/:networkId/switch/portSchedules/:portScheduleId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "portSchedule": {\n "friday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "monday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "saturday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "sunday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "thursday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "tuesday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "wednesday": {\n "active": false,\n "from": "",\n "to": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId',
headers: {'content-type': 'application/json'},
body: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
portSchedule: {
friday: {
active: false,
from: '',
to: ''
},
monday: {
active: false,
from: '',
to: ''
},
saturday: {
active: false,
from: '',
to: ''
},
sunday: {
active: false,
from: '',
to: ''
},
thursday: {
active: false,
from: '',
to: ''
},
tuesday: {
active: false,
from: '',
to: ''
},
wednesday: {
active: false,
from: '',
to: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId',
headers: {'content-type': 'application/json'},
data: {
name: '',
portSchedule: {
friday: {active: false, from: '', to: ''},
monday: {active: false, from: '', to: ''},
saturday: {active: false, from: '', to: ''},
sunday: {active: false, from: '', to: ''},
thursday: {active: false, from: '', to: ''},
tuesday: {active: false, from: '', to: ''},
wednesday: {active: false, from: '', to: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","portSchedule":{"friday":{"active":false,"from":"","to":""},"monday":{"active":false,"from":"","to":""},"saturday":{"active":false,"from":"","to":""},"sunday":{"active":false,"from":"","to":""},"thursday":{"active":false,"from":"","to":""},"tuesday":{"active":false,"from":"","to":""},"wednesday":{"active":false,"from":"","to":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"portSchedule": @{ @"friday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"monday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"saturday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"sunday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"thursday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"tuesday": @{ @"active": @NO, @"from": @"", @"to": @"" }, @"wednesday": @{ @"active": @NO, @"from": @"", @"to": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId', [
'body' => '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'portSchedule' => [
'friday' => [
'active' => null,
'from' => '',
'to' => ''
],
'monday' => [
'active' => null,
'from' => '',
'to' => ''
],
'saturday' => [
'active' => null,
'from' => '',
'to' => ''
],
'sunday' => [
'active' => null,
'from' => '',
'to' => ''
],
'thursday' => [
'active' => null,
'from' => '',
'to' => ''
],
'tuesday' => [
'active' => null,
'from' => '',
'to' => ''
],
'wednesday' => [
'active' => null,
'from' => '',
'to' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
payload = {
"name": "",
"portSchedule": {
"friday": {
"active": False,
"from": "",
"to": ""
},
"monday": {
"active": False,
"from": "",
"to": ""
},
"saturday": {
"active": False,
"from": "",
"to": ""
},
"sunday": {
"active": False,
"from": "",
"to": ""
},
"thursday": {
"active": False,
"from": "",
"to": ""
},
"tuesday": {
"active": False,
"from": "",
"to": ""
},
"wednesday": {
"active": False,
"from": "",
"to": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId"
payload <- "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/portSchedules/:portScheduleId') do |req|
req.body = "{\n \"name\": \"\",\n \"portSchedule\": {\n \"friday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"monday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"saturday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"sunday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"thursday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"tuesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n },\n \"wednesday\": {\n \"active\": false,\n \"from\": \"\",\n \"to\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId";
let payload = json!({
"name": "",
"portSchedule": json!({
"friday": json!({
"active": false,
"from": "",
"to": ""
}),
"monday": json!({
"active": false,
"from": "",
"to": ""
}),
"saturday": json!({
"active": false,
"from": "",
"to": ""
}),
"sunday": json!({
"active": false,
"from": "",
"to": ""
}),
"thursday": json!({
"active": false,
"from": "",
"to": ""
}),
"tuesday": json!({
"active": false,
"from": "",
"to": ""
}),
"wednesday": json!({
"active": false,
"from": "",
"to": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId \
--header 'content-type: application/json' \
--data '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}'
echo '{
"name": "",
"portSchedule": {
"friday": {
"active": false,
"from": "",
"to": ""
},
"monday": {
"active": false,
"from": "",
"to": ""
},
"saturday": {
"active": false,
"from": "",
"to": ""
},
"sunday": {
"active": false,
"from": "",
"to": ""
},
"thursday": {
"active": false,
"from": "",
"to": ""
},
"tuesday": {
"active": false,
"from": "",
"to": ""
},
"wednesday": {
"active": false,
"from": "",
"to": ""
}
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "portSchedule": {\n "friday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "monday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "saturday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "sunday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "thursday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "tuesday": {\n "active": false,\n "from": "",\n "to": ""\n },\n "wednesday": {\n "active": false,\n "from": "",\n "to": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"portSchedule": [
"friday": [
"active": false,
"from": "",
"to": ""
],
"monday": [
"active": false,
"from": "",
"to": ""
],
"saturday": [
"active": false,
"from": "",
"to": ""
],
"sunday": [
"active": false,
"from": "",
"to": ""
],
"thursday": [
"active": false,
"from": "",
"to": ""
],
"tuesday": [
"active": false,
"from": "",
"to": ""
],
"wednesday": [
"active": false,
"from": "",
"to": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/portSchedules/:portScheduleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "1234",
"name": "Weekdays schedule",
"networkId": "N_24329156",
"portSchedule": {
"friday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"monday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"saturday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"sunday": {
"active": false,
"from": "0:00",
"to": "24:00"
},
"thursday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"tuesday": {
"active": true,
"from": "9:00",
"to": "17:00"
},
"wednesday": {
"active": true,
"from": "9:00",
"to": "17:00"
}
}
}
GET
Return the packet counters for all the ports of a switch
{{baseUrl}}/devices/:serial/switchPortStatuses/packets
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/switchPortStatuses/packets");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/switchPortStatuses/packets")
require "http/client"
url = "{{baseUrl}}/devices/:serial/switchPortStatuses/packets"
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}}/devices/:serial/switchPortStatuses/packets"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/switchPortStatuses/packets");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/switchPortStatuses/packets"
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/devices/:serial/switchPortStatuses/packets HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/switchPortStatuses/packets")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/switchPortStatuses/packets"))
.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}}/devices/:serial/switchPortStatuses/packets")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/switchPortStatuses/packets")
.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}}/devices/:serial/switchPortStatuses/packets');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/switchPortStatuses/packets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/switchPortStatuses/packets';
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}}/devices/:serial/switchPortStatuses/packets',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/switchPortStatuses/packets")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/switchPortStatuses/packets',
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}}/devices/:serial/switchPortStatuses/packets'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/switchPortStatuses/packets');
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}}/devices/:serial/switchPortStatuses/packets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/switchPortStatuses/packets';
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}}/devices/:serial/switchPortStatuses/packets"]
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}}/devices/:serial/switchPortStatuses/packets" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/switchPortStatuses/packets",
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}}/devices/:serial/switchPortStatuses/packets');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/switchPortStatuses/packets');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/switchPortStatuses/packets');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/switchPortStatuses/packets' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/switchPortStatuses/packets' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/switchPortStatuses/packets")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/switchPortStatuses/packets"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/switchPortStatuses/packets"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/switchPortStatuses/packets")
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/devices/:serial/switchPortStatuses/packets') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/switchPortStatuses/packets";
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}}/devices/:serial/switchPortStatuses/packets
http GET {{baseUrl}}/devices/:serial/switchPortStatuses/packets
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/switchPortStatuses/packets
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/switchPortStatuses/packets")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"packets": [
{
"desc": "Total",
"ratePerSec": {
"recv": 0,
"sent": 1,
"total": 1
},
"recv": 7946,
"sent": 104135,
"total": 112081
},
{
"desc": "Broadcast",
"ratePerSec": {
"recv": 0,
"sent": 0,
"total": 0
},
"recv": 514,
"sent": 30370,
"total": 30884
},
{
"desc": "Multicast",
"ratePerSec": {
"recv": 0,
"sent": 0,
"total": 0
},
"recv": 771,
"sent": 66849,
"total": 67620
},
{
"desc": "CRC align errors",
"ratePerSec": {
"recv": 0,
"sent": 0,
"total": 0
},
"recv": 0,
"sent": 0,
"total": 0
}
],
"portId": "1"
}
]
GET
Return the status for all the ports of a switch
{{baseUrl}}/devices/:serial/switchPortStatuses
QUERY PARAMS
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices/:serial/switchPortStatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/devices/:serial/switchPortStatuses")
require "http/client"
url = "{{baseUrl}}/devices/:serial/switchPortStatuses"
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}}/devices/:serial/switchPortStatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices/:serial/switchPortStatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices/:serial/switchPortStatuses"
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/devices/:serial/switchPortStatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/devices/:serial/switchPortStatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices/:serial/switchPortStatuses"))
.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}}/devices/:serial/switchPortStatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/devices/:serial/switchPortStatuses")
.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}}/devices/:serial/switchPortStatuses');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/devices/:serial/switchPortStatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices/:serial/switchPortStatuses';
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}}/devices/:serial/switchPortStatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/devices/:serial/switchPortStatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices/:serial/switchPortStatuses',
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}}/devices/:serial/switchPortStatuses'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/devices/:serial/switchPortStatuses');
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}}/devices/:serial/switchPortStatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices/:serial/switchPortStatuses';
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}}/devices/:serial/switchPortStatuses"]
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}}/devices/:serial/switchPortStatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices/:serial/switchPortStatuses",
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}}/devices/:serial/switchPortStatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/devices/:serial/switchPortStatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/devices/:serial/switchPortStatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices/:serial/switchPortStatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices/:serial/switchPortStatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/devices/:serial/switchPortStatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices/:serial/switchPortStatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices/:serial/switchPortStatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices/:serial/switchPortStatuses")
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/devices/:serial/switchPortStatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices/:serial/switchPortStatuses";
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}}/devices/:serial/switchPortStatuses
http GET {{baseUrl}}/devices/:serial/switchPortStatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/devices/:serial/switchPortStatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices/:serial/switchPortStatuses")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"cdp": {
"address": "10.0,0.1",
"capabilities": "Switch",
"deviceId": "0c8ddbddee:ff",
"managementAddress": "10.0.0.100",
"nativeVlan": 1,
"platform": "MS350-24X",
"portId": "Port 20",
"systemName": "",
"version": "1",
"vtpManagementDomain": ""
},
"clientCount": 10,
"duplex": "full",
"enabled": true,
"errors": [
"PoE overload",
"Very high proportion of CRC errors"
],
"isUplink": false,
"lldp": {
"chassisId": "0c:8d:db:dd:ee:ff",
"managementAddress": "10.0.0.100",
"managementVlan": 1,
"portDescription": "Port 20",
"portId": "20",
"portVlan": 1,
"systemCapabilities": "switch",
"systemDescription": "MS350-24X Cloud Managed PoE Switch",
"systemName": "MS350-24X - Test"
},
"portId": "1",
"powerUsageInWh": 55.9,
"securePort": {
"active": true,
"authenticationStatus": "Authentication in progress",
"configOverrides": {
"allowedVlans": "all",
"type": "trunk",
"vlan": 12,
"voiceVlan": 34
},
"enabled": true
},
"speed": "10 Gbps",
"status": "Connected",
"trafficInKbps": {
"recv": 1,
"sent": 1.2,
"total": 2.2
},
"usageInKb": {
"recv": 17859,
"sent": 23008,
"total": 40867
},
"warnings": [
"SecureConnect authentication in progress",
"PoE port was denied power",
"High proportion of CRC errors"
]
}
]
GET
List the switch profiles for your switch template configuration
{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles
QUERY PARAMS
organizationId
configTemplateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"
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/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"))
.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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
.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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles';
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles',
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles');
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles';
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"]
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles",
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")
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/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles";
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}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles
http GET {{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationId/configTemplates/:configTemplateId/switchProfiles")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"model": "MS450-24",
"name": "A Simple Switch Profile",
"switchProfileId": "1234"
}
]
POST
Add a quality of service rule
{{baseUrl}}/networks/:networkId/switch/settings/qosRules
QUERY PARAMS
networkId
BODY json
{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switch/settings/qosRules" {:content-type :json
:form-params {:dscp 0
:dstPort 0
:dstPortRange ""
:protocol ""
:srcPort 0
:srcPortRange ""
:vlan 0}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/qosRules"),
Content = new StringContent("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
payload := strings.NewReader("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switch/settings/qosRules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 122
{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.setHeader("content-type", "application/json")
.setBody("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.header("content-type", "application/json")
.body("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
.asString();
const data = JSON.stringify({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules',
headers: {'content-type': 'application/json'},
data: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dscp":0,"dstPort":0,"dstPortRange":"","protocol":"","srcPort":0,"srcPortRange":"","vlan":0}'
};
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}}/networks/:networkId/switch/settings/qosRules',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dscp": 0,\n "dstPort": 0,\n "dstPortRange": "",\n "protocol": "",\n "srcPort": 0,\n "srcPortRange": "",\n "vlan": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules',
headers: {'content-type': 'application/json'},
body: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules',
headers: {'content-type': 'application/json'},
data: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dscp":0,"dstPort":0,"dstPortRange":"","protocol":"","srcPort":0,"srcPortRange":"","vlan":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dscp": @0,
@"dstPort": @0,
@"dstPortRange": @"",
@"protocol": @"",
@"srcPort": @0,
@"srcPortRange": @"",
@"vlan": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/qosRules"]
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}}/networks/:networkId/switch/settings/qosRules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules', [
'body' => '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switch/settings/qosRules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
payload = {
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
payload <- "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switch/settings/qosRules') do |req|
req.body = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules";
let payload = json!({
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switch/settings/qosRules \
--header 'content-type: application/json' \
--data '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
echo '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}' | \
http POST {{baseUrl}}/networks/:networkId/switch/settings/qosRules \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dscp": 0,\n "dstPort": 0,\n "dstPortRange": "",\n "protocol": "",\n "srcPort": 0,\n "srcPortRange": "",\n "vlan": 0\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"dscp": 0,
"dstPort": 3000,
"dstPortRange": "3000-3100",
"id": "1284392014819",
"protocol": "TCP",
"srcPort": 2000,
"srcPortRange": "70-80",
"vlan": 100
}
DELETE
Delete a quality of service rule
{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
QUERY PARAMS
networkId
qosRuleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
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/networks/:networkId/switch/settings/qosRules/:qosRuleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"))
.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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId',
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"]
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId",
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
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/networks/:networkId/switch/settings/qosRules/:qosRuleId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId";
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
http DELETE {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")! 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
List quality of service rules
{{baseUrl}}/networks/:networkId/switch/settings/qosRules
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
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}}/networks/:networkId/switch/settings/qosRules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
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/networks/:networkId/switch/settings/qosRules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules"))
.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}}/networks/:networkId/switch/settings/qosRules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.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}}/networks/:networkId/switch/settings/qosRules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules';
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}}/networks/:networkId/switch/settings/qosRules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules',
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}}/networks/:networkId/switch/settings/qosRules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
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}}/networks/:networkId/switch/settings/qosRules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules';
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}}/networks/:networkId/switch/settings/qosRules"]
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}}/networks/:networkId/switch/settings/qosRules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules",
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}}/networks/:networkId/switch/settings/qosRules');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/qosRules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules")
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/networks/:networkId/switch/settings/qosRules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules";
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}}/networks/:networkId/switch/settings/qosRules
http GET {{baseUrl}}/networks/:networkId/switch/settings/qosRules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"dscp": 0,
"dstPort": 3000,
"dstPortRange": "3000-3100",
"id": "1284392014819",
"protocol": "TCP",
"srcPort": 2000,
"srcPortRange": "70-80",
"vlan": 100
}
]
GET
Return a quality of service rule
{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
QUERY PARAMS
networkId
qosRuleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
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/networks/:networkId/switch/settings/qosRules/:qosRuleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"))
.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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId',
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"]
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId",
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
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/networks/:networkId/switch/settings/qosRules/:qosRuleId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId";
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
http GET {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"dscp": 0,
"dstPort": 3000,
"dstPortRange": "3000-3100",
"id": "1284392014819",
"protocol": "TCP",
"srcPort": 2000,
"srcPortRange": "70-80",
"vlan": 100
}
GET
Return multicast settings for a network
{{baseUrl}}/networks/:networkId/switch/settings/multicast
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/multicast");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/multicast")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
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}}/networks/:networkId/switch/settings/multicast"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/multicast");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
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/networks/:networkId/switch/settings/multicast HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/multicast"))
.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}}/networks/:networkId/switch/settings/multicast")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.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}}/networks/:networkId/switch/settings/multicast');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/multicast'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/multicast';
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}}/networks/:networkId/switch/settings/multicast',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/multicast',
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}}/networks/:networkId/switch/settings/multicast'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/multicast');
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}}/networks/:networkId/switch/settings/multicast'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/multicast';
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}}/networks/:networkId/switch/settings/multicast"]
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}}/networks/:networkId/switch/settings/multicast" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/multicast",
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}}/networks/:networkId/switch/settings/multicast');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/multicast');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/multicast');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/multicast' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/multicast' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/multicast")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
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/networks/:networkId/switch/settings/multicast') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast";
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}}/networks/:networkId/switch/settings/multicast
http GET {{baseUrl}}/networks/:networkId/switch/settings/multicast
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/multicast
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/multicast")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true,
"switches": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
},
{
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true,
"stacks": [
"789102",
"123456",
"129102"
]
}
]
}
GET
Return the MTU configuration
{{baseUrl}}/networks/:networkId/switch/settings/mtu
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/mtu");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/mtu")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
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}}/networks/:networkId/switch/settings/mtu"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/mtu");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
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/networks/:networkId/switch/settings/mtu HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/mtu"))
.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}}/networks/:networkId/switch/settings/mtu")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.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}}/networks/:networkId/switch/settings/mtu');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/mtu'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/mtu';
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}}/networks/:networkId/switch/settings/mtu',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/mtu',
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}}/networks/:networkId/switch/settings/mtu'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/mtu');
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}}/networks/:networkId/switch/settings/mtu'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/mtu';
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}}/networks/:networkId/switch/settings/mtu"]
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}}/networks/:networkId/switch/settings/mtu" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/mtu",
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}}/networks/:networkId/switch/settings/mtu');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/mtu');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/mtu');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/mtu' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/mtu' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/mtu")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
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/networks/:networkId/switch/settings/mtu') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu";
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}}/networks/:networkId/switch/settings/mtu
http GET {{baseUrl}}/networks/:networkId/switch/settings/mtu
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/mtu
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/mtu")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"defaultMtuSize": 9578,
"overrides": [
{
"mtuSize": 1500,
"switches": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
},
{
"mtuSize": 1600,
"switchProfiles": [
"1284392014819",
"2983092129865"
]
}
]
}
GET
Return the quality of service rule IDs by order in which they will be processed by the switch
{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
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}}/networks/:networkId/switch/settings/qosRules/order"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
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/networks/:networkId/switch/settings/qosRules/order HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"))
.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}}/networks/:networkId/switch/settings/qosRules/order")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.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}}/networks/:networkId/switch/settings/qosRules/order');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order';
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}}/networks/:networkId/switch/settings/qosRules/order',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules/order',
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}}/networks/:networkId/switch/settings/qosRules/order'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
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}}/networks/:networkId/switch/settings/qosRules/order'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order';
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}}/networks/:networkId/switch/settings/qosRules/order"]
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}}/networks/:networkId/switch/settings/qosRules/order" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order",
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}}/networks/:networkId/switch/settings/qosRules/order');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/qosRules/order")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
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/networks/:networkId/switch/settings/qosRules/order') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order";
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}}/networks/:networkId/switch/settings/qosRules/order
http GET {{baseUrl}}/networks/:networkId/switch/settings/qosRules/order
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules/order
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ruleIds": [
"1284392014819",
"2983092129865"
]
}
GET
Return the storm control configuration for a switch network
{{baseUrl}}/networks/:networkId/switch/settings/stormControl
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/stormControl");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
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}}/networks/:networkId/switch/settings/stormControl"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/stormControl");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
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/networks/:networkId/switch/settings/stormControl HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/stormControl"))
.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}}/networks/:networkId/switch/settings/stormControl")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.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}}/networks/:networkId/switch/settings/stormControl');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings/stormControl'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/stormControl';
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}}/networks/:networkId/switch/settings/stormControl',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/stormControl',
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}}/networks/:networkId/switch/settings/stormControl'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
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}}/networks/:networkId/switch/settings/stormControl'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/stormControl';
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}}/networks/:networkId/switch/settings/stormControl"]
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}}/networks/:networkId/switch/settings/stormControl" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/stormControl",
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}}/networks/:networkId/switch/settings/stormControl');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/stormControl' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/stormControl' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings/stormControl")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
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/networks/:networkId/switch/settings/stormControl') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl";
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}}/networks/:networkId/switch/settings/stormControl
http GET {{baseUrl}}/networks/:networkId/switch/settings/stormControl
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/stormControl
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/stormControl")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"broadcastThreshold": 30,
"multicastThreshold": 30,
"unknownUnicastThreshold": 30
}
GET
Returns the switch network settings
{{baseUrl}}/networks/:networkId/switch/settings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switch/settings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings"
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}}/networks/:networkId/switch/settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings"
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/networks/:networkId/switch/settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switch/settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings"))
.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}}/networks/:networkId/switch/settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switch/settings")
.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}}/networks/:networkId/switch/settings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switch/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings';
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}}/networks/:networkId/switch/settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings',
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}}/networks/:networkId/switch/settings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switch/settings');
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}}/networks/:networkId/switch/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings';
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}}/networks/:networkId/switch/settings"]
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}}/networks/:networkId/switch/settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings",
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}}/networks/:networkId/switch/settings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switch/settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings")
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/networks/:networkId/switch/settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings";
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}}/networks/:networkId/switch/settings
http GET {{baseUrl}}/networks/:networkId/switch/settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"powerExceptions": [
{
"powerType": "redundant",
"serial": "Q234-ABCD-0001"
},
{
"powerType": "combined",
"serial": "Q234-ABCD-0002"
},
{
"powerType": "redundant",
"serial": "Q234-ABCD-0003"
},
{
"powerType": "useNetworkSetting",
"serial": "Q234-ABCD-0004"
}
],
"useCombinedPower": false,
"vlan": 100
}
PUT
Update a quality of service rule
{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
QUERY PARAMS
networkId
qosRuleId
BODY json
{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId" {:content-type :json
:form-params {:dscp 0
:dstPort 0
:dstPortRange ""
:protocol ""
:srcPort 0
:srcPortRange ""
:vlan 0}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"),
Content = new StringContent("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
payload := strings.NewReader("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 122
{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.setHeader("content-type", "application/json")
.setBody("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.header("content-type", "application/json")
.body("{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
.asString();
const data = JSON.stringify({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
headers: {'content-type': 'application/json'},
data: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"dscp":0,"dstPort":0,"dstPortRange":"","protocol":"","srcPort":0,"srcPortRange":"","vlan":0}'
};
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}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dscp": 0,\n "dstPort": 0,\n "dstPortRange": "",\n "protocol": "",\n "srcPort": 0,\n "srcPortRange": "",\n "vlan": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
headers: {'content-type': 'application/json'},
body: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId',
headers: {'content-type': 'application/json'},
data: {
dscp: 0,
dstPort: 0,
dstPortRange: '',
protocol: '',
srcPort: 0,
srcPortRange: '',
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"dscp":0,"dstPort":0,"dstPortRange":"","protocol":"","srcPort":0,"srcPortRange":"","vlan":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dscp": @0,
@"dstPort": @0,
@"dstPortRange": @"",
@"protocol": @"",
@"srcPort": @0,
@"srcPortRange": @"",
@"vlan": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId', [
'body' => '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dscp' => 0,
'dstPort' => 0,
'dstPortRange' => '',
'protocol' => '',
'srcPort' => 0,
'srcPortRange' => '',
'vlan' => 0
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
payload = {
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId"
payload <- "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings/qosRules/:qosRuleId') do |req|
req.body = "{\n \"dscp\": 0,\n \"dstPort\": 0,\n \"dstPortRange\": \"\",\n \"protocol\": \"\",\n \"srcPort\": 0,\n \"srcPortRange\": \"\",\n \"vlan\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId";
let payload = json!({
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId \
--header 'content-type: application/json' \
--data '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}'
echo '{
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "dscp": 0,\n "dstPort": 0,\n "dstPortRange": "",\n "protocol": "",\n "srcPort": 0,\n "srcPortRange": "",\n "vlan": 0\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dscp": 0,
"dstPort": 0,
"dstPortRange": "",
"protocol": "",
"srcPort": 0,
"srcPortRange": "",
"vlan": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/:qosRuleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"dscp": 0,
"dstPort": 3000,
"dstPortRange": "3000-3100",
"id": "1284392014819",
"protocol": "TCP",
"srcPort": 2000,
"srcPortRange": "70-80",
"vlan": 100
}
PUT
Update multicast settings for a network
{{baseUrl}}/networks/:networkId/switch/settings/multicast
QUERY PARAMS
networkId
BODY json
{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/multicast");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings/multicast" {:content-type :json
:form-params {:defaultSettings {:floodUnknownMulticastTrafficEnabled false
:igmpSnoopingEnabled false}
:overrides [{:floodUnknownMulticastTrafficEnabled false
:igmpSnoopingEnabled false
:stacks []
:switchProfiles []
:switches []}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/multicast"),
Content = new StringContent("{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/multicast");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
payload := strings.NewReader("{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings/multicast HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 304
{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.setHeader("content-type", "application/json")
.setBody("{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/multicast"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.header("content-type", "application/json")
.body("{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
defaultSettings: {
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false
},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/multicast');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/multicast',
headers: {'content-type': 'application/json'},
data: {
defaultSettings: {floodUnknownMulticastTrafficEnabled: false, igmpSnoopingEnabled: false},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/multicast';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"defaultSettings":{"floodUnknownMulticastTrafficEnabled":false,"igmpSnoopingEnabled":false},"overrides":[{"floodUnknownMulticastTrafficEnabled":false,"igmpSnoopingEnabled":false,"stacks":[],"switchProfiles":[],"switches":[]}]}'
};
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}}/networks/:networkId/switch/settings/multicast',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "defaultSettings": {\n "floodUnknownMulticastTrafficEnabled": false,\n "igmpSnoopingEnabled": false\n },\n "overrides": [\n {\n "floodUnknownMulticastTrafficEnabled": false,\n "igmpSnoopingEnabled": false,\n "stacks": [],\n "switchProfiles": [],\n "switches": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/multicast',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
defaultSettings: {floodUnknownMulticastTrafficEnabled: false, igmpSnoopingEnabled: false},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/multicast',
headers: {'content-type': 'application/json'},
body: {
defaultSettings: {floodUnknownMulticastTrafficEnabled: false, igmpSnoopingEnabled: false},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/multicast');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
defaultSettings: {
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false
},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/multicast',
headers: {'content-type': 'application/json'},
data: {
defaultSettings: {floodUnknownMulticastTrafficEnabled: false, igmpSnoopingEnabled: false},
overrides: [
{
floodUnknownMulticastTrafficEnabled: false,
igmpSnoopingEnabled: false,
stacks: [],
switchProfiles: [],
switches: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/multicast';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"defaultSettings":{"floodUnknownMulticastTrafficEnabled":false,"igmpSnoopingEnabled":false},"overrides":[{"floodUnknownMulticastTrafficEnabled":false,"igmpSnoopingEnabled":false,"stacks":[],"switchProfiles":[],"switches":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"defaultSettings": @{ @"floodUnknownMulticastTrafficEnabled": @NO, @"igmpSnoopingEnabled": @NO },
@"overrides": @[ @{ @"floodUnknownMulticastTrafficEnabled": @NO, @"igmpSnoopingEnabled": @NO, @"stacks": @[ ], @"switchProfiles": @[ ], @"switches": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/multicast"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings/multicast" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/multicast",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'defaultSettings' => [
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null
],
'overrides' => [
[
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null,
'stacks' => [
],
'switchProfiles' => [
],
'switches' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/multicast', [
'body' => '{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/multicast');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'defaultSettings' => [
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null
],
'overrides' => [
[
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null,
'stacks' => [
],
'switchProfiles' => [
],
'switches' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'defaultSettings' => [
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null
],
'overrides' => [
[
'floodUnknownMulticastTrafficEnabled' => null,
'igmpSnoopingEnabled' => null,
'stacks' => [
],
'switchProfiles' => [
],
'switches' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/multicast');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/multicast' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/multicast' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings/multicast", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
payload = {
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": False,
"igmpSnoopingEnabled": False
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": False,
"igmpSnoopingEnabled": False,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/multicast"
payload <- "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/multicast")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings/multicast') do |req|
req.body = "{\n \"defaultSettings\": {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false\n },\n \"overrides\": [\n {\n \"floodUnknownMulticastTrafficEnabled\": false,\n \"igmpSnoopingEnabled\": false,\n \"stacks\": [],\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/multicast";
let payload = json!({
"defaultSettings": json!({
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
}),
"overrides": (
json!({
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": (),
"switchProfiles": (),
"switches": ()
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings/multicast \
--header 'content-type: application/json' \
--data '{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}'
echo '{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings/multicast \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "defaultSettings": {\n "floodUnknownMulticastTrafficEnabled": false,\n "igmpSnoopingEnabled": false\n },\n "overrides": [\n {\n "floodUnknownMulticastTrafficEnabled": false,\n "igmpSnoopingEnabled": false,\n "stacks": [],\n "switchProfiles": [],\n "switches": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/multicast
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"defaultSettings": [
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false
],
"overrides": [
[
"floodUnknownMulticastTrafficEnabled": false,
"igmpSnoopingEnabled": false,
"stacks": [],
"switchProfiles": [],
"switches": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/multicast")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"defaultSettings": {
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true
},
"overrides": [
{
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true,
"switches": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
},
{
"floodUnknownMulticastTrafficEnabled": true,
"igmpSnoopingEnabled": true,
"stacks": [
"789102",
"123456",
"129102"
]
}
]
}
PUT
Update switch network settings
{{baseUrl}}/networks/:networkId/switch/settings
QUERY PARAMS
networkId
BODY json
{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings" {:content-type :json
:form-params {:powerExceptions [{:powerType ""
:serial ""}]
:useCombinedPower false
:vlan 0}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings"),
Content = new StringContent("{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings"
payload := strings.NewReader("{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 126
{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings")
.header("content-type", "application/json")
.body("{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}")
.asString();
const data = JSON.stringify({
powerExceptions: [
{
powerType: '',
serial: ''
}
],
useCombinedPower: false,
vlan: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings',
headers: {'content-type': 'application/json'},
data: {
powerExceptions: [{powerType: '', serial: ''}],
useCombinedPower: false,
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"powerExceptions":[{"powerType":"","serial":""}],"useCombinedPower":false,"vlan":0}'
};
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}}/networks/:networkId/switch/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "powerExceptions": [\n {\n "powerType": "",\n "serial": ""\n }\n ],\n "useCombinedPower": false,\n "vlan": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
powerExceptions: [{powerType: '', serial: ''}],
useCombinedPower: false,
vlan: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings',
headers: {'content-type': 'application/json'},
body: {
powerExceptions: [{powerType: '', serial: ''}],
useCombinedPower: false,
vlan: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
powerExceptions: [
{
powerType: '',
serial: ''
}
],
useCombinedPower: false,
vlan: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings',
headers: {'content-type': 'application/json'},
data: {
powerExceptions: [{powerType: '', serial: ''}],
useCombinedPower: false,
vlan: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"powerExceptions":[{"powerType":"","serial":""}],"useCombinedPower":false,"vlan":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"powerExceptions": @[ @{ @"powerType": @"", @"serial": @"" } ],
@"useCombinedPower": @NO,
@"vlan": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'powerExceptions' => [
[
'powerType' => '',
'serial' => ''
]
],
'useCombinedPower' => null,
'vlan' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings', [
'body' => '{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'powerExceptions' => [
[
'powerType' => '',
'serial' => ''
]
],
'useCombinedPower' => null,
'vlan' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'powerExceptions' => [
[
'powerType' => '',
'serial' => ''
]
],
'useCombinedPower' => null,
'vlan' => 0
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings"
payload = {
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": False,
"vlan": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings"
payload <- "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings') do |req|
req.body = "{\n \"powerExceptions\": [\n {\n \"powerType\": \"\",\n \"serial\": \"\"\n }\n ],\n \"useCombinedPower\": false,\n \"vlan\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings";
let payload = json!({
"powerExceptions": (
json!({
"powerType": "",
"serial": ""
})
),
"useCombinedPower": false,
"vlan": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings \
--header 'content-type: application/json' \
--data '{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}'
echo '{
"powerExceptions": [
{
"powerType": "",
"serial": ""
}
],
"useCombinedPower": false,
"vlan": 0
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "powerExceptions": [\n {\n "powerType": "",\n "serial": ""\n }\n ],\n "useCombinedPower": false,\n "vlan": 0\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"powerExceptions": [
[
"powerType": "",
"serial": ""
]
],
"useCombinedPower": false,
"vlan": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"powerExceptions": [
{
"powerType": "redundant",
"serial": "Q234-ABCD-0001"
},
{
"powerType": "combined",
"serial": "Q234-ABCD-0002"
},
{
"powerType": "redundant",
"serial": "Q234-ABCD-0003"
},
{
"powerType": "useNetworkSetting",
"serial": "Q234-ABCD-0004"
}
],
"useCombinedPower": false,
"vlan": 100
}
PUT
Update the MTU configuration
{{baseUrl}}/networks/:networkId/switch/settings/mtu
QUERY PARAMS
networkId
BODY json
{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/mtu");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings/mtu" {:content-type :json
:form-params {:defaultMtuSize 0
:overrides [{:mtuSize 0
:switchProfiles []
:switches []}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/mtu"),
Content = new StringContent("{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/mtu");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
payload := strings.NewReader("{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings/mtu HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 128
{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.setHeader("content-type", "application/json")
.setBody("{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/mtu"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.header("content-type", "application/json")
.body("{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
defaultMtuSize: 0,
overrides: [
{
mtuSize: 0,
switchProfiles: [],
switches: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/mtu');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/mtu',
headers: {'content-type': 'application/json'},
data: {defaultMtuSize: 0, overrides: [{mtuSize: 0, switchProfiles: [], switches: []}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/mtu';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"defaultMtuSize":0,"overrides":[{"mtuSize":0,"switchProfiles":[],"switches":[]}]}'
};
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}}/networks/:networkId/switch/settings/mtu',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "defaultMtuSize": 0,\n "overrides": [\n {\n "mtuSize": 0,\n "switchProfiles": [],\n "switches": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/mtu',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({defaultMtuSize: 0, overrides: [{mtuSize: 0, switchProfiles: [], switches: []}]}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/mtu',
headers: {'content-type': 'application/json'},
body: {defaultMtuSize: 0, overrides: [{mtuSize: 0, switchProfiles: [], switches: []}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/mtu');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
defaultMtuSize: 0,
overrides: [
{
mtuSize: 0,
switchProfiles: [],
switches: []
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/mtu',
headers: {'content-type': 'application/json'},
data: {defaultMtuSize: 0, overrides: [{mtuSize: 0, switchProfiles: [], switches: []}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/mtu';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"defaultMtuSize":0,"overrides":[{"mtuSize":0,"switchProfiles":[],"switches":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"defaultMtuSize": @0,
@"overrides": @[ @{ @"mtuSize": @0, @"switchProfiles": @[ ], @"switches": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/mtu"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings/mtu" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/mtu",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'defaultMtuSize' => 0,
'overrides' => [
[
'mtuSize' => 0,
'switchProfiles' => [
],
'switches' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/mtu', [
'body' => '{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/mtu');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'defaultMtuSize' => 0,
'overrides' => [
[
'mtuSize' => 0,
'switchProfiles' => [
],
'switches' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'defaultMtuSize' => 0,
'overrides' => [
[
'mtuSize' => 0,
'switchProfiles' => [
],
'switches' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/mtu');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/mtu' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/mtu' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings/mtu", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
payload = {
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/mtu"
payload <- "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/mtu")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings/mtu') do |req|
req.body = "{\n \"defaultMtuSize\": 0,\n \"overrides\": [\n {\n \"mtuSize\": 0,\n \"switchProfiles\": [],\n \"switches\": []\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/mtu";
let payload = json!({
"defaultMtuSize": 0,
"overrides": (
json!({
"mtuSize": 0,
"switchProfiles": (),
"switches": ()
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings/mtu \
--header 'content-type: application/json' \
--data '{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}'
echo '{
"defaultMtuSize": 0,
"overrides": [
{
"mtuSize": 0,
"switchProfiles": [],
"switches": []
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings/mtu \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "defaultMtuSize": 0,\n "overrides": [\n {\n "mtuSize": 0,\n "switchProfiles": [],\n "switches": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/mtu
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"defaultMtuSize": 0,
"overrides": [
[
"mtuSize": 0,
"switchProfiles": [],
"switches": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/mtu")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"defaultMtuSize": 9578,
"overrides": [
{
"mtuSize": 1500,
"switches": [
"Q234-ABCD-0001",
"Q234-ABCD-0002",
"Q234-ABCD-0003"
]
},
{
"mtuSize": 1600,
"switchProfiles": [
"1284392014819",
"2983092129865"
]
}
]
}
PUT
Update the order in which the rules should be processed by the switch
{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order
QUERY PARAMS
networkId
BODY json
{
"ruleIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ruleIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order" {:content-type :json
:form-params {:ruleIds []}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ruleIds\": []\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"),
Content = new StringContent("{\n \"ruleIds\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ruleIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
payload := strings.NewReader("{\n \"ruleIds\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings/qosRules/order HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"ruleIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.setHeader("content-type", "application/json")
.setBody("{\n \"ruleIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ruleIds\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ruleIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.header("content-type", "application/json")
.body("{\n \"ruleIds\": []\n}")
.asString();
const data = JSON.stringify({
ruleIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order',
headers: {'content-type': 'application/json'},
data: {ruleIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ruleIds":[]}'
};
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}}/networks/:networkId/switch/settings/qosRules/order',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ruleIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ruleIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/qosRules/order',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ruleIds: []}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order',
headers: {'content-type': 'application/json'},
body: {ruleIds: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ruleIds: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order',
headers: {'content-type': 'application/json'},
data: {ruleIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ruleIds":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ruleIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ruleIds\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ruleIds' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order', [
'body' => '{
"ruleIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ruleIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ruleIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ruleIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ruleIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ruleIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings/qosRules/order", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
payload = { "ruleIds": [] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order"
payload <- "{\n \"ruleIds\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ruleIds\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings/qosRules/order') do |req|
req.body = "{\n \"ruleIds\": []\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order";
let payload = json!({"ruleIds": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings/qosRules/order \
--header 'content-type: application/json' \
--data '{
"ruleIds": []
}'
echo '{
"ruleIds": []
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings/qosRules/order \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ruleIds": []\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/qosRules/order
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ruleIds": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/qosRules/order")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ruleIds": [
"1284392014819",
"2983092129865"
]
}
PUT
Update the storm control configuration for a switch network
{{baseUrl}}/networks/:networkId/switch/settings/stormControl
QUERY PARAMS
networkId
BODY json
{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switch/settings/stormControl");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/switch/settings/stormControl" {:content-type :json
:form-params {:broadcastThreshold 0
:multicastThreshold 0
:unknownUnicastThreshold 0}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switch/settings/stormControl"),
Content = new StringContent("{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switch/settings/stormControl");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
payload := strings.NewReader("{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/switch/settings/stormControl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.setHeader("content-type", "application/json")
.setBody("{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switch/settings/stormControl"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.header("content-type", "application/json")
.body("{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}")
.asString();
const data = JSON.stringify({
broadcastThreshold: 0,
multicastThreshold: 0,
unknownUnicastThreshold: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/stormControl',
headers: {'content-type': 'application/json'},
data: {broadcastThreshold: 0, multicastThreshold: 0, unknownUnicastThreshold: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switch/settings/stormControl';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"broadcastThreshold":0,"multicastThreshold":0,"unknownUnicastThreshold":0}'
};
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}}/networks/:networkId/switch/settings/stormControl',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "broadcastThreshold": 0,\n "multicastThreshold": 0,\n "unknownUnicastThreshold": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switch/settings/stormControl',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({broadcastThreshold: 0, multicastThreshold: 0, unknownUnicastThreshold: 0}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/stormControl',
headers: {'content-type': 'application/json'},
body: {broadcastThreshold: 0, multicastThreshold: 0, unknownUnicastThreshold: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
broadcastThreshold: 0,
multicastThreshold: 0,
unknownUnicastThreshold: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/switch/settings/stormControl',
headers: {'content-type': 'application/json'},
data: {broadcastThreshold: 0, multicastThreshold: 0, unknownUnicastThreshold: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switch/settings/stormControl';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"broadcastThreshold":0,"multicastThreshold":0,"unknownUnicastThreshold":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"broadcastThreshold": @0,
@"multicastThreshold": @0,
@"unknownUnicastThreshold": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switch/settings/stormControl"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/switch/settings/stormControl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switch/settings/stormControl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'broadcastThreshold' => 0,
'multicastThreshold' => 0,
'unknownUnicastThreshold' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/switch/settings/stormControl', [
'body' => '{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'broadcastThreshold' => 0,
'multicastThreshold' => 0,
'unknownUnicastThreshold' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'broadcastThreshold' => 0,
'multicastThreshold' => 0,
'unknownUnicastThreshold' => 0
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switch/settings/stormControl');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switch/settings/stormControl' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switch/settings/stormControl' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/switch/settings/stormControl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
payload = {
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switch/settings/stormControl"
payload <- "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switch/settings/stormControl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/switch/settings/stormControl') do |req|
req.body = "{\n \"broadcastThreshold\": 0,\n \"multicastThreshold\": 0,\n \"unknownUnicastThreshold\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switch/settings/stormControl";
let payload = json!({
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/switch/settings/stormControl \
--header 'content-type: application/json' \
--data '{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}'
echo '{
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
}' | \
http PUT {{baseUrl}}/networks/:networkId/switch/settings/stormControl \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "broadcastThreshold": 0,\n "multicastThreshold": 0,\n "unknownUnicastThreshold": 0\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switch/settings/stormControl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"broadcastThreshold": 0,
"multicastThreshold": 0,
"unknownUnicastThreshold": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switch/settings/stormControl")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"broadcastThreshold": 30,
"multicastThreshold": 30,
"unknownUnicastThreshold": 30
}
POST
Add a switch to a stack
{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add
QUERY PARAMS
networkId
switchStackId
BODY json
{
"serial": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"serial\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add" {:content-type :json
:form-params {:serial ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"serial\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"),
Content = new StringContent("{\n \"serial\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"serial\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"
payload := strings.NewReader("{\n \"serial\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switchStacks/:switchStackId/add HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"serial": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")
.setHeader("content-type", "application/json")
.setBody("{\n \"serial\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"serial\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"serial\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")
.header("content-type", "application/json")
.body("{\n \"serial\": \"\"\n}")
.asString();
const data = JSON.stringify({
serial: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add',
headers: {'content-type': 'application/json'},
data: {serial: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serial":""}'
};
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}}/networks/:networkId/switchStacks/:switchStackId/add',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "serial": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"serial\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks/:switchStackId/add',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({serial: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add',
headers: {'content-type': 'application/json'},
body: {serial: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
serial: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add',
headers: {'content-type': 'application/json'},
data: {serial: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serial":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"serial": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"]
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}}/networks/:networkId/switchStacks/:switchStackId/add" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"serial\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'serial' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add', [
'body' => '{
"serial": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'serial' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'serial' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serial": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serial": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"serial\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switchStacks/:switchStackId/add", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"
payload = { "serial": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add"
payload <- "{\n \"serial\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"serial\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switchStacks/:switchStackId/add') do |req|
req.body = "{\n \"serial\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add";
let payload = json!({"serial": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add \
--header 'content-type: application/json' \
--data '{
"serial": ""
}'
echo '{
"serial": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "serial": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["serial": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/add")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "8473",
"name": "A cool stack",
"serials": [
"QBZY-XWVU-TSRQ",
"QBAB-CDEF-GHIJ"
]
}
POST
Create a stack
{{baseUrl}}/networks/:networkId/switchStacks
QUERY PARAMS
networkId
BODY json
{
"name": "",
"serials": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"serials\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switchStacks" {:content-type :json
:form-params {:name ""
:serials []}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"serials\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switchStacks"),
Content = new StringContent("{\n \"name\": \"\",\n \"serials\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"serials\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks"
payload := strings.NewReader("{\n \"name\": \"\",\n \"serials\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switchStacks HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"name": "",
"serials": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switchStacks")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"serials\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"serials\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"serials\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switchStacks")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"serials\": []\n}")
.asString();
const data = JSON.stringify({
name: '',
serials: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switchStacks');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks',
headers: {'content-type': 'application/json'},
data: {name: '', serials: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","serials":[]}'
};
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}}/networks/:networkId/switchStacks',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "serials": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"serials\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: '', serials: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks',
headers: {'content-type': 'application/json'},
body: {name: '', serials: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switchStacks');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
serials: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks',
headers: {'content-type': 'application/json'},
data: {name: '', serials: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","serials":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"serials": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switchStacks"]
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}}/networks/:networkId/switchStacks" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"serials\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'serials' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switchStacks', [
'body' => '{
"name": "",
"serials": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'serials' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'serials' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"serials": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"serials": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"serials\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switchStacks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks"
payload = {
"name": "",
"serials": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks"
payload <- "{\n \"name\": \"\",\n \"serials\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"serials\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switchStacks') do |req|
req.body = "{\n \"name\": \"\",\n \"serials\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks";
let payload = json!({
"name": "",
"serials": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switchStacks \
--header 'content-type: application/json' \
--data '{
"name": "",
"serials": []
}'
echo '{
"name": "",
"serials": []
}' | \
http POST {{baseUrl}}/networks/:networkId/switchStacks \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "serials": []\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"serials": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "8473",
"name": "A cool stack",
"serials": [
"QBZY-XWVU-TSRQ",
"QBAB-CDEF-GHIJ"
]
}
DELETE
Delete a stack
{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
QUERY PARAMS
networkId
switchStackId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
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}}/networks/:networkId/switchStacks/:switchStackId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
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/networks/:networkId/switchStacks/:switchStackId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"))
.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}}/networks/:networkId/switchStacks/:switchStackId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.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}}/networks/:networkId/switchStacks/:switchStackId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId';
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}}/networks/:networkId/switchStacks/:switchStackId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks/:switchStackId',
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}}/networks/:networkId/switchStacks/:switchStackId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
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}}/networks/:networkId/switchStacks/:switchStackId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId';
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}}/networks/:networkId/switchStacks/:switchStackId"]
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}}/networks/:networkId/switchStacks/:switchStackId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId",
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}}/networks/:networkId/switchStacks/:switchStackId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/switchStacks/:switchStackId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
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/networks/:networkId/switchStacks/:switchStackId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId";
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}}/networks/:networkId/switchStacks/:switchStackId
http DELETE {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")! 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
List the switch stacks in a network
{{baseUrl}}/networks/:networkId/switchStacks
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switchStacks")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks"
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}}/networks/:networkId/switchStacks"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks"
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/networks/:networkId/switchStacks HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switchStacks")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks"))
.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}}/networks/:networkId/switchStacks")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switchStacks")
.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}}/networks/:networkId/switchStacks');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switchStacks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks';
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}}/networks/:networkId/switchStacks',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks',
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}}/networks/:networkId/switchStacks'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switchStacks');
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}}/networks/:networkId/switchStacks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks';
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}}/networks/:networkId/switchStacks"]
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}}/networks/:networkId/switchStacks" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks",
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}}/networks/:networkId/switchStacks');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switchStacks")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks")
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/networks/:networkId/switchStacks') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks";
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}}/networks/:networkId/switchStacks
http GET {{baseUrl}}/networks/:networkId/switchStacks
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "8473",
"name": "A cool stack",
"serials": [
"QBZY-XWVU-TSRQ",
"QBAB-CDEF-GHIJ"
]
}
]
POST
Remove a switch from a stack
{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove
QUERY PARAMS
networkId
switchStackId
BODY json
{
"serial": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"serial\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove" {:content-type :json
:form-params {:serial ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"serial\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"),
Content = new StringContent("{\n \"serial\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"serial\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"
payload := strings.NewReader("{\n \"serial\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/switchStacks/:switchStackId/remove HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"serial": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")
.setHeader("content-type", "application/json")
.setBody("{\n \"serial\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"serial\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"serial\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")
.header("content-type", "application/json")
.body("{\n \"serial\": \"\"\n}")
.asString();
const data = JSON.stringify({
serial: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove',
headers: {'content-type': 'application/json'},
data: {serial: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serial":""}'
};
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}}/networks/:networkId/switchStacks/:switchStackId/remove',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "serial": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"serial\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks/:switchStackId/remove',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({serial: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove',
headers: {'content-type': 'application/json'},
body: {serial: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
serial: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove',
headers: {'content-type': 'application/json'},
data: {serial: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"serial":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"serial": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"]
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}}/networks/:networkId/switchStacks/:switchStackId/remove" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"serial\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'serial' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove', [
'body' => '{
"serial": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'serial' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'serial' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serial": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"serial": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"serial\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/switchStacks/:switchStackId/remove", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"
payload = { "serial": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove"
payload <- "{\n \"serial\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"serial\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/switchStacks/:switchStackId/remove') do |req|
req.body = "{\n \"serial\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove";
let payload = json!({"serial": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove \
--header 'content-type: application/json' \
--data '{
"serial": ""
}'
echo '{
"serial": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "serial": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["serial": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId/remove")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "8473",
"name": "A cool stack",
"serials": [
"QBAB-CDEF-GHIJ"
]
}
GET
Show a switch stack
{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
QUERY PARAMS
networkId
switchStackId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
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}}/networks/:networkId/switchStacks/:switchStackId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
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/networks/:networkId/switchStacks/:switchStackId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"))
.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}}/networks/:networkId/switchStacks/:switchStackId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.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}}/networks/:networkId/switchStacks/:switchStackId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId';
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}}/networks/:networkId/switchStacks/:switchStackId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/switchStacks/:switchStackId',
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}}/networks/:networkId/switchStacks/:switchStackId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
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}}/networks/:networkId/switchStacks/:switchStackId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId';
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}}/networks/:networkId/switchStacks/:switchStackId"]
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}}/networks/:networkId/switchStacks/:switchStackId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId",
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}}/networks/:networkId/switchStacks/:switchStackId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/switchStacks/:switchStackId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")
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/networks/:networkId/switchStacks/:switchStackId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId";
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}}/networks/:networkId/switchStacks/:switchStackId
http GET {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/switchStacks/:switchStackId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/switchStacks/:switchStackId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "8473",
"name": "A cool stack",
"serials": [
"QBZY-XWVU-TSRQ",
"QBAB-CDEF-GHIJ"
]
}
GET
List the syslog servers for a network
{{baseUrl}}/networks/:networkId/syslogServers
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/syslogServers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/syslogServers")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/syslogServers"
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}}/networks/:networkId/syslogServers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/syslogServers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/syslogServers"
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/networks/:networkId/syslogServers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/syslogServers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/syslogServers"))
.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}}/networks/:networkId/syslogServers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/syslogServers")
.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}}/networks/:networkId/syslogServers');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/syslogServers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/syslogServers';
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}}/networks/:networkId/syslogServers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/syslogServers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/syslogServers',
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}}/networks/:networkId/syslogServers'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/syslogServers');
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}}/networks/:networkId/syslogServers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/syslogServers';
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}}/networks/:networkId/syslogServers"]
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}}/networks/:networkId/syslogServers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/syslogServers",
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}}/networks/:networkId/syslogServers');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/syslogServers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/syslogServers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/syslogServers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/syslogServers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/syslogServers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/syslogServers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/syslogServers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/syslogServers")
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/networks/:networkId/syslogServers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/syslogServers";
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}}/networks/:networkId/syslogServers
http GET {{baseUrl}}/networks/:networkId/syslogServers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/syslogServers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/syslogServers")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"host": "1.2.3.4",
"port": 443,
"roles": [
"Wireless event log",
"URLs"
]
}
]
PUT
Update the syslog servers for a network
{{baseUrl}}/networks/:networkId/syslogServers
QUERY PARAMS
networkId
BODY json
{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/syslogServers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/syslogServers" {:content-type :json
:form-params {:servers [{:host ""
:port 0
:roles []}]}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/syslogServers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/syslogServers"),
Content = new StringContent("{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/syslogServers");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/syslogServers"
payload := strings.NewReader("{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/syslogServers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 87
{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/syslogServers")
.setHeader("content-type", "application/json")
.setBody("{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/syslogServers"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/syslogServers")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/syslogServers")
.header("content-type", "application/json")
.body("{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
servers: [
{
host: '',
port: 0,
roles: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/syslogServers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/syslogServers',
headers: {'content-type': 'application/json'},
data: {servers: [{host: '', port: 0, roles: []}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/syslogServers';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"servers":[{"host":"","port":0,"roles":[]}]}'
};
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}}/networks/:networkId/syslogServers',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "servers": [\n {\n "host": "",\n "port": 0,\n "roles": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/syslogServers")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/syslogServers',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({servers: [{host: '', port: 0, roles: []}]}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/syslogServers',
headers: {'content-type': 'application/json'},
body: {servers: [{host: '', port: 0, roles: []}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/syslogServers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
servers: [
{
host: '',
port: 0,
roles: []
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/syslogServers',
headers: {'content-type': 'application/json'},
data: {servers: [{host: '', port: 0, roles: []}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/syslogServers';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"servers":[{"host":"","port":0,"roles":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"servers": @[ @{ @"host": @"", @"port": @0, @"roles": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/syslogServers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/syslogServers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/syslogServers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'servers' => [
[
'host' => '',
'port' => 0,
'roles' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/syslogServers', [
'body' => '{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/syslogServers');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'servers' => [
[
'host' => '',
'port' => 0,
'roles' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'servers' => [
[
'host' => '',
'port' => 0,
'roles' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/syslogServers');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/syslogServers' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/syslogServers' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/syslogServers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/syslogServers"
payload = { "servers": [
{
"host": "",
"port": 0,
"roles": []
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/syslogServers"
payload <- "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/syslogServers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/syslogServers') do |req|
req.body = "{\n \"servers\": [\n {\n \"host\": \"\",\n \"port\": 0,\n \"roles\": []\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/syslogServers";
let payload = json!({"servers": (
json!({
"host": "",
"port": 0,
"roles": ()
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/syslogServers \
--header 'content-type: application/json' \
--data '{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}'
echo '{
"servers": [
{
"host": "",
"port": 0,
"roles": []
}
]
}' | \
http PUT {{baseUrl}}/networks/:networkId/syslogServers \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "servers": [\n {\n "host": "",\n "port": 0,\n "roles": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/syslogServers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["servers": [
[
"host": "",
"port": 0,
"roles": []
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/syslogServers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"host": "1.2.3.4",
"port": 443,
"roles": [
"Wireless event log",
"URLs"
]
}
]
GET
Returns the uplink settings for your MX network.
{{baseUrl}}/networks/:networkId/uplinkSettings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/uplinkSettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/uplinkSettings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/uplinkSettings"
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}}/networks/:networkId/uplinkSettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/uplinkSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/uplinkSettings"
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/networks/:networkId/uplinkSettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/uplinkSettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/uplinkSettings"))
.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}}/networks/:networkId/uplinkSettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/uplinkSettings")
.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}}/networks/:networkId/uplinkSettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/uplinkSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/uplinkSettings';
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}}/networks/:networkId/uplinkSettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/uplinkSettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/uplinkSettings',
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}}/networks/:networkId/uplinkSettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/uplinkSettings');
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}}/networks/:networkId/uplinkSettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/uplinkSettings';
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}}/networks/:networkId/uplinkSettings"]
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}}/networks/:networkId/uplinkSettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/uplinkSettings",
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}}/networks/:networkId/uplinkSettings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/uplinkSettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/uplinkSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/uplinkSettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/uplinkSettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/uplinkSettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/uplinkSettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/uplinkSettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/uplinkSettings")
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/networks/:networkId/uplinkSettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/uplinkSettings";
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}}/networks/:networkId/uplinkSettings
http GET {{baseUrl}}/networks/:networkId/uplinkSettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/uplinkSettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/uplinkSettings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bandwidthLimits": {
"cellular": {
"limitDown": 51200,
"limitUp": 51200
},
"wan1": {
"limitDown": 1000000,
"limitUp": 1000000
},
"wan2": {
"limitDown": 1000000,
"limitUp": 1000000
}
}
}
PUT
Updates the uplink settings for your MX network.
{{baseUrl}}/networks/:networkId/uplinkSettings
QUERY PARAMS
networkId
BODY json
{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/uplinkSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/uplinkSettings" {:content-type :json
:form-params {:bandwidthLimits {:cellular {:limitDown 0
:limitUp 0}
:wan1 {:limitDown 0
:limitUp 0}
:wan2 {:limitDown 0
:limitUp 0}}}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/uplinkSettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/uplinkSettings"),
Content = new StringContent("{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/uplinkSettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/uplinkSettings"
payload := strings.NewReader("{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/uplinkSettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 219
{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/uplinkSettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/uplinkSettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/uplinkSettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/uplinkSettings")
.header("content-type", "application/json")
.body("{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}")
.asString();
const data = JSON.stringify({
bandwidthLimits: {
cellular: {
limitDown: 0,
limitUp: 0
},
wan1: {
limitDown: 0,
limitUp: 0
},
wan2: {
limitDown: 0,
limitUp: 0
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/uplinkSettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/uplinkSettings',
headers: {'content-type': 'application/json'},
data: {
bandwidthLimits: {
cellular: {limitDown: 0, limitUp: 0},
wan1: {limitDown: 0, limitUp: 0},
wan2: {limitDown: 0, limitUp: 0}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/uplinkSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bandwidthLimits":{"cellular":{"limitDown":0,"limitUp":0},"wan1":{"limitDown":0,"limitUp":0},"wan2":{"limitDown":0,"limitUp":0}}}'
};
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}}/networks/:networkId/uplinkSettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bandwidthLimits": {\n "cellular": {\n "limitDown": 0,\n "limitUp": 0\n },\n "wan1": {\n "limitDown": 0,\n "limitUp": 0\n },\n "wan2": {\n "limitDown": 0,\n "limitUp": 0\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/uplinkSettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/uplinkSettings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bandwidthLimits: {
cellular: {limitDown: 0, limitUp: 0},
wan1: {limitDown: 0, limitUp: 0},
wan2: {limitDown: 0, limitUp: 0}
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/uplinkSettings',
headers: {'content-type': 'application/json'},
body: {
bandwidthLimits: {
cellular: {limitDown: 0, limitUp: 0},
wan1: {limitDown: 0, limitUp: 0},
wan2: {limitDown: 0, limitUp: 0}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/uplinkSettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bandwidthLimits: {
cellular: {
limitDown: 0,
limitUp: 0
},
wan1: {
limitDown: 0,
limitUp: 0
},
wan2: {
limitDown: 0,
limitUp: 0
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/uplinkSettings',
headers: {'content-type': 'application/json'},
data: {
bandwidthLimits: {
cellular: {limitDown: 0, limitUp: 0},
wan1: {limitDown: 0, limitUp: 0},
wan2: {limitDown: 0, limitUp: 0}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/uplinkSettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"bandwidthLimits":{"cellular":{"limitDown":0,"limitUp":0},"wan1":{"limitDown":0,"limitUp":0},"wan2":{"limitDown":0,"limitUp":0}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bandwidthLimits": @{ @"cellular": @{ @"limitDown": @0, @"limitUp": @0 }, @"wan1": @{ @"limitDown": @0, @"limitUp": @0 }, @"wan2": @{ @"limitDown": @0, @"limitUp": @0 } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/uplinkSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/uplinkSettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/uplinkSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bandwidthLimits' => [
'cellular' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan1' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan2' => [
'limitDown' => 0,
'limitUp' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/uplinkSettings', [
'body' => '{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/uplinkSettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bandwidthLimits' => [
'cellular' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan1' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan2' => [
'limitDown' => 0,
'limitUp' => 0
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bandwidthLimits' => [
'cellular' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan1' => [
'limitDown' => 0,
'limitUp' => 0
],
'wan2' => [
'limitDown' => 0,
'limitUp' => 0
]
]
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/uplinkSettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/uplinkSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/uplinkSettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/uplinkSettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/uplinkSettings"
payload = { "bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
} }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/uplinkSettings"
payload <- "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/uplinkSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/uplinkSettings') do |req|
req.body = "{\n \"bandwidthLimits\": {\n \"cellular\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan1\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n },\n \"wan2\": {\n \"limitDown\": 0,\n \"limitUp\": 0\n }\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/uplinkSettings";
let payload = json!({"bandwidthLimits": json!({
"cellular": json!({
"limitDown": 0,
"limitUp": 0
}),
"wan1": json!({
"limitDown": 0,
"limitUp": 0
}),
"wan2": json!({
"limitDown": 0,
"limitUp": 0
})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/uplinkSettings \
--header 'content-type: application/json' \
--data '{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}'
echo '{
"bandwidthLimits": {
"cellular": {
"limitDown": 0,
"limitUp": 0
},
"wan1": {
"limitDown": 0,
"limitUp": 0
},
"wan2": {
"limitDown": 0,
"limitUp": 0
}
}
}' | \
http PUT {{baseUrl}}/networks/:networkId/uplinkSettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "bandwidthLimits": {\n "cellular": {\n "limitDown": 0,\n "limitUp": 0\n },\n "wan1": {\n "limitDown": 0,\n "limitUp": 0\n },\n "wan2": {\n "limitDown": 0,\n "limitUp": 0\n }\n }\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/uplinkSettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["bandwidthLimits": [
"cellular": [
"limitDown": 0,
"limitUp": 0
],
"wan1": [
"limitDown": 0,
"limitUp": 0
],
"wan2": [
"limitDown": 0,
"limitUp": 0
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/uplinkSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bandwidthLimits": {
"cellular": {
"limitDown": 51200,
"limitUp": 51200
},
"wan1": {
"limitDown": 1000000,
"limitUp": 1000000
},
"wan2": {
"limitDown": 1000000,
"limitUp": 1000000
}
}
}
POST
Add a VLAN
{{baseUrl}}/networks/:networkId/vlans
QUERY PARAMS
networkId
BODY json
{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlans");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/networks/:networkId/vlans" {:content-type :json
:form-params {:applianceIp ""
:groupPolicyId ""
:id ""
:name ""
:subnet ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlans"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/vlans"),
Content = new StringContent("{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlans");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlans"
payload := strings.NewReader("{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/networks/:networkId/vlans HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/networks/:networkId/vlans")
.setHeader("content-type", "application/json")
.setBody("{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlans"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/networks/:networkId/vlans")
.header("content-type", "application/json")
.body("{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
.asString();
const data = JSON.stringify({
applianceIp: '',
groupPolicyId: '',
id: '',
name: '',
subnet: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/networks/:networkId/vlans');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/vlans',
headers: {'content-type': 'application/json'},
data: {applianceIp: '', groupPolicyId: '', id: '', name: '', subnet: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applianceIp":"","groupPolicyId":"","id":"","name":"","subnet":""}'
};
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}}/networks/:networkId/vlans',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "applianceIp": "",\n "groupPolicyId": "",\n "id": "",\n "name": "",\n "subnet": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlans',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({applianceIp: '', groupPolicyId: '', id: '', name: '', subnet: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/vlans',
headers: {'content-type': 'application/json'},
body: {applianceIp: '', groupPolicyId: '', id: '', name: '', subnet: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/networks/:networkId/vlans');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
applianceIp: '',
groupPolicyId: '',
id: '',
name: '',
subnet: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/networks/:networkId/vlans',
headers: {'content-type': 'application/json'},
data: {applianceIp: '', groupPolicyId: '', id: '', name: '', subnet: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applianceIp":"","groupPolicyId":"","id":"","name":"","subnet":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"applianceIp": @"",
@"groupPolicyId": @"",
@"id": @"",
@"name": @"",
@"subnet": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/vlans"]
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}}/networks/:networkId/vlans" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'applianceIp' => '',
'groupPolicyId' => '',
'id' => '',
'name' => '',
'subnet' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/networks/:networkId/vlans', [
'body' => '{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlans');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'applianceIp' => '',
'groupPolicyId' => '',
'id' => '',
'name' => '',
'subnet' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'applianceIp' => '',
'groupPolicyId' => '',
'id' => '',
'name' => '',
'subnet' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/vlans');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/networks/:networkId/vlans", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlans"
payload = {
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlans"
payload <- "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/networks/:networkId/vlans') do |req|
req.body = "{\n \"applianceIp\": \"\",\n \"groupPolicyId\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"subnet\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlans";
let payload = json!({
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/networks/:networkId/vlans \
--header 'content-type: application/json' \
--data '{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}'
echo '{
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
}' | \
http POST {{baseUrl}}/networks/:networkId/vlans \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "applianceIp": "",\n "groupPolicyId": "",\n "id": "",\n "name": "",\n "subnet": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/vlans
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"applianceIp": "",
"groupPolicyId": "",
"id": "",
"name": "",
"subnet": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlans")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"applianceIp": "192.168.1.2",
"cidr": "192.168.1.0/24",
"dhcpBootFilename": "sample.file",
"dhcpBootNextServer": "1.2.3.4",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "Run a DHCP server",
"dhcpLeaseTime": "1 day",
"dhcpOptions": [],
"dnsNameservers": "google_dns",
"fixedIpAssignments": {},
"groupPolicyId": "101",
"id": "1234",
"ipv6": {
"enabled": true,
"prefixAssignments": [
{
"autonomous": false,
"origin": {
"interfaces": [
"wan0"
],
"type": "internet"
},
"staticApplianceIp6": "2001:db8:3c4d:15::1",
"staticPrefix": "2001:db8:3c4d:15::/64"
}
]
},
"mandatoryDhcp": {
"enabled": true
},
"mask": 28,
"name": "My VLAN",
"networkId": "N_24329156",
"reservedIpRanges": [],
"subnet": "192.168.1.0/24",
"templateVlanType": "same"
}
DELETE
Delete a VLAN from a network
{{baseUrl}}/networks/:networkId/vlans/:vlanId
QUERY PARAMS
networkId
vlanId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlans/:vlanId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/networks/:networkId/vlans/:vlanId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
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}}/networks/:networkId/vlans/:vlanId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlans/:vlanId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
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/networks/:networkId/vlans/:vlanId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlans/:vlanId"))
.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}}/networks/:networkId/vlans/:vlanId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.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}}/networks/:networkId/vlans/:vlanId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/networks/:networkId/vlans/:vlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
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}}/networks/:networkId/vlans/:vlanId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlans/:vlanId',
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}}/networks/:networkId/vlans/:vlanId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/networks/:networkId/vlans/:vlanId');
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}}/networks/:networkId/vlans/:vlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
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}}/networks/:networkId/vlans/:vlanId"]
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}}/networks/:networkId/vlans/:vlanId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlans/:vlanId",
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}}/networks/:networkId/vlans/:vlanId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/networks/:networkId/vlans/:vlanId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
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/networks/:networkId/vlans/:vlanId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId";
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}}/networks/:networkId/vlans/:vlanId
http DELETE {{baseUrl}}/networks/:networkId/vlans/:vlanId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/networks/:networkId/vlans/:vlanId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlans/:vlanId")! 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()
PUT
Enable-Disable VLANs for the given network
{{baseUrl}}/networks/:networkId/vlansEnabledState
QUERY PARAMS
networkId
BODY json
{
"enabled": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlansEnabledState");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"enabled\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/vlansEnabledState" {:content-type :json
:form-params {:enabled false}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlansEnabledState"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"enabled\": false\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/vlansEnabledState"),
Content = new StringContent("{\n \"enabled\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlansEnabledState");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"enabled\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlansEnabledState"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/vlansEnabledState HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"enabled": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/vlansEnabledState")
.setHeader("content-type", "application/json")
.setBody("{\n \"enabled\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlansEnabledState"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"enabled\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"enabled\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlansEnabledState")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/vlansEnabledState")
.header("content-type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();
const data = JSON.stringify({
enabled: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/vlansEnabledState');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlansEnabledState',
headers: {'content-type': 'application/json'},
data: {enabled: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlansEnabledState';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false}'
};
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}}/networks/:networkId/vlansEnabledState',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "enabled": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"enabled\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlansEnabledState")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlansEnabledState',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({enabled: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlansEnabledState',
headers: {'content-type': 'application/json'},
body: {enabled: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/vlansEnabledState');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
enabled: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlansEnabledState',
headers: {'content-type': 'application/json'},
data: {enabled: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlansEnabledState';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"enabled":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"enabled": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/vlansEnabledState"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/vlansEnabledState" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"enabled\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlansEnabledState",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/vlansEnabledState', [
'body' => '{
"enabled": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlansEnabledState');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'enabled' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'enabled' => null
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/vlansEnabledState');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlansEnabledState' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlansEnabledState' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"enabled": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"enabled\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/vlansEnabledState", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlansEnabledState"
payload = { "enabled": False }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlansEnabledState"
payload <- "{\n \"enabled\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlansEnabledState")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/vlansEnabledState') do |req|
req.body = "{\n \"enabled\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlansEnabledState";
let payload = json!({"enabled": false});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/vlansEnabledState \
--header 'content-type: application/json' \
--data '{
"enabled": false
}'
echo '{
"enabled": false
}' | \
http PUT {{baseUrl}}/networks/:networkId/vlansEnabledState \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "enabled": false\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/vlansEnabledState
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["enabled": false] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlansEnabledState")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"networkId": "N_24329156"
}
GET
List the VLANs for an MX network
{{baseUrl}}/networks/:networkId/vlans
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlans");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/vlans")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlans"
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}}/networks/:networkId/vlans"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlans");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlans"
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/networks/:networkId/vlans HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/vlans")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlans"))
.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}}/networks/:networkId/vlans")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/vlans")
.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}}/networks/:networkId/vlans');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/networks/:networkId/vlans'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlans';
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}}/networks/:networkId/vlans',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlans',
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}}/networks/:networkId/vlans'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/vlans');
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}}/networks/:networkId/vlans'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlans';
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}}/networks/:networkId/vlans"]
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}}/networks/:networkId/vlans" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlans",
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}}/networks/:networkId/vlans');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlans');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/vlans');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlans' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlans' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/vlans")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlans"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlans"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlans")
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/networks/:networkId/vlans') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlans";
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}}/networks/:networkId/vlans
http GET {{baseUrl}}/networks/:networkId/vlans
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/vlans
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlans")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"applianceIp": "192.168.1.2",
"cidr": "192.168.1.0/24",
"dhcpBootFilename": "sample.file",
"dhcpBootNextServer": "1.2.3.4",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "Run a DHCP server",
"dhcpLeaseTime": "1 day",
"dhcpOptions": [
{
"code": "5",
"type": "text",
"value": "five"
}
],
"dhcpRelayServerIps": [
"192.168.1.0/24",
"192.168.128.0/24"
],
"dnsNameservers": "google_dns",
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"groupPolicyId": "101",
"id": "1234",
"ipv6": {
"enabled": true,
"prefixAssignments": [
{
"autonomous": false,
"origin": {
"interfaces": [
"wan0"
],
"type": "internet"
},
"staticApplianceIp6": "2001:db8:3c4d:15::1",
"staticPrefix": "2001:db8:3c4d:15::/64"
}
]
},
"mandatoryDhcp": {
"enabled": true
},
"mask": 28,
"name": "My VLAN",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24",
"templateVlanType": "same",
"vpnNatSubnet": "192.168.1.0/24"
}
]
GET
Return a VLAN
{{baseUrl}}/networks/:networkId/vlans/:vlanId
QUERY PARAMS
networkId
vlanId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlans/:vlanId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/vlans/:vlanId")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
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}}/networks/:networkId/vlans/:vlanId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlans/:vlanId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
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/networks/:networkId/vlans/:vlanId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlans/:vlanId"))
.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}}/networks/:networkId/vlans/:vlanId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.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}}/networks/:networkId/vlans/:vlanId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/vlans/:vlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
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}}/networks/:networkId/vlans/:vlanId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlans/:vlanId',
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}}/networks/:networkId/vlans/:vlanId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/vlans/:vlanId');
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}}/networks/:networkId/vlans/:vlanId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
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}}/networks/:networkId/vlans/:vlanId"]
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}}/networks/:networkId/vlans/:vlanId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlans/:vlanId",
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}}/networks/:networkId/vlans/:vlanId');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/vlans/:vlanId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
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/networks/:networkId/vlans/:vlanId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId";
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}}/networks/:networkId/vlans/:vlanId
http GET {{baseUrl}}/networks/:networkId/vlans/:vlanId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/vlans/:vlanId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlans/:vlanId")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"applianceIp": "192.168.1.2",
"cidr": "192.168.1.0/24",
"dhcpBootFilename": "sample.file",
"dhcpBootNextServer": "1.2.3.4",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "Run a DHCP server",
"dhcpLeaseTime": "1 day",
"dhcpOptions": [
{
"code": "5",
"type": "text",
"value": "five"
}
],
"dhcpRelayServerIps": [
"192.168.1.0/24",
"192.168.128.0/24"
],
"dnsNameservers": "google_dns",
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"groupPolicyId": "101",
"id": "1234",
"ipv6": {
"enabled": true,
"prefixAssignments": [
{
"autonomous": false,
"origin": {
"interfaces": [
"wan0"
],
"type": "internet"
},
"staticApplianceIp6": "2001:db8:3c4d:15::1",
"staticPrefix": "2001:db8:3c4d:15::/64"
}
]
},
"mandatoryDhcp": {
"enabled": true
},
"mask": 28,
"name": "My VLAN",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24",
"templateVlanType": "same",
"vpnNatSubnet": "192.168.1.0/24"
}
GET
Returns the enabled status of VLANs for the network
{{baseUrl}}/networks/:networkId/vlansEnabledState
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlansEnabledState");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/vlansEnabledState")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlansEnabledState"
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}}/networks/:networkId/vlansEnabledState"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlansEnabledState");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlansEnabledState"
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/networks/:networkId/vlansEnabledState HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/vlansEnabledState")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlansEnabledState"))
.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}}/networks/:networkId/vlansEnabledState")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/vlansEnabledState")
.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}}/networks/:networkId/vlansEnabledState');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/vlansEnabledState'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlansEnabledState';
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}}/networks/:networkId/vlansEnabledState',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlansEnabledState")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlansEnabledState',
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}}/networks/:networkId/vlansEnabledState'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/vlansEnabledState');
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}}/networks/:networkId/vlansEnabledState'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlansEnabledState';
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}}/networks/:networkId/vlansEnabledState"]
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}}/networks/:networkId/vlansEnabledState" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlansEnabledState",
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}}/networks/:networkId/vlansEnabledState');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlansEnabledState');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/vlansEnabledState');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlansEnabledState' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlansEnabledState' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/vlansEnabledState")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlansEnabledState"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlansEnabledState"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlansEnabledState")
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/networks/:networkId/vlansEnabledState') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlansEnabledState";
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}}/networks/:networkId/vlansEnabledState
http GET {{baseUrl}}/networks/:networkId/vlansEnabledState
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/vlansEnabledState
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlansEnabledState")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"enabled": true,
"networkId": "N_24329156"
}
PUT
Update a VLAN
{{baseUrl}}/networks/:networkId/vlans/:vlanId
QUERY PARAMS
networkId
vlanId
BODY json
{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/vlans/:vlanId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/vlans/:vlanId" {:content-type :json
:form-params {:applianceIp ""
:dhcpBootFilename ""
:dhcpBootNextServer ""
:dhcpBootOptionsEnabled false
:dhcpHandling ""
:dhcpLeaseTime ""
:dhcpOptions [{:code ""
:type ""
:value ""}]
:dhcpRelayServerIps []
:dnsNameservers ""
:fixedIpAssignments {}
:groupPolicyId ""
:name ""
:reservedIpRanges [{:comment ""
:end ""
:start ""}]
:subnet ""
:vpnNatSubnet ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/vlans/:vlanId"),
Content = new StringContent("{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/vlans/:vlanId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
payload := strings.NewReader("{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/vlans/:vlanId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 499
{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.setHeader("content-type", "application/json")
.setBody("{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/vlans/:vlanId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.header("content-type", "application/json")
.body("{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}")
.asString();
const data = JSON.stringify({
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [
{
code: '',
type: '',
value: ''
}
],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
],
subnet: '',
vpnNatSubnet: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/vlans/:vlanId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlans/:vlanId',
headers: {'content-type': 'application/json'},
data: {
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [{code: '', type: '', value: ''}],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: '',
vpnNatSubnet: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"applianceIp":"","dhcpBootFilename":"","dhcpBootNextServer":"","dhcpBootOptionsEnabled":false,"dhcpHandling":"","dhcpLeaseTime":"","dhcpOptions":[{"code":"","type":"","value":""}],"dhcpRelayServerIps":[],"dnsNameservers":"","fixedIpAssignments":{},"groupPolicyId":"","name":"","reservedIpRanges":[{"comment":"","end":"","start":""}],"subnet":"","vpnNatSubnet":""}'
};
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}}/networks/:networkId/vlans/:vlanId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "applianceIp": "",\n "dhcpBootFilename": "",\n "dhcpBootNextServer": "",\n "dhcpBootOptionsEnabled": false,\n "dhcpHandling": "",\n "dhcpLeaseTime": "",\n "dhcpOptions": [\n {\n "code": "",\n "type": "",\n "value": ""\n }\n ],\n "dhcpRelayServerIps": [],\n "dnsNameservers": "",\n "fixedIpAssignments": {},\n "groupPolicyId": "",\n "name": "",\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ],\n "subnet": "",\n "vpnNatSubnet": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/vlans/:vlanId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [{code: '', type: '', value: ''}],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: '',
vpnNatSubnet: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlans/:vlanId',
headers: {'content-type': 'application/json'},
body: {
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [{code: '', type: '', value: ''}],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: '',
vpnNatSubnet: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/vlans/:vlanId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [
{
code: '',
type: '',
value: ''
}
],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [
{
comment: '',
end: '',
start: ''
}
],
subnet: '',
vpnNatSubnet: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/vlans/:vlanId',
headers: {'content-type': 'application/json'},
data: {
applianceIp: '',
dhcpBootFilename: '',
dhcpBootNextServer: '',
dhcpBootOptionsEnabled: false,
dhcpHandling: '',
dhcpLeaseTime: '',
dhcpOptions: [{code: '', type: '', value: ''}],
dhcpRelayServerIps: [],
dnsNameservers: '',
fixedIpAssignments: {},
groupPolicyId: '',
name: '',
reservedIpRanges: [{comment: '', end: '', start: ''}],
subnet: '',
vpnNatSubnet: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/vlans/:vlanId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"applianceIp":"","dhcpBootFilename":"","dhcpBootNextServer":"","dhcpBootOptionsEnabled":false,"dhcpHandling":"","dhcpLeaseTime":"","dhcpOptions":[{"code":"","type":"","value":""}],"dhcpRelayServerIps":[],"dnsNameservers":"","fixedIpAssignments":{},"groupPolicyId":"","name":"","reservedIpRanges":[{"comment":"","end":"","start":""}],"subnet":"","vpnNatSubnet":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"applianceIp": @"",
@"dhcpBootFilename": @"",
@"dhcpBootNextServer": @"",
@"dhcpBootOptionsEnabled": @NO,
@"dhcpHandling": @"",
@"dhcpLeaseTime": @"",
@"dhcpOptions": @[ @{ @"code": @"", @"type": @"", @"value": @"" } ],
@"dhcpRelayServerIps": @[ ],
@"dnsNameservers": @"",
@"fixedIpAssignments": @{ },
@"groupPolicyId": @"",
@"name": @"",
@"reservedIpRanges": @[ @{ @"comment": @"", @"end": @"", @"start": @"" } ],
@"subnet": @"",
@"vpnNatSubnet": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/vlans/:vlanId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/vlans/:vlanId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/vlans/:vlanId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'applianceIp' => '',
'dhcpBootFilename' => '',
'dhcpBootNextServer' => '',
'dhcpBootOptionsEnabled' => null,
'dhcpHandling' => '',
'dhcpLeaseTime' => '',
'dhcpOptions' => [
[
'code' => '',
'type' => '',
'value' => ''
]
],
'dhcpRelayServerIps' => [
],
'dnsNameservers' => '',
'fixedIpAssignments' => [
],
'groupPolicyId' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => '',
'vpnNatSubnet' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/vlans/:vlanId', [
'body' => '{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'applianceIp' => '',
'dhcpBootFilename' => '',
'dhcpBootNextServer' => '',
'dhcpBootOptionsEnabled' => null,
'dhcpHandling' => '',
'dhcpLeaseTime' => '',
'dhcpOptions' => [
[
'code' => '',
'type' => '',
'value' => ''
]
],
'dhcpRelayServerIps' => [
],
'dnsNameservers' => '',
'fixedIpAssignments' => [
],
'groupPolicyId' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => '',
'vpnNatSubnet' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'applianceIp' => '',
'dhcpBootFilename' => '',
'dhcpBootNextServer' => '',
'dhcpBootOptionsEnabled' => null,
'dhcpHandling' => '',
'dhcpLeaseTime' => '',
'dhcpOptions' => [
[
'code' => '',
'type' => '',
'value' => ''
]
],
'dhcpRelayServerIps' => [
],
'dnsNameservers' => '',
'fixedIpAssignments' => [
],
'groupPolicyId' => '',
'name' => '',
'reservedIpRanges' => [
[
'comment' => '',
'end' => '',
'start' => ''
]
],
'subnet' => '',
'vpnNatSubnet' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/vlans/:vlanId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/vlans/:vlanId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/vlans/:vlanId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
payload = {
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": False,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/vlans/:vlanId"
payload <- "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/vlans/:vlanId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/vlans/:vlanId') do |req|
req.body = "{\n \"applianceIp\": \"\",\n \"dhcpBootFilename\": \"\",\n \"dhcpBootNextServer\": \"\",\n \"dhcpBootOptionsEnabled\": false,\n \"dhcpHandling\": \"\",\n \"dhcpLeaseTime\": \"\",\n \"dhcpOptions\": [\n {\n \"code\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"dhcpRelayServerIps\": [],\n \"dnsNameservers\": \"\",\n \"fixedIpAssignments\": {},\n \"groupPolicyId\": \"\",\n \"name\": \"\",\n \"reservedIpRanges\": [\n {\n \"comment\": \"\",\n \"end\": \"\",\n \"start\": \"\"\n }\n ],\n \"subnet\": \"\",\n \"vpnNatSubnet\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/vlans/:vlanId";
let payload = json!({
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": (
json!({
"code": "",
"type": "",
"value": ""
})
),
"dhcpRelayServerIps": (),
"dnsNameservers": "",
"fixedIpAssignments": json!({}),
"groupPolicyId": "",
"name": "",
"reservedIpRanges": (
json!({
"comment": "",
"end": "",
"start": ""
})
),
"subnet": "",
"vpnNatSubnet": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/vlans/:vlanId \
--header 'content-type: application/json' \
--data '{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}'
echo '{
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
{
"code": "",
"type": "",
"value": ""
}
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": {},
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
{
"comment": "",
"end": "",
"start": ""
}
],
"subnet": "",
"vpnNatSubnet": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/vlans/:vlanId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "applianceIp": "",\n "dhcpBootFilename": "",\n "dhcpBootNextServer": "",\n "dhcpBootOptionsEnabled": false,\n "dhcpHandling": "",\n "dhcpLeaseTime": "",\n "dhcpOptions": [\n {\n "code": "",\n "type": "",\n "value": ""\n }\n ],\n "dhcpRelayServerIps": [],\n "dnsNameservers": "",\n "fixedIpAssignments": {},\n "groupPolicyId": "",\n "name": "",\n "reservedIpRanges": [\n {\n "comment": "",\n "end": "",\n "start": ""\n }\n ],\n "subnet": "",\n "vpnNatSubnet": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/vlans/:vlanId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"applianceIp": "",
"dhcpBootFilename": "",
"dhcpBootNextServer": "",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "",
"dhcpLeaseTime": "",
"dhcpOptions": [
[
"code": "",
"type": "",
"value": ""
]
],
"dhcpRelayServerIps": [],
"dnsNameservers": "",
"fixedIpAssignments": [],
"groupPolicyId": "",
"name": "",
"reservedIpRanges": [
[
"comment": "",
"end": "",
"start": ""
]
],
"subnet": "",
"vpnNatSubnet": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/vlans/:vlanId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"applianceIp": "192.168.1.2",
"cidr": "192.168.1.0/24",
"dhcpBootFilename": "sample.file",
"dhcpBootNextServer": "1.2.3.4",
"dhcpBootOptionsEnabled": false,
"dhcpHandling": "Run a DHCP server",
"dhcpLeaseTime": "1 day",
"dhcpOptions": [
{
"code": "5",
"type": "text",
"value": "five"
}
],
"dhcpRelayServerIps": [
"192.168.1.0/24",
"192.168.128.0/24"
],
"dnsNameservers": "google_dns",
"fixedIpAssignments": {
"22:33:44:55:66:77": {
"ip": "1.2.3.4",
"name": "Some client name"
}
},
"groupPolicyId": "101",
"id": "1234",
"ipv6": {
"enabled": true,
"prefixAssignments": [
{
"autonomous": false,
"origin": {
"interfaces": [
"wan0"
],
"type": "internet"
},
"staticApplianceIp6": "2001:db8:3c4d:15::1",
"staticPrefix": "2001:db8:3c4d:15::/64"
}
]
},
"mandatoryDhcp": {
"enabled": true
},
"mask": 28,
"name": "My VLAN",
"networkId": "N_24329156",
"reservedIpRanges": [
{
"comment": "A reserved IP range",
"end": "192.168.1.1",
"start": "192.168.1.0"
}
],
"subnet": "192.168.1.0/24",
"templateVlanType": "same",
"vpnNatSubnet": "192.168.1.0/24"
}
GET
Aggregated connectivity info for a given AP on this network
{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats"
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}}/networks/:networkId/devices/:serial/connectionStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats"
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/networks/:networkId/devices/:serial/connectionStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats"))
.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}}/networks/:networkId/devices/:serial/connectionStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")
.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}}/networks/:networkId/devices/:serial/connectionStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats';
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}}/networks/:networkId/devices/:serial/connectionStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/connectionStats',
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}}/networks/:networkId/devices/:serial/connectionStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats');
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}}/networks/:networkId/devices/:serial/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats';
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}}/networks/:networkId/devices/:serial/connectionStats"]
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}}/networks/:networkId/devices/:serial/connectionStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats",
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}}/networks/:networkId/devices/:serial/connectionStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/connectionStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")
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/networks/:networkId/devices/:serial/connectionStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats";
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}}/networks/:networkId/devices/:serial/connectionStats
http GET {{baseUrl}}/networks/:networkId/devices/:serial/connectionStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/connectionStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/connectionStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionStats": {
"assoc": 0,
"auth": 1,
"dhcp": 0,
"dns": 0,
"success": 43
},
"serial": "Q2JC-2MJM-FHRD"
}
GET
Aggregated connectivity info for a given client on this network
{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats"
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}}/networks/:networkId/clients/:clientId/connectionStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats"
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/networks/:networkId/clients/:clientId/connectionStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats"))
.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}}/networks/:networkId/clients/:clientId/connectionStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")
.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}}/networks/:networkId/clients/:clientId/connectionStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats';
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}}/networks/:networkId/clients/:clientId/connectionStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/connectionStats',
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}}/networks/:networkId/clients/:clientId/connectionStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats');
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}}/networks/:networkId/clients/:clientId/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats';
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}}/networks/:networkId/clients/:clientId/connectionStats"]
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}}/networks/:networkId/clients/:clientId/connectionStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats",
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}}/networks/:networkId/clients/:clientId/connectionStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/connectionStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")
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/networks/:networkId/clients/:clientId/connectionStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats";
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}}/networks/:networkId/clients/:clientId/connectionStats
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/connectionStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionStats": {
"assoc": 0,
"auth": 4,
"dhcp": 0,
"dns": 0,
"success": 10
},
"mac": "00:61:71:c8:51:27"
}
GET
Aggregated connectivity info for this network, grouped by clients
{{baseUrl}}/networks/:networkId/clients/connectionStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/connectionStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/connectionStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/connectionStats"
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}}/networks/:networkId/clients/connectionStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/connectionStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/connectionStats"
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/networks/:networkId/clients/connectionStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/connectionStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/connectionStats"))
.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}}/networks/:networkId/clients/connectionStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/connectionStats")
.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}}/networks/:networkId/clients/connectionStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/connectionStats';
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}}/networks/:networkId/clients/connectionStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/connectionStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/connectionStats',
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}}/networks/:networkId/clients/connectionStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/connectionStats');
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}}/networks/:networkId/clients/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/connectionStats';
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}}/networks/:networkId/clients/connectionStats"]
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}}/networks/:networkId/clients/connectionStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/connectionStats",
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}}/networks/:networkId/clients/connectionStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/connectionStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/connectionStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/connectionStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/connectionStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/connectionStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/connectionStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/connectionStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/connectionStats")
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/networks/:networkId/clients/connectionStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/connectionStats";
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}}/networks/:networkId/clients/connectionStats
http GET {{baseUrl}}/networks/:networkId/clients/connectionStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/connectionStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/connectionStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"connectionStats": {
"assoc": 0,
"auth": 4,
"dhcp": 0,
"dns": 0,
"success": 10
},
"mac": "00:61:71:c8:51:27"
},
{
"connectionStats": {
"assoc": 0,
"auth": 1,
"dhcp": 0,
"dns": 0,
"success": 24
},
"mac": "1c:4d:70:7f:5e:5e"
},
{
"connectionStats": {
"assoc": 1,
"auth": 0,
"dhcp": 0,
"dns": 0,
"success": 16
},
"mac": "1c:4d:70:81:8d:0a"
}
]
GET
Aggregated connectivity info for this network, grouped by node
{{baseUrl}}/networks/:networkId/devices/connectionStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/connectionStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/connectionStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/connectionStats"
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}}/networks/:networkId/devices/connectionStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/connectionStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/connectionStats"
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/networks/:networkId/devices/connectionStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/connectionStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/connectionStats"))
.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}}/networks/:networkId/devices/connectionStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/connectionStats")
.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}}/networks/:networkId/devices/connectionStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/connectionStats';
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}}/networks/:networkId/devices/connectionStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/connectionStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/connectionStats',
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}}/networks/:networkId/devices/connectionStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/connectionStats');
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}}/networks/:networkId/devices/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/connectionStats';
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}}/networks/:networkId/devices/connectionStats"]
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}}/networks/:networkId/devices/connectionStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/connectionStats",
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}}/networks/:networkId/devices/connectionStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/connectionStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/connectionStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/connectionStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/connectionStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/connectionStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/connectionStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/connectionStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/connectionStats")
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/networks/:networkId/devices/connectionStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/connectionStats";
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}}/networks/:networkId/devices/connectionStats
http GET {{baseUrl}}/networks/:networkId/devices/connectionStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/connectionStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/connectionStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"connectionStats": {
"assoc": 0,
"auth": 1,
"dhcp": 0,
"dns": 0,
"success": 43
},
"serial": "Q2JC-2MJM-FHRD"
},
{
"connectionStats": {
"assoc": 1,
"auth": 4,
"dhcp": 0,
"dns": 0,
"success": 8
},
"serial": "Q2FJ-3SHB-Y2K2"
}
]
GET
Aggregated connectivity info for this network
{{baseUrl}}/networks/:networkId/connectionStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/connectionStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/connectionStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/connectionStats"
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}}/networks/:networkId/connectionStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/connectionStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/connectionStats"
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/networks/:networkId/connectionStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/connectionStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/connectionStats"))
.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}}/networks/:networkId/connectionStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/connectionStats")
.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}}/networks/:networkId/connectionStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/connectionStats';
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}}/networks/:networkId/connectionStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/connectionStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/connectionStats',
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}}/networks/:networkId/connectionStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/connectionStats');
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}}/networks/:networkId/connectionStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/connectionStats';
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}}/networks/:networkId/connectionStats"]
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}}/networks/:networkId/connectionStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/connectionStats",
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}}/networks/:networkId/connectionStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/connectionStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/connectionStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/connectionStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/connectionStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/connectionStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/connectionStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/connectionStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/connectionStats")
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/networks/:networkId/connectionStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/connectionStats";
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}}/networks/:networkId/connectionStats
http GET {{baseUrl}}/networks/:networkId/connectionStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/connectionStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/connectionStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"assoc": 1,
"auth": 5,
"dhcp": 0,
"dns": 0,
"success": 51
}
GET
Aggregated latency info for a given AP on this network
{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats
QUERY PARAMS
networkId
serial
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats"
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}}/networks/:networkId/devices/:serial/latencyStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats"
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/networks/:networkId/devices/:serial/latencyStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats"))
.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}}/networks/:networkId/devices/:serial/latencyStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")
.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}}/networks/:networkId/devices/:serial/latencyStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats';
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}}/networks/:networkId/devices/:serial/latencyStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/:serial/latencyStats',
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}}/networks/:networkId/devices/:serial/latencyStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats');
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}}/networks/:networkId/devices/:serial/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats';
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}}/networks/:networkId/devices/:serial/latencyStats"]
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}}/networks/:networkId/devices/:serial/latencyStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats",
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}}/networks/:networkId/devices/:serial/latencyStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/:serial/latencyStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")
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/networks/:networkId/devices/:serial/latencyStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats";
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}}/networks/:networkId/devices/:serial/latencyStats
http GET {{baseUrl}}/networks/:networkId/devices/:serial/latencyStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/:serial/latencyStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/:serial/latencyStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"serial": "Q2JC-2MJM-FHRD"
}
GET
Aggregated latency info for a given client on this network
{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats
QUERY PARAMS
networkId
clientId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats"
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}}/networks/:networkId/clients/:clientId/latencyStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats"
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/networks/:networkId/clients/:clientId/latencyStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats"))
.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}}/networks/:networkId/clients/:clientId/latencyStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")
.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}}/networks/:networkId/clients/:clientId/latencyStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats';
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}}/networks/:networkId/clients/:clientId/latencyStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/:clientId/latencyStats',
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}}/networks/:networkId/clients/:clientId/latencyStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats');
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}}/networks/:networkId/clients/:clientId/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats';
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}}/networks/:networkId/clients/:clientId/latencyStats"]
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}}/networks/:networkId/clients/:clientId/latencyStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats",
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}}/networks/:networkId/clients/:clientId/latencyStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/:clientId/latencyStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")
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/networks/:networkId/clients/:clientId/latencyStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats";
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}}/networks/:networkId/clients/:clientId/latencyStats
http GET {{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/:clientId/latencyStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"mac": "00:61:71:c8:51:27"
}
GET
Aggregated latency info for this network, grouped by clients
{{baseUrl}}/networks/:networkId/clients/latencyStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/clients/latencyStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/clients/latencyStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/clients/latencyStats"
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}}/networks/:networkId/clients/latencyStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/clients/latencyStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/clients/latencyStats"
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/networks/:networkId/clients/latencyStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/clients/latencyStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/clients/latencyStats"))
.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}}/networks/:networkId/clients/latencyStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/clients/latencyStats")
.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}}/networks/:networkId/clients/latencyStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/clients/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/clients/latencyStats';
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}}/networks/:networkId/clients/latencyStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/clients/latencyStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/clients/latencyStats',
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}}/networks/:networkId/clients/latencyStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/clients/latencyStats');
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}}/networks/:networkId/clients/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/clients/latencyStats';
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}}/networks/:networkId/clients/latencyStats"]
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}}/networks/:networkId/clients/latencyStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/clients/latencyStats",
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}}/networks/:networkId/clients/latencyStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/clients/latencyStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/clients/latencyStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/clients/latencyStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/clients/latencyStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/clients/latencyStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/clients/latencyStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/clients/latencyStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/clients/latencyStats")
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/networks/:networkId/clients/latencyStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/clients/latencyStats";
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}}/networks/:networkId/clients/latencyStats
http GET {{baseUrl}}/networks/:networkId/clients/latencyStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/clients/latencyStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/clients/latencyStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"mac": "00:61:71:c8:51:27"
},
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"mac": "1c:4d:70:7f:5e:5e"
},
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"mac": "1c:4d:70:81:8d:0a"
}
]
GET
Aggregated latency info for this network, grouped by node
{{baseUrl}}/networks/:networkId/devices/latencyStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/devices/latencyStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/devices/latencyStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/devices/latencyStats"
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}}/networks/:networkId/devices/latencyStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/devices/latencyStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/devices/latencyStats"
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/networks/:networkId/devices/latencyStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/devices/latencyStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/devices/latencyStats"))
.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}}/networks/:networkId/devices/latencyStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/devices/latencyStats")
.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}}/networks/:networkId/devices/latencyStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/devices/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/devices/latencyStats';
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}}/networks/:networkId/devices/latencyStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/devices/latencyStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/devices/latencyStats',
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}}/networks/:networkId/devices/latencyStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/devices/latencyStats');
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}}/networks/:networkId/devices/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/devices/latencyStats';
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}}/networks/:networkId/devices/latencyStats"]
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}}/networks/:networkId/devices/latencyStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/devices/latencyStats",
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}}/networks/:networkId/devices/latencyStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/devices/latencyStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/devices/latencyStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/devices/latencyStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/devices/latencyStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/devices/latencyStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/devices/latencyStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/devices/latencyStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/devices/latencyStats")
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/networks/:networkId/devices/latencyStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/devices/latencyStats";
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}}/networks/:networkId/devices/latencyStats
http GET {{baseUrl}}/networks/:networkId/devices/latencyStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/devices/latencyStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/devices/latencyStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"serial": "Q2JC-2MJM-FHRD"
},
{
"latencyStats": {
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
},
"serial": "Q2FJ-3SHB-Y2K2"
}
]
GET
Aggregated latency info for this network
{{baseUrl}}/networks/:networkId/latencyStats
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/latencyStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/latencyStats")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/latencyStats"
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}}/networks/:networkId/latencyStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/latencyStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/latencyStats"
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/networks/:networkId/latencyStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/latencyStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/latencyStats"))
.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}}/networks/:networkId/latencyStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/latencyStats")
.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}}/networks/:networkId/latencyStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/latencyStats';
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}}/networks/:networkId/latencyStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/latencyStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/latencyStats',
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}}/networks/:networkId/latencyStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/latencyStats');
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}}/networks/:networkId/latencyStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/latencyStats';
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}}/networks/:networkId/latencyStats"]
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}}/networks/:networkId/latencyStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/latencyStats",
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}}/networks/:networkId/latencyStats');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/latencyStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/latencyStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/latencyStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/latencyStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/latencyStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/latencyStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/latencyStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/latencyStats")
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/networks/:networkId/latencyStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/latencyStats";
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}}/networks/:networkId/latencyStats
http GET {{baseUrl}}/networks/:networkId/latencyStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/latencyStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/latencyStats")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"backgroundTraffic": {
"avg": 606.52,
"rawDistribution": {
"0": 1234,
"1": 2345,
"2": 3456,
"4": 4567,
"8": 5678,
"16": 6789,
"32": 7890,
"64": 8901,
"128": 9012,
"256": 83,
"512": 1234,
"1024": 2345,
"2048": 9999
}
},
"bestEffortTraffic": "same shape as backgroundTraffic",
"videoTraffic": "same shape as backgroundTraffic",
"voiceTraffic": "same shape as backgroundTraffic"
}
GET
List of all failed client connection events on this network in a given time range
{{baseUrl}}/networks/:networkId/failedConnections
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/failedConnections");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/failedConnections")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/failedConnections"
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}}/networks/:networkId/failedConnections"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/failedConnections");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/failedConnections"
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/networks/:networkId/failedConnections HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/failedConnections")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/failedConnections"))
.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}}/networks/:networkId/failedConnections")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/failedConnections")
.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}}/networks/:networkId/failedConnections');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/failedConnections'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/failedConnections';
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}}/networks/:networkId/failedConnections',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/failedConnections")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/failedConnections',
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}}/networks/:networkId/failedConnections'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/failedConnections');
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}}/networks/:networkId/failedConnections'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/failedConnections';
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}}/networks/:networkId/failedConnections"]
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}}/networks/:networkId/failedConnections" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/failedConnections",
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}}/networks/:networkId/failedConnections');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/failedConnections');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/failedConnections');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/failedConnections' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/failedConnections' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/failedConnections")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/failedConnections"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/failedConnections"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/failedConnections")
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/networks/:networkId/failedConnections') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/failedConnections";
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}}/networks/:networkId/failedConnections
http GET {{baseUrl}}/networks/:networkId/failedConnections
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/failedConnections
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/failedConnections")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"clientMac": "00:61:71:c8:51:27",
"failureStep": "auth",
"serial": "Q2JC-2MJM-FHRD",
"ssidNumber": 0,
"ts": 1532032592,
"type": "802.1X auth fail",
"vlan": -1
},
{
"clientMac": "00:61:71:c8:51:27",
"failureStep": "auth",
"nodeId": "Q2FJ-3SHB-Y2K2",
"ssidNumber": 0,
"ts": 1532032593,
"type": "802.1X auth fail",
"vlan": -1
},
{
"clientMac": "00:61:71:c8:51:27",
"failureStep": "auth",
"nodeId": "Q2FJ-3SHB-Y2K2",
"ssidNumber": 0,
"ts": 1532032594,
"type": "802.1X auth fail",
"vlan": -1
},
{
"clientMac": "00:61:71:c8:51:27",
"failureStep": "auth",
"nodeId": "Q2FJ-3SHB-Y2K2",
"ssidNumber": 0,
"ts": 1532032595,
"type": "802.1X auth fail",
"vlan": -1
},
{
"clientMac": "1c:4d:70:7f:5e:5e",
"failureStep": "assoc",
"nodeId": "Q2FJ-3SHB-Y2K2",
"ssidNumber": 0,
"ts": 1532032592,
"type": "802.1X auth fail",
"vlan": -1
},
{
"clientMac": "1c:4d:70:81:8d:0a",
"failureStep": "auth",
"nodeId": "Q2FJ-3SHB-Y2K2",
"ssidNumber": 0,
"ts": 1532032595,
"type": "802.1X auth fail",
"vlan": -1
}
]
GET
Return the wireless settings for a network
{{baseUrl}}/networks/:networkId/wireless/settings
QUERY PARAMS
networkId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/networks/:networkId/wireless/settings")
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/settings"
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}}/networks/:networkId/wireless/settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/settings"
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/networks/:networkId/wireless/settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/networks/:networkId/wireless/settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/settings"))
.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}}/networks/:networkId/wireless/settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/networks/:networkId/wireless/settings")
.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}}/networks/:networkId/wireless/settings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/networks/:networkId/wireless/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/settings';
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}}/networks/:networkId/wireless/settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/settings',
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}}/networks/:networkId/wireless/settings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/networks/:networkId/wireless/settings');
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}}/networks/:networkId/wireless/settings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/settings';
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}}/networks/:networkId/wireless/settings"]
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}}/networks/:networkId/wireless/settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/settings",
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}}/networks/:networkId/wireless/settings');
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/networks/:networkId/wireless/settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/settings")
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/networks/:networkId/wireless/settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/settings";
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}}/networks/:networkId/wireless/settings
http GET {{baseUrl}}/networks/:networkId/wireless/settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/settings")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": true,
"upgradeStrategy": "minimizeUpgradeTime"
}
PUT
Update the wireless settings for a network
{{baseUrl}}/networks/:networkId/wireless/settings
QUERY PARAMS
networkId
BODY json
{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/networks/:networkId/wireless/settings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/networks/:networkId/wireless/settings" {:content-type :json
:form-params {:ipv6BridgeEnabled false
:ledLightsOn false
:locationAnalyticsEnabled false
:meshingEnabled false
:upgradeStrategy ""}})
require "http/client"
url = "{{baseUrl}}/networks/:networkId/wireless/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/networks/:networkId/wireless/settings"),
Content = new StringContent("{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/networks/:networkId/wireless/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/networks/:networkId/wireless/settings"
payload := strings.NewReader("{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/networks/:networkId/wireless/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 145
{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/networks/:networkId/wireless/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/networks/:networkId/wireless/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/networks/:networkId/wireless/settings")
.header("content-type", "application/json")
.body("{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}")
.asString();
const data = JSON.stringify({
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/networks/:networkId/wireless/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/settings',
headers: {'content-type': 'application/json'},
data: {
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/networks/:networkId/wireless/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ipv6BridgeEnabled":false,"ledLightsOn":false,"locationAnalyticsEnabled":false,"meshingEnabled":false,"upgradeStrategy":""}'
};
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}}/networks/:networkId/wireless/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ipv6BridgeEnabled": false,\n "ledLightsOn": false,\n "locationAnalyticsEnabled": false,\n "meshingEnabled": false,\n "upgradeStrategy": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/networks/:networkId/wireless/settings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/networks/:networkId/wireless/settings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/settings',
headers: {'content-type': 'application/json'},
body: {
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/networks/:networkId/wireless/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/networks/:networkId/wireless/settings',
headers: {'content-type': 'application/json'},
data: {
ipv6BridgeEnabled: false,
ledLightsOn: false,
locationAnalyticsEnabled: false,
meshingEnabled: false,
upgradeStrategy: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/networks/:networkId/wireless/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ipv6BridgeEnabled":false,"ledLightsOn":false,"locationAnalyticsEnabled":false,"meshingEnabled":false,"upgradeStrategy":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ipv6BridgeEnabled": @NO,
@"ledLightsOn": @NO,
@"locationAnalyticsEnabled": @NO,
@"meshingEnabled": @NO,
@"upgradeStrategy": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/networks/:networkId/wireless/settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/networks/:networkId/wireless/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/networks/:networkId/wireless/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ipv6BridgeEnabled' => null,
'ledLightsOn' => null,
'locationAnalyticsEnabled' => null,
'meshingEnabled' => null,
'upgradeStrategy' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/networks/:networkId/wireless/settings', [
'body' => '{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/networks/:networkId/wireless/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ipv6BridgeEnabled' => null,
'ledLightsOn' => null,
'locationAnalyticsEnabled' => null,
'meshingEnabled' => null,
'upgradeStrategy' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ipv6BridgeEnabled' => null,
'ledLightsOn' => null,
'locationAnalyticsEnabled' => null,
'meshingEnabled' => null,
'upgradeStrategy' => ''
]));
$request->setRequestUrl('{{baseUrl}}/networks/:networkId/wireless/settings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/networks/:networkId/wireless/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/networks/:networkId/wireless/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/networks/:networkId/wireless/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/networks/:networkId/wireless/settings"
payload = {
"ipv6BridgeEnabled": False,
"ledLightsOn": False,
"locationAnalyticsEnabled": False,
"meshingEnabled": False,
"upgradeStrategy": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/networks/:networkId/wireless/settings"
payload <- "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/networks/:networkId/wireless/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/networks/:networkId/wireless/settings') do |req|
req.body = "{\n \"ipv6BridgeEnabled\": false,\n \"ledLightsOn\": false,\n \"locationAnalyticsEnabled\": false,\n \"meshingEnabled\": false,\n \"upgradeStrategy\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/networks/:networkId/wireless/settings";
let payload = json!({
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/networks/:networkId/wireless/settings \
--header 'content-type: application/json' \
--data '{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}'
echo '{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
}' | \
http PUT {{baseUrl}}/networks/:networkId/wireless/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ipv6BridgeEnabled": false,\n "ledLightsOn": false,\n "locationAnalyticsEnabled": false,\n "meshingEnabled": false,\n "upgradeStrategy": ""\n}' \
--output-document \
- {{baseUrl}}/networks/:networkId/wireless/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": false,
"upgradeStrategy": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/networks/:networkId/wireless/settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ipv6BridgeEnabled": false,
"ledLightsOn": false,
"locationAnalyticsEnabled": false,
"meshingEnabled": true,
"upgradeStrategy": "minimizeUpgradeTime"
}