Twilio SendGrid Account Provisioning API
POST
Authenticate an account with single sign on
{{baseUrl}}/v3/partners/accounts/:accountID/sso
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID/sso");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v3/partners/accounts/:accountID/sso")
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID/sso"
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}}/v3/partners/accounts/:accountID/sso"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/accounts/:accountID/sso");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID/sso"
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/v3/partners/accounts/:accountID/sso HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v3/partners/accounts/:accountID/sso")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID/sso"))
.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}}/v3/partners/accounts/:accountID/sso")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v3/partners/accounts/:accountID/sso")
.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}}/v3/partners/accounts/:accountID/sso');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/sso'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/sso';
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}}/v3/partners/accounts/:accountID/sso',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/sso")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/accounts/:accountID/sso',
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}}/v3/partners/accounts/:accountID/sso'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v3/partners/accounts/:accountID/sso');
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}}/v3/partners/accounts/:accountID/sso'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/sso';
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}}/v3/partners/accounts/:accountID/sso"]
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}}/v3/partners/accounts/:accountID/sso" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID/sso",
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}}/v3/partners/accounts/:accountID/sso');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID/sso');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID/sso');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/sso' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/sso' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v3/partners/accounts/:accountID/sso")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID/sso"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID/sso"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/accounts/:accountID/sso")
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/v3/partners/accounts/:accountID/sso') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/accounts/:accountID/sso";
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}}/v3/partners/accounts/:accountID/sso
http POST {{baseUrl}}/v3/partners/accounts/:accountID/sso
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID/sso
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID/sso")! 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
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
POST
Create an account
{{baseUrl}}/v3/partners/accounts
BODY json
{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts");
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 \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v3/partners/accounts" {:content-type :json
:form-params {:profile {:first_name ""
:last_name ""
:company_name ""
:company_website ""
:email ""
:phone ""
:timezone ""}
:offerings [{:name ""
:type ""
:quantity 0}]}})
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\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}}/v3/partners/accounts"),
Content = new StringContent("{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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}}/v3/partners/accounts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts"
payload := strings.NewReader("{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\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/v3/partners/accounts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 259
{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v3/partners/accounts")
.setHeader("content-type", "application/json")
.setBody("{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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 \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v3/partners/accounts")
.header("content-type", "application/json")
.body("{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.asString();
const data = JSON.stringify({
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [
{
name: '',
type: '',
quantity: 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}}/v3/partners/accounts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v3/partners/accounts',
headers: {'content-type': 'application/json'},
data: {
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [{name: '', type: '', quantity: 0}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"profile":{"first_name":"","last_name":"","company_name":"","company_website":"","email":"","phone":"","timezone":""},"offerings":[{"name":"","type":"","quantity":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}}/v3/partners/accounts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "profile": {\n "first_name": "",\n "last_name": "",\n "company_name": "",\n "company_website": "",\n "email": "",\n "phone": "",\n "timezone": ""\n },\n "offerings": [\n {\n "name": "",\n "type": "",\n "quantity": 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 \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts")
.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/v3/partners/accounts',
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({
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [{name: '', type: '', quantity: 0}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v3/partners/accounts',
headers: {'content-type': 'application/json'},
body: {
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [{name: '', type: '', quantity: 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}}/v3/partners/accounts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [
{
name: '',
type: '',
quantity: 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}}/v3/partners/accounts',
headers: {'content-type': 'application/json'},
data: {
profile: {
first_name: '',
last_name: '',
company_name: '',
company_website: '',
email: '',
phone: '',
timezone: ''
},
offerings: [{name: '', type: '', quantity: 0}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"profile":{"first_name":"","last_name":"","company_name":"","company_website":"","email":"","phone":"","timezone":""},"offerings":[{"name":"","type":"","quantity":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 = @{ @"profile": @{ @"first_name": @"", @"last_name": @"", @"company_name": @"", @"company_website": @"", @"email": @"", @"phone": @"", @"timezone": @"" },
@"offerings": @[ @{ @"name": @"", @"type": @"", @"quantity": @0 } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v3/partners/accounts"]
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}}/v3/partners/accounts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts",
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([
'profile' => [
'first_name' => '',
'last_name' => '',
'company_name' => '',
'company_website' => '',
'email' => '',
'phone' => '',
'timezone' => ''
],
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 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}}/v3/partners/accounts', [
'body' => '{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'profile' => [
'first_name' => '',
'last_name' => '',
'company_name' => '',
'company_website' => '',
'email' => '',
'phone' => '',
'timezone' => ''
],
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 0
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'profile' => [
'first_name' => '',
'last_name' => '',
'company_name' => '',
'company_website' => '',
'email' => '',
'phone' => '',
'timezone' => ''
],
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 0
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v3/partners/accounts');
$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}}/v3/partners/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v3/partners/accounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts"
payload = {
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts"
payload <- "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\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}}/v3/partners/accounts")
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 \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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.post('/baseUrl/v3/partners/accounts') do |req|
req.body = "{\n \"profile\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"company_name\": \"\",\n \"company_website\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"timezone\": \"\"\n },\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\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}}/v3/partners/accounts";
let payload = json!({
"profile": json!({
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
}),
"offerings": (
json!({
"name": "",
"type": "",
"quantity": 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}}/v3/partners/accounts \
--header 'content-type: application/json' \
--data '{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
echo '{
"profile": {
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
},
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}' | \
http POST {{baseUrl}}/v3/partners/accounts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "profile": {\n "first_name": "",\n "last_name": "",\n "company_name": "",\n "company_website": "",\n "email": "",\n "phone": "",\n "timezone": ""\n },\n "offerings": [\n {\n "name": "",\n "type": "",\n "quantity": 0\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v3/partners/accounts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"profile": [
"first_name": "",
"last_name": "",
"company_name": "",
"company_website": "",
"email": "",
"phone": "",
"timezone": ""
],
"offerings": [
[
"name": "",
"type": "",
"quantity": 0
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts")! 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
{
"account_id": "sg2a2bcd3ef4ab5c67d8efab91c01de2fa"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
DELETE
Delete an account
{{baseUrl}}/v3/partners/accounts/:accountID
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v3/partners/accounts/:accountID")
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID"
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}}/v3/partners/accounts/:accountID"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/accounts/:accountID");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID"
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/v3/partners/accounts/:accountID HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v3/partners/accounts/:accountID")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID"))
.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}}/v3/partners/accounts/:accountID")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v3/partners/accounts/:accountID")
.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}}/v3/partners/accounts/:accountID');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v3/partners/accounts/:accountID'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID';
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}}/v3/partners/accounts/:accountID',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/accounts/:accountID',
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}}/v3/partners/accounts/:accountID'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v3/partners/accounts/:accountID');
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}}/v3/partners/accounts/:accountID'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID';
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}}/v3/partners/accounts/:accountID"]
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}}/v3/partners/accounts/:accountID" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID",
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}}/v3/partners/accounts/:accountID');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/accounts/:accountID' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v3/partners/accounts/:accountID")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/accounts/:accountID")
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/v3/partners/accounts/:accountID') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/accounts/:accountID";
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}}/v3/partners/accounts/:accountID
http DELETE {{baseUrl}}/v3/partners/accounts/:accountID
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
GET
Get all accounts
{{baseUrl}}/v3/partners/accounts
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v3/partners/accounts")
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts"
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}}/v3/partners/accounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/accounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts"
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/v3/partners/accounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v3/partners/accounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts"))
.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}}/v3/partners/accounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v3/partners/accounts")
.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}}/v3/partners/accounts');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v3/partners/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts';
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}}/v3/partners/accounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/accounts',
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}}/v3/partners/accounts'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v3/partners/accounts');
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}}/v3/partners/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts';
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}}/v3/partners/accounts"]
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}}/v3/partners/accounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts",
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}}/v3/partners/accounts');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/accounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/accounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v3/partners/accounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/accounts")
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/v3/partners/accounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/accounts";
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}}/v3/partners/accounts
http GET {{baseUrl}}/v3/partners/accounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v3/partners/accounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts")! 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
{
"accounts": [
{
"id": "sg2a2bcd3ef4ab5c67d8efab91c01de2fa",
"email": "test@test.com",
"created_at": "2006-01-02T15:04:05Z",
"updated_at": "2009-01-02T15:04:05Z"
},
{
"id": "sg2a2bcd3ef4ab5c67d8efab91c01de2fa",
"email": "testing@test.com",
"created_at": "2006-01-02T15:04:05Z",
"updated_at": "2009-01-02T15:04:05Z"
}
],
"pages": {
"last": "sg2a2bcd3ef4ab5c67d8efab91c01de2fa"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
GET
Get an account's state
{{baseUrl}}/v3/partners/accounts/:accountID/state
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID/state");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v3/partners/accounts/:accountID/state")
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID/state"
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}}/v3/partners/accounts/:accountID/state"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/accounts/:accountID/state");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID/state"
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/v3/partners/accounts/:accountID/state HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v3/partners/accounts/:accountID/state")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID/state"))
.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}}/v3/partners/accounts/:accountID/state")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v3/partners/accounts/:accountID/state")
.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}}/v3/partners/accounts/:accountID/state');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/state'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/state';
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}}/v3/partners/accounts/:accountID/state',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/state")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/accounts/:accountID/state',
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}}/v3/partners/accounts/:accountID/state'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v3/partners/accounts/:accountID/state');
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}}/v3/partners/accounts/:accountID/state'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/state';
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}}/v3/partners/accounts/:accountID/state"]
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}}/v3/partners/accounts/:accountID/state" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID/state",
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}}/v3/partners/accounts/:accountID/state');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID/state');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID/state');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/state' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/state' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v3/partners/accounts/:accountID/state")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID/state"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID/state"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/accounts/:accountID/state")
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/v3/partners/accounts/:accountID/state') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/accounts/:accountID/state";
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}}/v3/partners/accounts/:accountID/state
http GET {{baseUrl}}/v3/partners/accounts/:accountID/state
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID/state
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID/state")! 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
{
"state": "activated"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
PUT
Update an account's state
{{baseUrl}}/v3/partners/accounts/:accountID/state
BODY json
{
"state": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID/state");
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 \"state\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v3/partners/accounts/:accountID/state" {:content-type :json
:form-params {:state ""}})
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID/state"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"state\": \"\"\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}}/v3/partners/accounts/:accountID/state"),
Content = new StringContent("{\n \"state\": \"\"\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}}/v3/partners/accounts/:accountID/state");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"state\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID/state"
payload := strings.NewReader("{\n \"state\": \"\"\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/v3/partners/accounts/:accountID/state HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"state": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v3/partners/accounts/:accountID/state")
.setHeader("content-type", "application/json")
.setBody("{\n \"state\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID/state"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"state\": \"\"\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 \"state\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/state")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v3/partners/accounts/:accountID/state")
.header("content-type", "application/json")
.body("{\n \"state\": \"\"\n}")
.asString();
const data = JSON.stringify({
state: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v3/partners/accounts/:accountID/state');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/state',
headers: {'content-type': 'application/json'},
data: {state: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/state';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"state":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v3/partners/accounts/:accountID/state',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "state": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"state\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/state")
.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/v3/partners/accounts/:accountID/state',
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({state: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/state',
headers: {'content-type': 'application/json'},
body: {state: ''},
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}}/v3/partners/accounts/:accountID/state');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
state: ''
});
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}}/v3/partners/accounts/:accountID/state',
headers: {'content-type': 'application/json'},
data: {state: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/state';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"state":""}'
};
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 = @{ @"state": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v3/partners/accounts/:accountID/state"]
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}}/v3/partners/accounts/:accountID/state" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"state\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID/state",
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([
'state' => ''
]),
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}}/v3/partners/accounts/:accountID/state', [
'body' => '{
"state": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID/state');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'state' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'state' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID/state');
$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}}/v3/partners/accounts/:accountID/state' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"state": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/state' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"state": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"state\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v3/partners/accounts/:accountID/state", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID/state"
payload = { "state": "" }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID/state"
payload <- "{\n \"state\": \"\"\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}}/v3/partners/accounts/:accountID/state")
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 \"state\": \"\"\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/v3/partners/accounts/:accountID/state') do |req|
req.body = "{\n \"state\": \"\"\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}}/v3/partners/accounts/:accountID/state";
let payload = json!({"state": ""});
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}}/v3/partners/accounts/:accountID/state \
--header 'content-type: application/json' \
--data '{
"state": ""
}'
echo '{
"state": ""
}' | \
http PUT {{baseUrl}}/v3/partners/accounts/:accountID/state \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "state": ""\n}' \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID/state
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["state": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID/state")! 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
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
GET
Get account offerings
{{baseUrl}}/v3/partners/accounts/:accountID/offerings
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID/offerings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
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}}/v3/partners/accounts/:accountID/offerings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/accounts/:accountID/offerings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
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/v3/partners/accounts/:accountID/offerings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID/offerings"))
.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}}/v3/partners/accounts/:accountID/offerings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.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}}/v3/partners/accounts/:accountID/offerings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/offerings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/offerings';
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}}/v3/partners/accounts/:accountID/offerings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/accounts/:accountID/offerings',
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}}/v3/partners/accounts/:accountID/offerings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v3/partners/accounts/:accountID/offerings');
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}}/v3/partners/accounts/:accountID/offerings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/offerings';
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}}/v3/partners/accounts/:accountID/offerings"]
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}}/v3/partners/accounts/:accountID/offerings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID/offerings",
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}}/v3/partners/accounts/:accountID/offerings');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID/offerings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID/offerings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/offerings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/offerings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v3/partners/accounts/:accountID/offerings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
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/v3/partners/accounts/:accountID/offerings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/accounts/:accountID/offerings";
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}}/v3/partners/accounts/:accountID/offerings
http GET {{baseUrl}}/v3/partners/accounts/:accountID/offerings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID/offerings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID/offerings")! 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
{
"offerings": [
{
"name": "org.ei.free.v1",
"type": "package",
"quantity": 1
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
GET
Get all available offerings
{{baseUrl}}/v3/partners/offerings
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/offerings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v3/partners/offerings")
require "http/client"
url = "{{baseUrl}}/v3/partners/offerings"
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}}/v3/partners/offerings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v3/partners/offerings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/offerings"
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/v3/partners/offerings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v3/partners/offerings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/offerings"))
.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}}/v3/partners/offerings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v3/partners/offerings")
.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}}/v3/partners/offerings');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v3/partners/offerings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/offerings';
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}}/v3/partners/offerings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/offerings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v3/partners/offerings',
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}}/v3/partners/offerings'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v3/partners/offerings');
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}}/v3/partners/offerings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/offerings';
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}}/v3/partners/offerings"]
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}}/v3/partners/offerings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/offerings",
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}}/v3/partners/offerings');
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/offerings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v3/partners/offerings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v3/partners/offerings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/offerings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v3/partners/offerings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/offerings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/offerings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v3/partners/offerings")
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/v3/partners/offerings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v3/partners/offerings";
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}}/v3/partners/offerings
http GET {{baseUrl}}/v3/partners/offerings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v3/partners/offerings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/offerings")! 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
{
"catalog": [
{
"offering": {
"name": "org.ei.free.v1",
"type": "package",
"quantity": 1
},
"entitlements": {
"email_sends_max_monthly": 10000,
"ip_count": 0,
"teammates_max_total": 0,
"users_max_total": 0
}
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "No such endpoint",
"field": "",
"error_id": "10-40400"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}
PUT
Update account offerings
{{baseUrl}}/v3/partners/accounts/:accountID/offerings
BODY json
{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v3/partners/accounts/:accountID/offerings");
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 \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v3/partners/accounts/:accountID/offerings" {:content-type :json
:form-params {:offerings [{:name ""
:type ""
:quantity 0}]}})
require "http/client"
url = "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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}}/v3/partners/accounts/:accountID/offerings"),
Content = new StringContent("{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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}}/v3/partners/accounts/:accountID/offerings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
payload := strings.NewReader("{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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/v3/partners/accounts/:accountID/offerings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92
{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.setHeader("content-type", "application/json")
.setBody("{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v3/partners/accounts/:accountID/offerings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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 \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.header("content-type", "application/json")
.body("{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.asString();
const data = JSON.stringify({
offerings: [
{
name: '',
type: '',
quantity: 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}}/v3/partners/accounts/:accountID/offerings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/offerings',
headers: {'content-type': 'application/json'},
data: {offerings: [{name: '', type: '', quantity: 0}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/offerings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"offerings":[{"name":"","type":"","quantity":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}}/v3/partners/accounts/:accountID/offerings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "offerings": [\n {\n "name": "",\n "type": "",\n "quantity": 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 \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v3/partners/accounts/:accountID/offerings")
.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/v3/partners/accounts/:accountID/offerings',
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({offerings: [{name: '', type: '', quantity: 0}]}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v3/partners/accounts/:accountID/offerings',
headers: {'content-type': 'application/json'},
body: {offerings: [{name: '', type: '', quantity: 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}}/v3/partners/accounts/:accountID/offerings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
offerings: [
{
name: '',
type: '',
quantity: 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}}/v3/partners/accounts/:accountID/offerings',
headers: {'content-type': 'application/json'},
data: {offerings: [{name: '', type: '', quantity: 0}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v3/partners/accounts/:accountID/offerings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"offerings":[{"name":"","type":"","quantity":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 = @{ @"offerings": @[ @{ @"name": @"", @"type": @"", @"quantity": @0 } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v3/partners/accounts/:accountID/offerings"]
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}}/v3/partners/accounts/:accountID/offerings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v3/partners/accounts/:accountID/offerings",
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([
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 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}}/v3/partners/accounts/:accountID/offerings', [
'body' => '{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v3/partners/accounts/:accountID/offerings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 0
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'offerings' => [
[
'name' => '',
'type' => '',
'quantity' => 0
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v3/partners/accounts/:accountID/offerings');
$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}}/v3/partners/accounts/:accountID/offerings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v3/partners/accounts/:accountID/offerings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 0\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v3/partners/accounts/:accountID/offerings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
payload = { "offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
] }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v3/partners/accounts/:accountID/offerings"
payload <- "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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}}/v3/partners/accounts/:accountID/offerings")
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 \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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/v3/partners/accounts/:accountID/offerings') do |req|
req.body = "{\n \"offerings\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"quantity\": 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}}/v3/partners/accounts/:accountID/offerings";
let payload = json!({"offerings": (
json!({
"name": "",
"type": "",
"quantity": 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}}/v3/partners/accounts/:accountID/offerings \
--header 'content-type: application/json' \
--data '{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}'
echo '{
"offerings": [
{
"name": "",
"type": "",
"quantity": 0
}
]
}' | \
http PUT {{baseUrl}}/v3/partners/accounts/:accountID/offerings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "offerings": [\n {\n "name": "",\n "type": "",\n "quantity": 0\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v3/partners/accounts/:accountID/offerings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["offerings": [
[
"name": "",
"type": "",
"quantity": 0
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v3/partners/accounts/:accountID/offerings")! 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
{
"offerings": [
{
"name": "org.ei.free.v1",
"type": "package",
"quantity": 1
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Field must be a valid email",
"field": "email",
"error_id": "10-40002"
},
{
"message": "Field must be formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.",
"field": "phone",
"error_id": "10-40010"
},
{
"message": "Field must be a valid URL",
"field": "company_website",
"error_id": "10-40008"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Failed to authenticate user",
"field": "",
"error_id": "10-40100"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "The authenticated user is not authorized to perfrom this request",
"field": "",
"error_id": "10-40300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Something went wrong",
"field": "",
"error_id": "10-50000"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Bad Gateway",
"field": "",
"error_id": "10-50200"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Service Unavailable",
"field": "",
"error_id": "10-50300"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errors": [
{
"message": "Endpoint request timed out",
"field": "",
"error_id": "10-50400"
}
]
}