Identity Toolkit API
POST
identitytoolkit.accounts.mfaEnrollment.finalize
{{baseUrl}}/v2/accounts/mfaEnrollment:finalize
BODY json
{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize");
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 \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize" {:content-type :json
:form-params {:displayName ""
:idToken ""
:phoneVerificationInfo {:androidVerificationProof ""
:code ""
:phoneNumber ""
:sessionInfo ""}
:tenantId ""
:totpVerificationInfo {:sessionInfo ""
:verificationCode ""}}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaEnrollment:finalize"),
Content = new StringContent("{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaEnrollment:finalize");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"
payload := strings.NewReader("{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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/v2/accounts/mfaEnrollment:finalize HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 272
{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize")
.setHeader("content-type", "application/json")
.setBody("{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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 \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:finalize")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/mfaEnrollment:finalize")
.header("content-type", "application/json")
.body("{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
displayName: '',
idToken: '',
phoneVerificationInfo: {
androidVerificationProof: '',
code: '',
phoneNumber: '',
sessionInfo: ''
},
tenantId: '',
totpVerificationInfo: {
sessionInfo: '',
verificationCode: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
idToken: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {sessionInfo: '', verificationCode: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","idToken":"","phoneVerificationInfo":{"androidVerificationProof":"","code":"","phoneNumber":"","sessionInfo":""},"tenantId":"","totpVerificationInfo":{"sessionInfo":"","verificationCode":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "displayName": "",\n "idToken": "",\n "phoneVerificationInfo": {\n "androidVerificationProof": "",\n "code": "",\n "phoneNumber": "",\n "sessionInfo": ""\n },\n "tenantId": "",\n "totpVerificationInfo": {\n "sessionInfo": "",\n "verificationCode": ""\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 \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:finalize")
.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/v2/accounts/mfaEnrollment:finalize',
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({
displayName: '',
idToken: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {sessionInfo: '', verificationCode: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize',
headers: {'content-type': 'application/json'},
body: {
displayName: '',
idToken: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {sessionInfo: '', verificationCode: ''}
},
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}}/v2/accounts/mfaEnrollment:finalize');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
displayName: '',
idToken: '',
phoneVerificationInfo: {
androidVerificationProof: '',
code: '',
phoneNumber: '',
sessionInfo: ''
},
tenantId: '',
totpVerificationInfo: {
sessionInfo: '',
verificationCode: ''
}
});
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}}/v2/accounts/mfaEnrollment:finalize',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
idToken: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {sessionInfo: '', verificationCode: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","idToken":"","phoneVerificationInfo":{"androidVerificationProof":"","code":"","phoneNumber":"","sessionInfo":""},"tenantId":"","totpVerificationInfo":{"sessionInfo":"","verificationCode":""}}'
};
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 = @{ @"displayName": @"",
@"idToken": @"",
@"phoneVerificationInfo": @{ @"androidVerificationProof": @"", @"code": @"", @"phoneNumber": @"", @"sessionInfo": @"" },
@"tenantId": @"",
@"totpVerificationInfo": @{ @"sessionInfo": @"", @"verificationCode": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"]
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}}/v2/accounts/mfaEnrollment:finalize" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/mfaEnrollment:finalize",
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([
'displayName' => '',
'idToken' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'sessionInfo' => '',
'verificationCode' => ''
]
]),
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}}/v2/accounts/mfaEnrollment:finalize', [
'body' => '{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:finalize');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'displayName' => '',
'idToken' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'sessionInfo' => '',
'verificationCode' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'displayName' => '',
'idToken' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'sessionInfo' => '',
'verificationCode' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:finalize');
$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}}/v2/accounts/mfaEnrollment:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/mfaEnrollment:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/mfaEnrollment:finalize", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"
payload = {
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize"
payload <- "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaEnrollment:finalize")
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 \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\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/v2/accounts/mfaEnrollment:finalize') do |req|
req.body = "{\n \"displayName\": \"\",\n \"idToken\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"sessionInfo\": \"\",\n \"verificationCode\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize";
let payload = json!({
"displayName": "",
"idToken": "",
"phoneVerificationInfo": json!({
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
}),
"tenantId": "",
"totpVerificationInfo": json!({
"sessionInfo": "",
"verificationCode": ""
})
});
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}}/v2/accounts/mfaEnrollment:finalize \
--header 'content-type: application/json' \
--data '{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}'
echo '{
"displayName": "",
"idToken": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"sessionInfo": "",
"verificationCode": ""
}
}' | \
http POST {{baseUrl}}/v2/accounts/mfaEnrollment:finalize \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "displayName": "",\n "idToken": "",\n "phoneVerificationInfo": {\n "androidVerificationProof": "",\n "code": "",\n "phoneNumber": "",\n "sessionInfo": ""\n },\n "tenantId": "",\n "totpVerificationInfo": {\n "sessionInfo": "",\n "verificationCode": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/mfaEnrollment:finalize
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"displayName": "",
"idToken": "",
"phoneVerificationInfo": [
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
],
"tenantId": "",
"totpVerificationInfo": [
"sessionInfo": "",
"verificationCode": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/mfaEnrollment:finalize")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.mfaEnrollment.start
{{baseUrl}}/v2/accounts/mfaEnrollment:start
BODY json
{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/mfaEnrollment:start");
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 \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/mfaEnrollment:start" {:content-type :json
:form-params {:idToken ""
:phoneEnrollmentInfo {:autoRetrievalInfo {:appSignatureHash ""}
:iosReceipt ""
:iosSecret ""
:phoneNumber ""
:playIntegrityToken ""
:recaptchaToken ""
:safetyNetToken ""}
:tenantId ""
:totpEnrollmentInfo {}}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:start"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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}}/v2/accounts/mfaEnrollment:start"),
Content = new StringContent("{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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}}/v2/accounts/mfaEnrollment:start");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/mfaEnrollment:start"
payload := strings.NewReader("{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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/v2/accounts/mfaEnrollment:start HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 307
{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/mfaEnrollment:start")
.setHeader("content-type", "application/json")
.setBody("{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/mfaEnrollment:start"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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 \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:start")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/mfaEnrollment:start")
.header("content-type", "application/json")
.body("{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}")
.asString();
const data = JSON.stringify({
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {
appSignatureHash: ''
},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/mfaEnrollment:start');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:start',
headers: {'content-type': 'application/json'},
data: {
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","phoneEnrollmentInfo":{"autoRetrievalInfo":{"appSignatureHash":""},"iosReceipt":"","iosSecret":"","phoneNumber":"","playIntegrityToken":"","recaptchaToken":"","safetyNetToken":""},"tenantId":"","totpEnrollmentInfo":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:start',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "idToken": "",\n "phoneEnrollmentInfo": {\n "autoRetrievalInfo": {\n "appSignatureHash": ""\n },\n "iosReceipt": "",\n "iosSecret": "",\n "phoneNumber": "",\n "playIntegrityToken": "",\n "recaptchaToken": "",\n "safetyNetToken": ""\n },\n "tenantId": "",\n "totpEnrollmentInfo": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:start")
.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/v2/accounts/mfaEnrollment:start',
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({
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:start',
headers: {'content-type': 'application/json'},
body: {
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
},
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}}/v2/accounts/mfaEnrollment:start');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {
appSignatureHash: ''
},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
});
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}}/v2/accounts/mfaEnrollment:start',
headers: {'content-type': 'application/json'},
data: {
idToken: '',
phoneEnrollmentInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: '',
totpEnrollmentInfo: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","phoneEnrollmentInfo":{"autoRetrievalInfo":{"appSignatureHash":""},"iosReceipt":"","iosSecret":"","phoneNumber":"","playIntegrityToken":"","recaptchaToken":"","safetyNetToken":""},"tenantId":"","totpEnrollmentInfo":{}}'
};
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 = @{ @"idToken": @"",
@"phoneEnrollmentInfo": @{ @"autoRetrievalInfo": @{ @"appSignatureHash": @"" }, @"iosReceipt": @"", @"iosSecret": @"", @"phoneNumber": @"", @"playIntegrityToken": @"", @"recaptchaToken": @"", @"safetyNetToken": @"" },
@"tenantId": @"",
@"totpEnrollmentInfo": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/mfaEnrollment:start"]
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}}/v2/accounts/mfaEnrollment:start" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/mfaEnrollment:start",
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([
'idToken' => '',
'phoneEnrollmentInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => '',
'totpEnrollmentInfo' => [
]
]),
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}}/v2/accounts/mfaEnrollment:start', [
'body' => '{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:start');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'idToken' => '',
'phoneEnrollmentInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => '',
'totpEnrollmentInfo' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'idToken' => '',
'phoneEnrollmentInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => '',
'totpEnrollmentInfo' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:start');
$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}}/v2/accounts/mfaEnrollment:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/mfaEnrollment:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/mfaEnrollment:start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:start"
payload = {
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": { "appSignatureHash": "" },
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/mfaEnrollment:start"
payload <- "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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}}/v2/accounts/mfaEnrollment:start")
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 \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\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/v2/accounts/mfaEnrollment:start') do |req|
req.body = "{\n \"idToken\": \"\",\n \"phoneEnrollmentInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\",\n \"totpEnrollmentInfo\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/mfaEnrollment:start";
let payload = json!({
"idToken": "",
"phoneEnrollmentInfo": json!({
"autoRetrievalInfo": json!({"appSignatureHash": ""}),
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
}),
"tenantId": "",
"totpEnrollmentInfo": json!({})
});
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}}/v2/accounts/mfaEnrollment:start \
--header 'content-type: application/json' \
--data '{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}'
echo '{
"idToken": "",
"phoneEnrollmentInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": "",
"totpEnrollmentInfo": {}
}' | \
http POST {{baseUrl}}/v2/accounts/mfaEnrollment:start \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "idToken": "",\n "phoneEnrollmentInfo": {\n "autoRetrievalInfo": {\n "appSignatureHash": ""\n },\n "iosReceipt": "",\n "iosSecret": "",\n "phoneNumber": "",\n "playIntegrityToken": "",\n "recaptchaToken": "",\n "safetyNetToken": ""\n },\n "tenantId": "",\n "totpEnrollmentInfo": {}\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/mfaEnrollment:start
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"idToken": "",
"phoneEnrollmentInfo": [
"autoRetrievalInfo": ["appSignatureHash": ""],
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
],
"tenantId": "",
"totpEnrollmentInfo": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/mfaEnrollment:start")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.mfaEnrollment.withdraw
{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw
BODY json
{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw");
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 \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw" {:content-type :json
:form-params {:idToken ""
:mfaEnrollmentId ""
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/mfaEnrollment:withdraw"),
Content = new StringContent("{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/mfaEnrollment:withdraw");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"
payload := strings.NewReader("{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/mfaEnrollment:withdraw HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw")
.setHeader("content-type", "application/json")
.setBody("{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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 \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw")
.header("content-type", "application/json")
.body("{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
idToken: '',
mfaEnrollmentId: '',
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw',
headers: {'content-type': 'application/json'},
data: {idToken: '', mfaEnrollmentId: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","mfaEnrollmentId":"","tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "idToken": "",\n "mfaEnrollmentId": "",\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw")
.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/v2/accounts/mfaEnrollment:withdraw',
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({idToken: '', mfaEnrollmentId: '', tenantId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw',
headers: {'content-type': 'application/json'},
body: {idToken: '', mfaEnrollmentId: '', tenantId: ''},
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}}/v2/accounts/mfaEnrollment:withdraw');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
idToken: '',
mfaEnrollmentId: '',
tenantId: ''
});
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}}/v2/accounts/mfaEnrollment:withdraw',
headers: {'content-type': 'application/json'},
data: {idToken: '', mfaEnrollmentId: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","mfaEnrollmentId":"","tenantId":""}'
};
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 = @{ @"idToken": @"",
@"mfaEnrollmentId": @"",
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"]
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}}/v2/accounts/mfaEnrollment:withdraw" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw",
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([
'idToken' => '',
'mfaEnrollmentId' => '',
'tenantId' => ''
]),
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}}/v2/accounts/mfaEnrollment:withdraw', [
'body' => '{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'idToken' => '',
'mfaEnrollmentId' => '',
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'idToken' => '',
'mfaEnrollmentId' => '',
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw');
$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}}/v2/accounts/mfaEnrollment:withdraw' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/mfaEnrollment:withdraw", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"
payload = {
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw"
payload <- "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/mfaEnrollment:withdraw")
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 \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/mfaEnrollment:withdraw') do |req|
req.body = "{\n \"idToken\": \"\",\n \"mfaEnrollmentId\": \"\",\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw";
let payload = json!({
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
});
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}}/v2/accounts/mfaEnrollment:withdraw \
--header 'content-type: application/json' \
--data '{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}'
echo '{
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/mfaEnrollment:withdraw \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "idToken": "",\n "mfaEnrollmentId": "",\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/mfaEnrollment:withdraw
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"idToken": "",
"mfaEnrollmentId": "",
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/mfaEnrollment:withdraw")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.mfaSignIn.finalize
{{baseUrl}}/v2/accounts/mfaSignIn:finalize
BODY json
{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/mfaSignIn:finalize");
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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/mfaSignIn:finalize" {:content-type :json
:form-params {:mfaEnrollmentId ""
:mfaPendingCredential ""
:phoneVerificationInfo {:androidVerificationProof ""
:code ""
:phoneNumber ""
:sessionInfo ""}
:tenantId ""
:totpVerificationInfo {:verificationCode ""}}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/mfaSignIn:finalize"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaSignIn:finalize"),
Content = new StringContent("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaSignIn:finalize");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/mfaSignIn:finalize"
payload := strings.NewReader("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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/v2/accounts/mfaSignIn:finalize HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 266
{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/mfaSignIn:finalize")
.setHeader("content-type", "application/json")
.setBody("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/mfaSignIn:finalize"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaSignIn:finalize")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/mfaSignIn:finalize")
.header("content-type", "application/json")
.body("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {
androidVerificationProof: '',
code: '',
phoneNumber: '',
sessionInfo: ''
},
tenantId: '',
totpVerificationInfo: {
verificationCode: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/mfaSignIn:finalize');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaSignIn:finalize',
headers: {'content-type': 'application/json'},
data: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {verificationCode: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/mfaSignIn:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"mfaEnrollmentId":"","mfaPendingCredential":"","phoneVerificationInfo":{"androidVerificationProof":"","code":"","phoneNumber":"","sessionInfo":""},"tenantId":"","totpVerificationInfo":{"verificationCode":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/mfaSignIn:finalize',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "mfaEnrollmentId": "",\n "mfaPendingCredential": "",\n "phoneVerificationInfo": {\n "androidVerificationProof": "",\n "code": "",\n "phoneNumber": "",\n "sessionInfo": ""\n },\n "tenantId": "",\n "totpVerificationInfo": {\n "verificationCode": ""\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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaSignIn:finalize")
.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/v2/accounts/mfaSignIn:finalize',
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({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {verificationCode: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaSignIn:finalize',
headers: {'content-type': 'application/json'},
body: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {verificationCode: ''}
},
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}}/v2/accounts/mfaSignIn:finalize');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {
androidVerificationProof: '',
code: '',
phoneNumber: '',
sessionInfo: ''
},
tenantId: '',
totpVerificationInfo: {
verificationCode: ''
}
});
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}}/v2/accounts/mfaSignIn:finalize',
headers: {'content-type': 'application/json'},
data: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneVerificationInfo: {androidVerificationProof: '', code: '', phoneNumber: '', sessionInfo: ''},
tenantId: '',
totpVerificationInfo: {verificationCode: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/mfaSignIn:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"mfaEnrollmentId":"","mfaPendingCredential":"","phoneVerificationInfo":{"androidVerificationProof":"","code":"","phoneNumber":"","sessionInfo":""},"tenantId":"","totpVerificationInfo":{"verificationCode":""}}'
};
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 = @{ @"mfaEnrollmentId": @"",
@"mfaPendingCredential": @"",
@"phoneVerificationInfo": @{ @"androidVerificationProof": @"", @"code": @"", @"phoneNumber": @"", @"sessionInfo": @"" },
@"tenantId": @"",
@"totpVerificationInfo": @{ @"verificationCode": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/mfaSignIn:finalize"]
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}}/v2/accounts/mfaSignIn:finalize" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/mfaSignIn:finalize",
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([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'verificationCode' => ''
]
]),
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}}/v2/accounts/mfaSignIn:finalize', [
'body' => '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/mfaSignIn:finalize');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'verificationCode' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneVerificationInfo' => [
'androidVerificationProof' => '',
'code' => '',
'phoneNumber' => '',
'sessionInfo' => ''
],
'tenantId' => '',
'totpVerificationInfo' => [
'verificationCode' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/mfaSignIn:finalize');
$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}}/v2/accounts/mfaSignIn:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/mfaSignIn:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/mfaSignIn:finalize", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/mfaSignIn:finalize"
payload = {
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": { "verificationCode": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/mfaSignIn:finalize"
payload <- "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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}}/v2/accounts/mfaSignIn:finalize")
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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\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/v2/accounts/mfaSignIn:finalize') do |req|
req.body = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneVerificationInfo\": {\n \"androidVerificationProof\": \"\",\n \"code\": \"\",\n \"phoneNumber\": \"\",\n \"sessionInfo\": \"\"\n },\n \"tenantId\": \"\",\n \"totpVerificationInfo\": {\n \"verificationCode\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/mfaSignIn:finalize";
let payload = json!({
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": json!({
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
}),
"tenantId": "",
"totpVerificationInfo": json!({"verificationCode": ""})
});
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}}/v2/accounts/mfaSignIn:finalize \
--header 'content-type: application/json' \
--data '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}'
echo '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": {
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
},
"tenantId": "",
"totpVerificationInfo": {
"verificationCode": ""
}
}' | \
http POST {{baseUrl}}/v2/accounts/mfaSignIn:finalize \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "mfaEnrollmentId": "",\n "mfaPendingCredential": "",\n "phoneVerificationInfo": {\n "androidVerificationProof": "",\n "code": "",\n "phoneNumber": "",\n "sessionInfo": ""\n },\n "tenantId": "",\n "totpVerificationInfo": {\n "verificationCode": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/mfaSignIn:finalize
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneVerificationInfo": [
"androidVerificationProof": "",
"code": "",
"phoneNumber": "",
"sessionInfo": ""
],
"tenantId": "",
"totpVerificationInfo": ["verificationCode": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/mfaSignIn:finalize")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.mfaSignIn.start
{{baseUrl}}/v2/accounts/mfaSignIn:start
BODY json
{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/mfaSignIn:start");
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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/mfaSignIn:start" {:content-type :json
:form-params {:mfaEnrollmentId ""
:mfaPendingCredential ""
:phoneSignInInfo {:autoRetrievalInfo {:appSignatureHash ""}
:iosReceipt ""
:iosSecret ""
:phoneNumber ""
:playIntegrityToken ""
:recaptchaToken ""
:safetyNetToken ""}
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/mfaSignIn:start"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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}}/v2/accounts/mfaSignIn:start"),
Content = new StringContent("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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}}/v2/accounts/mfaSignIn:start");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/mfaSignIn:start"
payload := strings.NewReader("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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/v2/accounts/mfaSignIn:start HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 313
{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/mfaSignIn:start")
.setHeader("content-type", "application/json")
.setBody("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/mfaSignIn:start"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaSignIn:start")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/mfaSignIn:start")
.header("content-type", "application/json")
.body("{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {
appSignatureHash: ''
},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/mfaSignIn:start');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaSignIn:start',
headers: {'content-type': 'application/json'},
data: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/mfaSignIn:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"mfaEnrollmentId":"","mfaPendingCredential":"","phoneSignInInfo":{"autoRetrievalInfo":{"appSignatureHash":""},"iosReceipt":"","iosSecret":"","phoneNumber":"","playIntegrityToken":"","recaptchaToken":"","safetyNetToken":""},"tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/mfaSignIn:start',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "mfaEnrollmentId": "",\n "mfaPendingCredential": "",\n "phoneSignInInfo": {\n "autoRetrievalInfo": {\n "appSignatureHash": ""\n },\n "iosReceipt": "",\n "iosSecret": "",\n "phoneNumber": "",\n "playIntegrityToken": "",\n "recaptchaToken": "",\n "safetyNetToken": ""\n },\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/mfaSignIn:start")
.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/v2/accounts/mfaSignIn:start',
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({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/mfaSignIn:start',
headers: {'content-type': 'application/json'},
body: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
},
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}}/v2/accounts/mfaSignIn:start');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {
appSignatureHash: ''
},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
});
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}}/v2/accounts/mfaSignIn:start',
headers: {'content-type': 'application/json'},
data: {
mfaEnrollmentId: '',
mfaPendingCredential: '',
phoneSignInInfo: {
autoRetrievalInfo: {appSignatureHash: ''},
iosReceipt: '',
iosSecret: '',
phoneNumber: '',
playIntegrityToken: '',
recaptchaToken: '',
safetyNetToken: ''
},
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/mfaSignIn:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"mfaEnrollmentId":"","mfaPendingCredential":"","phoneSignInInfo":{"autoRetrievalInfo":{"appSignatureHash":""},"iosReceipt":"","iosSecret":"","phoneNumber":"","playIntegrityToken":"","recaptchaToken":"","safetyNetToken":""},"tenantId":""}'
};
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 = @{ @"mfaEnrollmentId": @"",
@"mfaPendingCredential": @"",
@"phoneSignInInfo": @{ @"autoRetrievalInfo": @{ @"appSignatureHash": @"" }, @"iosReceipt": @"", @"iosSecret": @"", @"phoneNumber": @"", @"playIntegrityToken": @"", @"recaptchaToken": @"", @"safetyNetToken": @"" },
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/mfaSignIn:start"]
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}}/v2/accounts/mfaSignIn:start" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/mfaSignIn:start",
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([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneSignInInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => ''
]),
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}}/v2/accounts/mfaSignIn:start', [
'body' => '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/mfaSignIn:start');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneSignInInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mfaEnrollmentId' => '',
'mfaPendingCredential' => '',
'phoneSignInInfo' => [
'autoRetrievalInfo' => [
'appSignatureHash' => ''
],
'iosReceipt' => '',
'iosSecret' => '',
'phoneNumber' => '',
'playIntegrityToken' => '',
'recaptchaToken' => '',
'safetyNetToken' => ''
],
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/mfaSignIn:start');
$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}}/v2/accounts/mfaSignIn:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/mfaSignIn:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/mfaSignIn:start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/mfaSignIn:start"
payload = {
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": { "appSignatureHash": "" },
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/mfaSignIn:start"
payload <- "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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}}/v2/accounts/mfaSignIn:start")
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 \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\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/v2/accounts/mfaSignIn:start') do |req|
req.body = "{\n \"mfaEnrollmentId\": \"\",\n \"mfaPendingCredential\": \"\",\n \"phoneSignInInfo\": {\n \"autoRetrievalInfo\": {\n \"appSignatureHash\": \"\"\n },\n \"iosReceipt\": \"\",\n \"iosSecret\": \"\",\n \"phoneNumber\": \"\",\n \"playIntegrityToken\": \"\",\n \"recaptchaToken\": \"\",\n \"safetyNetToken\": \"\"\n },\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/mfaSignIn:start";
let payload = json!({
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": json!({
"autoRetrievalInfo": json!({"appSignatureHash": ""}),
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
}),
"tenantId": ""
});
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}}/v2/accounts/mfaSignIn:start \
--header 'content-type: application/json' \
--data '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}'
echo '{
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": {
"autoRetrievalInfo": {
"appSignatureHash": ""
},
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
},
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/mfaSignIn:start \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "mfaEnrollmentId": "",\n "mfaPendingCredential": "",\n "phoneSignInInfo": {\n "autoRetrievalInfo": {\n "appSignatureHash": ""\n },\n "iosReceipt": "",\n "iosSecret": "",\n "phoneNumber": "",\n "playIntegrityToken": "",\n "recaptchaToken": "",\n "safetyNetToken": ""\n },\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/mfaSignIn:start
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"mfaEnrollmentId": "",
"mfaPendingCredential": "",
"phoneSignInInfo": [
"autoRetrievalInfo": ["appSignatureHash": ""],
"iosReceipt": "",
"iosSecret": "",
"phoneNumber": "",
"playIntegrityToken": "",
"recaptchaToken": "",
"safetyNetToken": ""
],
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/mfaSignIn:start")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.passkeyEnrollment.finalize
{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize
BODY json
{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize");
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 \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize" {:content-type :json
:form-params {:authenticatorRegistrationResponse {:authenticatorAttestationResponse {:attestationObject ""
:clientDataJson ""
:transports []}
:credentialId ""
:credentialType ""}
:idToken ""
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:finalize"),
Content = new StringContent("{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:finalize");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"
payload := strings.NewReader("{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeyEnrollment:finalize HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 263
{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize")
.setHeader("content-type", "application/json")
.setBody("{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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 \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize")
.header("content-type", "application/json")
.body("{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {
attestationObject: '',
clientDataJson: '',
transports: []
},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize',
headers: {'content-type': 'application/json'},
data: {
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {attestationObject: '', clientDataJson: '', transports: []},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticatorRegistrationResponse":{"authenticatorAttestationResponse":{"attestationObject":"","clientDataJson":"","transports":[]},"credentialId":"","credentialType":""},"idToken":"","tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "authenticatorRegistrationResponse": {\n "authenticatorAttestationResponse": {\n "attestationObject": "",\n "clientDataJson": "",\n "transports": []\n },\n "credentialId": "",\n "credentialType": ""\n },\n "idToken": "",\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize")
.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/v2/accounts/passkeyEnrollment:finalize',
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({
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {attestationObject: '', clientDataJson: '', transports: []},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize',
headers: {'content-type': 'application/json'},
body: {
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {attestationObject: '', clientDataJson: '', transports: []},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
},
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}}/v2/accounts/passkeyEnrollment:finalize');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {
attestationObject: '',
clientDataJson: '',
transports: []
},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
});
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}}/v2/accounts/passkeyEnrollment:finalize',
headers: {'content-type': 'application/json'},
data: {
authenticatorRegistrationResponse: {
authenticatorAttestationResponse: {attestationObject: '', clientDataJson: '', transports: []},
credentialId: '',
credentialType: ''
},
idToken: '',
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticatorRegistrationResponse":{"authenticatorAttestationResponse":{"attestationObject":"","clientDataJson":"","transports":[]},"credentialId":"","credentialType":""},"idToken":"","tenantId":""}'
};
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 = @{ @"authenticatorRegistrationResponse": @{ @"authenticatorAttestationResponse": @{ @"attestationObject": @"", @"clientDataJson": @"", @"transports": @[ ] }, @"credentialId": @"", @"credentialType": @"" },
@"idToken": @"",
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"]
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}}/v2/accounts/passkeyEnrollment:finalize" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize",
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([
'authenticatorRegistrationResponse' => [
'authenticatorAttestationResponse' => [
'attestationObject' => '',
'clientDataJson' => '',
'transports' => [
]
],
'credentialId' => '',
'credentialType' => ''
],
'idToken' => '',
'tenantId' => ''
]),
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}}/v2/accounts/passkeyEnrollment:finalize', [
'body' => '{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authenticatorRegistrationResponse' => [
'authenticatorAttestationResponse' => [
'attestationObject' => '',
'clientDataJson' => '',
'transports' => [
]
],
'credentialId' => '',
'credentialType' => ''
],
'idToken' => '',
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authenticatorRegistrationResponse' => [
'authenticatorAttestationResponse' => [
'attestationObject' => '',
'clientDataJson' => '',
'transports' => [
]
],
'credentialId' => '',
'credentialType' => ''
],
'idToken' => '',
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize');
$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}}/v2/accounts/passkeyEnrollment:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/passkeyEnrollment:finalize", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"
payload = {
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize"
payload <- "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:finalize")
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 \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeyEnrollment:finalize') do |req|
req.body = "{\n \"authenticatorRegistrationResponse\": {\n \"authenticatorAttestationResponse\": {\n \"attestationObject\": \"\",\n \"clientDataJson\": \"\",\n \"transports\": []\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize";
let payload = json!({
"authenticatorRegistrationResponse": json!({
"authenticatorAttestationResponse": json!({
"attestationObject": "",
"clientDataJson": "",
"transports": ()
}),
"credentialId": "",
"credentialType": ""
}),
"idToken": "",
"tenantId": ""
});
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}}/v2/accounts/passkeyEnrollment:finalize \
--header 'content-type: application/json' \
--data '{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}'
echo '{
"authenticatorRegistrationResponse": {
"authenticatorAttestationResponse": {
"attestationObject": "",
"clientDataJson": "",
"transports": []
},
"credentialId": "",
"credentialType": ""
},
"idToken": "",
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/passkeyEnrollment:finalize \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "authenticatorRegistrationResponse": {\n "authenticatorAttestationResponse": {\n "attestationObject": "",\n "clientDataJson": "",\n "transports": []\n },\n "credentialId": "",\n "credentialType": ""\n },\n "idToken": "",\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/passkeyEnrollment:finalize
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"authenticatorRegistrationResponse": [
"authenticatorAttestationResponse": [
"attestationObject": "",
"clientDataJson": "",
"transports": []
],
"credentialId": "",
"credentialType": ""
],
"idToken": "",
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/passkeyEnrollment:finalize")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.passkeyEnrollment.start
{{baseUrl}}/v2/accounts/passkeyEnrollment:start
BODY json
{
"idToken": "",
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/passkeyEnrollment:start");
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 \"idToken\": \"\",\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/passkeyEnrollment:start" {:content-type :json
:form-params {:idToken ""
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:start"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:start"),
Content = new StringContent("{\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:start");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/passkeyEnrollment:start"
payload := strings.NewReader("{\n \"idToken\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeyEnrollment:start HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"idToken": "",
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/passkeyEnrollment:start")
.setHeader("content-type", "application/json")
.setBody("{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/passkeyEnrollment:start"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"idToken\": \"\",\n \"tenantId\": \"\"\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 \"idToken\": \"\",\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeyEnrollment:start")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/passkeyEnrollment:start")
.header("content-type", "application/json")
.body("{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
idToken: '',
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/passkeyEnrollment:start');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:start',
headers: {'content-type': 'application/json'},
data: {idToken: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/passkeyEnrollment:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:start',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "idToken": "",\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeyEnrollment:start")
.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/v2/accounts/passkeyEnrollment:start',
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({idToken: '', tenantId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeyEnrollment:start',
headers: {'content-type': 'application/json'},
body: {idToken: '', tenantId: ''},
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}}/v2/accounts/passkeyEnrollment:start');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
idToken: '',
tenantId: ''
});
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}}/v2/accounts/passkeyEnrollment:start',
headers: {'content-type': 'application/json'},
data: {idToken: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/passkeyEnrollment:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","tenantId":""}'
};
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 = @{ @"idToken": @"",
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/passkeyEnrollment:start"]
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}}/v2/accounts/passkeyEnrollment:start" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/passkeyEnrollment:start",
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([
'idToken' => '',
'tenantId' => ''
]),
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}}/v2/accounts/passkeyEnrollment:start', [
'body' => '{
"idToken": "",
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/passkeyEnrollment:start');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'idToken' => '',
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'idToken' => '',
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/passkeyEnrollment:start');
$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}}/v2/accounts/passkeyEnrollment:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/passkeyEnrollment:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/passkeyEnrollment:start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:start"
payload = {
"idToken": "",
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/passkeyEnrollment:start"
payload <- "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeyEnrollment:start")
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 \"idToken\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeyEnrollment:start') do |req|
req.body = "{\n \"idToken\": \"\",\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/passkeyEnrollment:start";
let payload = json!({
"idToken": "",
"tenantId": ""
});
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}}/v2/accounts/passkeyEnrollment:start \
--header 'content-type: application/json' \
--data '{
"idToken": "",
"tenantId": ""
}'
echo '{
"idToken": "",
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/passkeyEnrollment:start \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "idToken": "",\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/passkeyEnrollment:start
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"idToken": "",
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/passkeyEnrollment:start")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.passkeySignIn.finalize
{{baseUrl}}/v2/accounts/passkeySignIn:finalize
BODY json
{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/passkeySignIn:finalize");
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 \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/passkeySignIn:finalize" {:content-type :json
:form-params {:authenticatorAuthenticationResponse {:authenticatorAssertionResponse {:authenticatorData ""
:clientDataJson ""
:signature ""
:userHandle ""}
:credentialId ""
:credentialType ""}
:sessionId ""
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/passkeySignIn:finalize"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:finalize"),
Content = new StringContent("{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:finalize");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/passkeySignIn:finalize"
payload := strings.NewReader("{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeySignIn:finalize HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 288
{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/passkeySignIn:finalize")
.setHeader("content-type", "application/json")
.setBody("{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/passkeySignIn:finalize"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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 \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeySignIn:finalize")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/passkeySignIn:finalize")
.header("content-type", "application/json")
.body("{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {
authenticatorData: '',
clientDataJson: '',
signature: '',
userHandle: ''
},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/passkeySignIn:finalize');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeySignIn:finalize',
headers: {'content-type': 'application/json'},
data: {
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {authenticatorData: '', clientDataJson: '', signature: '', userHandle: ''},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/passkeySignIn:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticatorAuthenticationResponse":{"authenticatorAssertionResponse":{"authenticatorData":"","clientDataJson":"","signature":"","userHandle":""},"credentialId":"","credentialType":""},"sessionId":"","tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/passkeySignIn:finalize',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "authenticatorAuthenticationResponse": {\n "authenticatorAssertionResponse": {\n "authenticatorData": "",\n "clientDataJson": "",\n "signature": "",\n "userHandle": ""\n },\n "credentialId": "",\n "credentialType": ""\n },\n "sessionId": "",\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeySignIn:finalize")
.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/v2/accounts/passkeySignIn:finalize',
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({
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {authenticatorData: '', clientDataJson: '', signature: '', userHandle: ''},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeySignIn:finalize',
headers: {'content-type': 'application/json'},
body: {
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {authenticatorData: '', clientDataJson: '', signature: '', userHandle: ''},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
},
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}}/v2/accounts/passkeySignIn:finalize');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {
authenticatorData: '',
clientDataJson: '',
signature: '',
userHandle: ''
},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
});
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}}/v2/accounts/passkeySignIn:finalize',
headers: {'content-type': 'application/json'},
data: {
authenticatorAuthenticationResponse: {
authenticatorAssertionResponse: {authenticatorData: '', clientDataJson: '', signature: '', userHandle: ''},
credentialId: '',
credentialType: ''
},
sessionId: '',
tenantId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/passkeySignIn:finalize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authenticatorAuthenticationResponse":{"authenticatorAssertionResponse":{"authenticatorData":"","clientDataJson":"","signature":"","userHandle":""},"credentialId":"","credentialType":""},"sessionId":"","tenantId":""}'
};
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 = @{ @"authenticatorAuthenticationResponse": @{ @"authenticatorAssertionResponse": @{ @"authenticatorData": @"", @"clientDataJson": @"", @"signature": @"", @"userHandle": @"" }, @"credentialId": @"", @"credentialType": @"" },
@"sessionId": @"",
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/passkeySignIn:finalize"]
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}}/v2/accounts/passkeySignIn:finalize" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/passkeySignIn:finalize",
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([
'authenticatorAuthenticationResponse' => [
'authenticatorAssertionResponse' => [
'authenticatorData' => '',
'clientDataJson' => '',
'signature' => '',
'userHandle' => ''
],
'credentialId' => '',
'credentialType' => ''
],
'sessionId' => '',
'tenantId' => ''
]),
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}}/v2/accounts/passkeySignIn:finalize', [
'body' => '{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/passkeySignIn:finalize');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authenticatorAuthenticationResponse' => [
'authenticatorAssertionResponse' => [
'authenticatorData' => '',
'clientDataJson' => '',
'signature' => '',
'userHandle' => ''
],
'credentialId' => '',
'credentialType' => ''
],
'sessionId' => '',
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authenticatorAuthenticationResponse' => [
'authenticatorAssertionResponse' => [
'authenticatorData' => '',
'clientDataJson' => '',
'signature' => '',
'userHandle' => ''
],
'credentialId' => '',
'credentialType' => ''
],
'sessionId' => '',
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/passkeySignIn:finalize');
$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}}/v2/accounts/passkeySignIn:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/passkeySignIn:finalize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/passkeySignIn:finalize", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/passkeySignIn:finalize"
payload = {
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/passkeySignIn:finalize"
payload <- "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:finalize")
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 \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeySignIn:finalize') do |req|
req.body = "{\n \"authenticatorAuthenticationResponse\": {\n \"authenticatorAssertionResponse\": {\n \"authenticatorData\": \"\",\n \"clientDataJson\": \"\",\n \"signature\": \"\",\n \"userHandle\": \"\"\n },\n \"credentialId\": \"\",\n \"credentialType\": \"\"\n },\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/passkeySignIn:finalize";
let payload = json!({
"authenticatorAuthenticationResponse": json!({
"authenticatorAssertionResponse": json!({
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
}),
"credentialId": "",
"credentialType": ""
}),
"sessionId": "",
"tenantId": ""
});
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}}/v2/accounts/passkeySignIn:finalize \
--header 'content-type: application/json' \
--data '{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}'
echo '{
"authenticatorAuthenticationResponse": {
"authenticatorAssertionResponse": {
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
},
"credentialId": "",
"credentialType": ""
},
"sessionId": "",
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/passkeySignIn:finalize \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "authenticatorAuthenticationResponse": {\n "authenticatorAssertionResponse": {\n "authenticatorData": "",\n "clientDataJson": "",\n "signature": "",\n "userHandle": ""\n },\n "credentialId": "",\n "credentialType": ""\n },\n "sessionId": "",\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/passkeySignIn:finalize
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"authenticatorAuthenticationResponse": [
"authenticatorAssertionResponse": [
"authenticatorData": "",
"clientDataJson": "",
"signature": "",
"userHandle": ""
],
"credentialId": "",
"credentialType": ""
],
"sessionId": "",
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/passkeySignIn:finalize")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.passkeySignIn.start
{{baseUrl}}/v2/accounts/passkeySignIn:start
BODY json
{
"sessionId": "",
"tenantId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts/passkeySignIn:start");
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 \"sessionId\": \"\",\n \"tenantId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts/passkeySignIn:start" {:content-type :json
:form-params {:sessionId ""
:tenantId ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts/passkeySignIn:start"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:start"),
Content = new StringContent("{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:start");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts/passkeySignIn:start"
payload := strings.NewReader("{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeySignIn:start HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"sessionId": "",
"tenantId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts/passkeySignIn:start")
.setHeader("content-type", "application/json")
.setBody("{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts/passkeySignIn:start"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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 \"sessionId\": \"\",\n \"tenantId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeySignIn:start")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts/passkeySignIn:start")
.header("content-type", "application/json")
.body("{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sessionId: '',
tenantId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts/passkeySignIn:start');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeySignIn:start',
headers: {'content-type': 'application/json'},
data: {sessionId: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts/passkeySignIn:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sessionId":"","tenantId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts/passkeySignIn:start',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sessionId": "",\n "tenantId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts/passkeySignIn:start")
.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/v2/accounts/passkeySignIn:start',
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({sessionId: '', tenantId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts/passkeySignIn:start',
headers: {'content-type': 'application/json'},
body: {sessionId: '', tenantId: ''},
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}}/v2/accounts/passkeySignIn:start');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sessionId: '',
tenantId: ''
});
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}}/v2/accounts/passkeySignIn:start',
headers: {'content-type': 'application/json'},
data: {sessionId: '', tenantId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts/passkeySignIn:start';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sessionId":"","tenantId":""}'
};
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 = @{ @"sessionId": @"",
@"tenantId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts/passkeySignIn:start"]
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}}/v2/accounts/passkeySignIn:start" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts/passkeySignIn:start",
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([
'sessionId' => '',
'tenantId' => ''
]),
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}}/v2/accounts/passkeySignIn:start', [
'body' => '{
"sessionId": "",
"tenantId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts/passkeySignIn:start');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sessionId' => '',
'tenantId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sessionId' => '',
'tenantId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts/passkeySignIn:start');
$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}}/v2/accounts/passkeySignIn:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sessionId": "",
"tenantId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts/passkeySignIn:start' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sessionId": "",
"tenantId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts/passkeySignIn:start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts/passkeySignIn:start"
payload = {
"sessionId": "",
"tenantId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts/passkeySignIn:start"
payload <- "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\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}}/v2/accounts/passkeySignIn:start")
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 \"sessionId\": \"\",\n \"tenantId\": \"\"\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/v2/accounts/passkeySignIn:start') do |req|
req.body = "{\n \"sessionId\": \"\",\n \"tenantId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts/passkeySignIn:start";
let payload = json!({
"sessionId": "",
"tenantId": ""
});
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}}/v2/accounts/passkeySignIn:start \
--header 'content-type: application/json' \
--data '{
"sessionId": "",
"tenantId": ""
}'
echo '{
"sessionId": "",
"tenantId": ""
}' | \
http POST {{baseUrl}}/v2/accounts/passkeySignIn:start \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sessionId": "",\n "tenantId": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts/passkeySignIn:start
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sessionId": "",
"tenantId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts/passkeySignIn:start")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.accounts.revokeToken
{{baseUrl}}/v2/accounts:revokeToken
BODY json
{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/accounts:revokeToken");
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 \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/accounts:revokeToken" {:content-type :json
:form-params {:idToken ""
:providerId ""
:redirectUri ""
:tenantId ""
:token ""
:tokenType ""}})
require "http/client"
url = "{{baseUrl}}/v2/accounts:revokeToken"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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}}/v2/accounts:revokeToken"),
Content = new StringContent("{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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}}/v2/accounts:revokeToken");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/accounts:revokeToken"
payload := strings.NewReader("{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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/v2/accounts:revokeToken HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 112
{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/accounts:revokeToken")
.setHeader("content-type", "application/json")
.setBody("{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/accounts:revokeToken"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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 \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/accounts:revokeToken")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/accounts:revokeToken")
.header("content-type", "application/json")
.body("{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}")
.asString();
const data = JSON.stringify({
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/accounts:revokeToken');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts:revokeToken',
headers: {'content-type': 'application/json'},
data: {
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/accounts:revokeToken';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","providerId":"","redirectUri":"","tenantId":"","token":"","tokenType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/accounts:revokeToken',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "idToken": "",\n "providerId": "",\n "redirectUri": "",\n "tenantId": "",\n "token": "",\n "tokenType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/accounts:revokeToken")
.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/v2/accounts:revokeToken',
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({
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/accounts:revokeToken',
headers: {'content-type': 'application/json'},
body: {
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
},
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}}/v2/accounts:revokeToken');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
});
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}}/v2/accounts:revokeToken',
headers: {'content-type': 'application/json'},
data: {
idToken: '',
providerId: '',
redirectUri: '',
tenantId: '',
token: '',
tokenType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/accounts:revokeToken';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"idToken":"","providerId":"","redirectUri":"","tenantId":"","token":"","tokenType":""}'
};
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 = @{ @"idToken": @"",
@"providerId": @"",
@"redirectUri": @"",
@"tenantId": @"",
@"token": @"",
@"tokenType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/accounts:revokeToken"]
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}}/v2/accounts:revokeToken" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/accounts:revokeToken",
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([
'idToken' => '',
'providerId' => '',
'redirectUri' => '',
'tenantId' => '',
'token' => '',
'tokenType' => ''
]),
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}}/v2/accounts:revokeToken', [
'body' => '{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/accounts:revokeToken');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'idToken' => '',
'providerId' => '',
'redirectUri' => '',
'tenantId' => '',
'token' => '',
'tokenType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'idToken' => '',
'providerId' => '',
'redirectUri' => '',
'tenantId' => '',
'token' => '',
'tokenType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/accounts:revokeToken');
$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}}/v2/accounts:revokeToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/accounts:revokeToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/accounts:revokeToken", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/accounts:revokeToken"
payload = {
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/accounts:revokeToken"
payload <- "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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}}/v2/accounts:revokeToken")
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 \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\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/v2/accounts:revokeToken') do |req|
req.body = "{\n \"idToken\": \"\",\n \"providerId\": \"\",\n \"redirectUri\": \"\",\n \"tenantId\": \"\",\n \"token\": \"\",\n \"tokenType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/accounts:revokeToken";
let payload = json!({
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
});
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}}/v2/accounts:revokeToken \
--header 'content-type: application/json' \
--data '{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}'
echo '{
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
}' | \
http POST {{baseUrl}}/v2/accounts:revokeToken \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "idToken": "",\n "providerId": "",\n "redirectUri": "",\n "tenantId": "",\n "token": "",\n "tokenType": ""\n}' \
--output-document \
- {{baseUrl}}/v2/accounts:revokeToken
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"idToken": "",
"providerId": "",
"redirectUri": "",
"tenantId": "",
"token": "",
"tokenType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/accounts:revokeToken")! 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()
GET
identitytoolkit.defaultSupportedIdps.list
{{baseUrl}}/v2/defaultSupportedIdps
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/defaultSupportedIdps");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/defaultSupportedIdps")
require "http/client"
url = "{{baseUrl}}/v2/defaultSupportedIdps"
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}}/v2/defaultSupportedIdps"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/defaultSupportedIdps");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/defaultSupportedIdps"
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/v2/defaultSupportedIdps HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/defaultSupportedIdps")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/defaultSupportedIdps"))
.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}}/v2/defaultSupportedIdps")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/defaultSupportedIdps")
.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}}/v2/defaultSupportedIdps');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2/defaultSupportedIdps'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/defaultSupportedIdps';
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}}/v2/defaultSupportedIdps',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/defaultSupportedIdps")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/defaultSupportedIdps',
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}}/v2/defaultSupportedIdps'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/defaultSupportedIdps');
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}}/v2/defaultSupportedIdps'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/defaultSupportedIdps';
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}}/v2/defaultSupportedIdps"]
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}}/v2/defaultSupportedIdps" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/defaultSupportedIdps",
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}}/v2/defaultSupportedIdps');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/defaultSupportedIdps');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/defaultSupportedIdps');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/defaultSupportedIdps' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/defaultSupportedIdps' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/defaultSupportedIdps")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/defaultSupportedIdps"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/defaultSupportedIdps"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/defaultSupportedIdps")
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/v2/defaultSupportedIdps') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/defaultSupportedIdps";
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}}/v2/defaultSupportedIdps
http GET {{baseUrl}}/v2/defaultSupportedIdps
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/defaultSupportedIdps
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/defaultSupportedIdps")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.identityPlatform.initializeAuth
{{baseUrl}}/v2/:project/identityPlatform:initializeAuth
QUERY PARAMS
project
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v2/:project/identityPlatform:initializeAuth"),
Content = new StringContent("{}")
{
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}}/v2/:project/identityPlatform:initializeAuth");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"
payload := strings.NewReader("{}")
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/v2/:project/identityPlatform:initializeAuth HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:project/identityPlatform:initializeAuth")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:project/identityPlatform:initializeAuth")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:project/identityPlatform:initializeAuth")
.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/v2/:project/identityPlatform:initializeAuth',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth',
headers: {'content-type': 'application/json'},
body: {},
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}}/v2/:project/identityPlatform:initializeAuth');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v2/:project/identityPlatform:initializeAuth',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"]
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}}/v2/:project/identityPlatform:initializeAuth" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:project/identityPlatform:initializeAuth",
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([
]),
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}}/v2/:project/identityPlatform:initializeAuth', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:project/identityPlatform:initializeAuth');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v2/:project/identityPlatform:initializeAuth');
$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}}/v2/:project/identityPlatform:initializeAuth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:project/identityPlatform:initializeAuth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:project/identityPlatform:initializeAuth", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth"
payload <- "{}"
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}}/v2/:project/identityPlatform:initializeAuth")
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 = "{}"
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/v2/:project/identityPlatform:initializeAuth') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth";
let payload = json!({});
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}}/v2/:project/identityPlatform:initializeAuth \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v2/:project/identityPlatform:initializeAuth \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v2/:project/identityPlatform:initializeAuth
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:project/identityPlatform:initializeAuth")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.create
{{baseUrl}}/v2/:parent/tenants
QUERY PARAMS
parent
BODY json
{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/tenants");
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 \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:parent/tenants" {:content-type :json
:form-params {:allowPasswordSignup false
:autodeleteAnonymousUsers false
:client {:permissions {:disabledUserDeletion false
:disabledUserSignup false}}
:disableAuth false
:displayName ""
:emailPrivacyConfig {:enableImprovedEmailPrivacy false}
:enableAnonymousUser false
:enableEmailLinkSignin false
:hashConfig {:algorithm ""
:memoryCost 0
:rounds 0
:saltSeparator ""
:signerKey ""}
:inheritance {:emailSendingConfig false}
:mfaConfig {:enabledProviders []
:providerConfigs [{:state ""
:totpProviderConfig {:adjacentIntervals 0}}]
:state ""}
:monitoring {:requestLogging {:enabled false}}
:name ""
:recaptchaConfig {:emailPasswordEnforcementState ""
:managedRules [{:action ""
:endScore ""}]
:recaptchaKeys [{:key ""
:type ""}]
:useAccountDefender false}
:smsRegionConfig {:allowByDefault {:disallowedRegions []}
:allowlistOnly {:allowedRegions []}}
:testPhoneNumbers {}}})
require "http/client"
url = "{{baseUrl}}/v2/:parent/tenants"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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}}/v2/:parent/tenants"),
Content = new StringContent("{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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}}/v2/:parent/tenants");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/tenants"
payload := strings.NewReader("{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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/v2/:parent/tenants HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1299
{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:parent/tenants")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/tenants"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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 \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:parent/tenants")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:parent/tenants")
.header("content-type", "application/json")
.body("{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}")
.asString();
const data = JSON.stringify({
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {
permissions: {
disabledUserDeletion: false,
disabledUserSignup: false
}
},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {
enableImprovedEmailPrivacy: false
},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {
algorithm: '',
memoryCost: 0,
rounds: 0,
saltSeparator: '',
signerKey: ''
},
inheritance: {
emailSendingConfig: false
},
mfaConfig: {
enabledProviders: [],
providerConfigs: [
{
state: '',
totpProviderConfig: {
adjacentIntervals: 0
}
}
],
state: ''
},
monitoring: {
requestLogging: {
enabled: false
}
},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [
{
action: '',
endScore: ''
}
],
recaptchaKeys: [
{
key: '',
type: ''
}
],
useAccountDefender: false
},
smsRegionConfig: {
allowByDefault: {
disallowedRegions: []
},
allowlistOnly: {
allowedRegions: []
}
},
testPhoneNumbers: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:parent/tenants');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/tenants',
headers: {'content-type': 'application/json'},
data: {
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {permissions: {disabledUserDeletion: false, disabledUserSignup: false}},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {enableImprovedEmailPrivacy: false},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {algorithm: '', memoryCost: 0, rounds: 0, saltSeparator: '', signerKey: ''},
inheritance: {emailSendingConfig: false},
mfaConfig: {
enabledProviders: [],
providerConfigs: [{state: '', totpProviderConfig: {adjacentIntervals: 0}}],
state: ''
},
monitoring: {requestLogging: {enabled: false}},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [{action: '', endScore: ''}],
recaptchaKeys: [{key: '', type: ''}],
useAccountDefender: false
},
smsRegionConfig: {allowByDefault: {disallowedRegions: []}, allowlistOnly: {allowedRegions: []}},
testPhoneNumbers: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/tenants';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowPasswordSignup":false,"autodeleteAnonymousUsers":false,"client":{"permissions":{"disabledUserDeletion":false,"disabledUserSignup":false}},"disableAuth":false,"displayName":"","emailPrivacyConfig":{"enableImprovedEmailPrivacy":false},"enableAnonymousUser":false,"enableEmailLinkSignin":false,"hashConfig":{"algorithm":"","memoryCost":0,"rounds":0,"saltSeparator":"","signerKey":""},"inheritance":{"emailSendingConfig":false},"mfaConfig":{"enabledProviders":[],"providerConfigs":[{"state":"","totpProviderConfig":{"adjacentIntervals":0}}],"state":""},"monitoring":{"requestLogging":{"enabled":false}},"name":"","recaptchaConfig":{"emailPasswordEnforcementState":"","managedRules":[{"action":"","endScore":""}],"recaptchaKeys":[{"key":"","type":""}],"useAccountDefender":false},"smsRegionConfig":{"allowByDefault":{"disallowedRegions":[]},"allowlistOnly":{"allowedRegions":[]}},"testPhoneNumbers":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:parent/tenants',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowPasswordSignup": false,\n "autodeleteAnonymousUsers": false,\n "client": {\n "permissions": {\n "disabledUserDeletion": false,\n "disabledUserSignup": false\n }\n },\n "disableAuth": false,\n "displayName": "",\n "emailPrivacyConfig": {\n "enableImprovedEmailPrivacy": false\n },\n "enableAnonymousUser": false,\n "enableEmailLinkSignin": false,\n "hashConfig": {\n "algorithm": "",\n "memoryCost": 0,\n "rounds": 0,\n "saltSeparator": "",\n "signerKey": ""\n },\n "inheritance": {\n "emailSendingConfig": false\n },\n "mfaConfig": {\n "enabledProviders": [],\n "providerConfigs": [\n {\n "state": "",\n "totpProviderConfig": {\n "adjacentIntervals": 0\n }\n }\n ],\n "state": ""\n },\n "monitoring": {\n "requestLogging": {\n "enabled": false\n }\n },\n "name": "",\n "recaptchaConfig": {\n "emailPasswordEnforcementState": "",\n "managedRules": [\n {\n "action": "",\n "endScore": ""\n }\n ],\n "recaptchaKeys": [\n {\n "key": "",\n "type": ""\n }\n ],\n "useAccountDefender": false\n },\n "smsRegionConfig": {\n "allowByDefault": {\n "disallowedRegions": []\n },\n "allowlistOnly": {\n "allowedRegions": []\n }\n },\n "testPhoneNumbers": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/tenants")
.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/v2/:parent/tenants',
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({
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {permissions: {disabledUserDeletion: false, disabledUserSignup: false}},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {enableImprovedEmailPrivacy: false},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {algorithm: '', memoryCost: 0, rounds: 0, saltSeparator: '', signerKey: ''},
inheritance: {emailSendingConfig: false},
mfaConfig: {
enabledProviders: [],
providerConfigs: [{state: '', totpProviderConfig: {adjacentIntervals: 0}}],
state: ''
},
monitoring: {requestLogging: {enabled: false}},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [{action: '', endScore: ''}],
recaptchaKeys: [{key: '', type: ''}],
useAccountDefender: false
},
smsRegionConfig: {allowByDefault: {disallowedRegions: []}, allowlistOnly: {allowedRegions: []}},
testPhoneNumbers: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/tenants',
headers: {'content-type': 'application/json'},
body: {
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {permissions: {disabledUserDeletion: false, disabledUserSignup: false}},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {enableImprovedEmailPrivacy: false},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {algorithm: '', memoryCost: 0, rounds: 0, saltSeparator: '', signerKey: ''},
inheritance: {emailSendingConfig: false},
mfaConfig: {
enabledProviders: [],
providerConfigs: [{state: '', totpProviderConfig: {adjacentIntervals: 0}}],
state: ''
},
monitoring: {requestLogging: {enabled: false}},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [{action: '', endScore: ''}],
recaptchaKeys: [{key: '', type: ''}],
useAccountDefender: false
},
smsRegionConfig: {allowByDefault: {disallowedRegions: []}, allowlistOnly: {allowedRegions: []}},
testPhoneNumbers: {}
},
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}}/v2/:parent/tenants');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {
permissions: {
disabledUserDeletion: false,
disabledUserSignup: false
}
},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {
enableImprovedEmailPrivacy: false
},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {
algorithm: '',
memoryCost: 0,
rounds: 0,
saltSeparator: '',
signerKey: ''
},
inheritance: {
emailSendingConfig: false
},
mfaConfig: {
enabledProviders: [],
providerConfigs: [
{
state: '',
totpProviderConfig: {
adjacentIntervals: 0
}
}
],
state: ''
},
monitoring: {
requestLogging: {
enabled: false
}
},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [
{
action: '',
endScore: ''
}
],
recaptchaKeys: [
{
key: '',
type: ''
}
],
useAccountDefender: false
},
smsRegionConfig: {
allowByDefault: {
disallowedRegions: []
},
allowlistOnly: {
allowedRegions: []
}
},
testPhoneNumbers: {}
});
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}}/v2/:parent/tenants',
headers: {'content-type': 'application/json'},
data: {
allowPasswordSignup: false,
autodeleteAnonymousUsers: false,
client: {permissions: {disabledUserDeletion: false, disabledUserSignup: false}},
disableAuth: false,
displayName: '',
emailPrivacyConfig: {enableImprovedEmailPrivacy: false},
enableAnonymousUser: false,
enableEmailLinkSignin: false,
hashConfig: {algorithm: '', memoryCost: 0, rounds: 0, saltSeparator: '', signerKey: ''},
inheritance: {emailSendingConfig: false},
mfaConfig: {
enabledProviders: [],
providerConfigs: [{state: '', totpProviderConfig: {adjacentIntervals: 0}}],
state: ''
},
monitoring: {requestLogging: {enabled: false}},
name: '',
recaptchaConfig: {
emailPasswordEnforcementState: '',
managedRules: [{action: '', endScore: ''}],
recaptchaKeys: [{key: '', type: ''}],
useAccountDefender: false
},
smsRegionConfig: {allowByDefault: {disallowedRegions: []}, allowlistOnly: {allowedRegions: []}},
testPhoneNumbers: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/tenants';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowPasswordSignup":false,"autodeleteAnonymousUsers":false,"client":{"permissions":{"disabledUserDeletion":false,"disabledUserSignup":false}},"disableAuth":false,"displayName":"","emailPrivacyConfig":{"enableImprovedEmailPrivacy":false},"enableAnonymousUser":false,"enableEmailLinkSignin":false,"hashConfig":{"algorithm":"","memoryCost":0,"rounds":0,"saltSeparator":"","signerKey":""},"inheritance":{"emailSendingConfig":false},"mfaConfig":{"enabledProviders":[],"providerConfigs":[{"state":"","totpProviderConfig":{"adjacentIntervals":0}}],"state":""},"monitoring":{"requestLogging":{"enabled":false}},"name":"","recaptchaConfig":{"emailPasswordEnforcementState":"","managedRules":[{"action":"","endScore":""}],"recaptchaKeys":[{"key":"","type":""}],"useAccountDefender":false},"smsRegionConfig":{"allowByDefault":{"disallowedRegions":[]},"allowlistOnly":{"allowedRegions":[]}},"testPhoneNumbers":{}}'
};
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 = @{ @"allowPasswordSignup": @NO,
@"autodeleteAnonymousUsers": @NO,
@"client": @{ @"permissions": @{ @"disabledUserDeletion": @NO, @"disabledUserSignup": @NO } },
@"disableAuth": @NO,
@"displayName": @"",
@"emailPrivacyConfig": @{ @"enableImprovedEmailPrivacy": @NO },
@"enableAnonymousUser": @NO,
@"enableEmailLinkSignin": @NO,
@"hashConfig": @{ @"algorithm": @"", @"memoryCost": @0, @"rounds": @0, @"saltSeparator": @"", @"signerKey": @"" },
@"inheritance": @{ @"emailSendingConfig": @NO },
@"mfaConfig": @{ @"enabledProviders": @[ ], @"providerConfigs": @[ @{ @"state": @"", @"totpProviderConfig": @{ @"adjacentIntervals": @0 } } ], @"state": @"" },
@"monitoring": @{ @"requestLogging": @{ @"enabled": @NO } },
@"name": @"",
@"recaptchaConfig": @{ @"emailPasswordEnforcementState": @"", @"managedRules": @[ @{ @"action": @"", @"endScore": @"" } ], @"recaptchaKeys": @[ @{ @"key": @"", @"type": @"" } ], @"useAccountDefender": @NO },
@"smsRegionConfig": @{ @"allowByDefault": @{ @"disallowedRegions": @[ ] }, @"allowlistOnly": @{ @"allowedRegions": @[ ] } },
@"testPhoneNumbers": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:parent/tenants"]
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}}/v2/:parent/tenants" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/tenants",
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([
'allowPasswordSignup' => null,
'autodeleteAnonymousUsers' => null,
'client' => [
'permissions' => [
'disabledUserDeletion' => null,
'disabledUserSignup' => null
]
],
'disableAuth' => null,
'displayName' => '',
'emailPrivacyConfig' => [
'enableImprovedEmailPrivacy' => null
],
'enableAnonymousUser' => null,
'enableEmailLinkSignin' => null,
'hashConfig' => [
'algorithm' => '',
'memoryCost' => 0,
'rounds' => 0,
'saltSeparator' => '',
'signerKey' => ''
],
'inheritance' => [
'emailSendingConfig' => null
],
'mfaConfig' => [
'enabledProviders' => [
],
'providerConfigs' => [
[
'state' => '',
'totpProviderConfig' => [
'adjacentIntervals' => 0
]
]
],
'state' => ''
],
'monitoring' => [
'requestLogging' => [
'enabled' => null
]
],
'name' => '',
'recaptchaConfig' => [
'emailPasswordEnforcementState' => '',
'managedRules' => [
[
'action' => '',
'endScore' => ''
]
],
'recaptchaKeys' => [
[
'key' => '',
'type' => ''
]
],
'useAccountDefender' => null
],
'smsRegionConfig' => [
'allowByDefault' => [
'disallowedRegions' => [
]
],
'allowlistOnly' => [
'allowedRegions' => [
]
]
],
'testPhoneNumbers' => [
]
]),
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}}/v2/:parent/tenants', [
'body' => '{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/tenants');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowPasswordSignup' => null,
'autodeleteAnonymousUsers' => null,
'client' => [
'permissions' => [
'disabledUserDeletion' => null,
'disabledUserSignup' => null
]
],
'disableAuth' => null,
'displayName' => '',
'emailPrivacyConfig' => [
'enableImprovedEmailPrivacy' => null
],
'enableAnonymousUser' => null,
'enableEmailLinkSignin' => null,
'hashConfig' => [
'algorithm' => '',
'memoryCost' => 0,
'rounds' => 0,
'saltSeparator' => '',
'signerKey' => ''
],
'inheritance' => [
'emailSendingConfig' => null
],
'mfaConfig' => [
'enabledProviders' => [
],
'providerConfigs' => [
[
'state' => '',
'totpProviderConfig' => [
'adjacentIntervals' => 0
]
]
],
'state' => ''
],
'monitoring' => [
'requestLogging' => [
'enabled' => null
]
],
'name' => '',
'recaptchaConfig' => [
'emailPasswordEnforcementState' => '',
'managedRules' => [
[
'action' => '',
'endScore' => ''
]
],
'recaptchaKeys' => [
[
'key' => '',
'type' => ''
]
],
'useAccountDefender' => null
],
'smsRegionConfig' => [
'allowByDefault' => [
'disallowedRegions' => [
]
],
'allowlistOnly' => [
'allowedRegions' => [
]
]
],
'testPhoneNumbers' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowPasswordSignup' => null,
'autodeleteAnonymousUsers' => null,
'client' => [
'permissions' => [
'disabledUserDeletion' => null,
'disabledUserSignup' => null
]
],
'disableAuth' => null,
'displayName' => '',
'emailPrivacyConfig' => [
'enableImprovedEmailPrivacy' => null
],
'enableAnonymousUser' => null,
'enableEmailLinkSignin' => null,
'hashConfig' => [
'algorithm' => '',
'memoryCost' => 0,
'rounds' => 0,
'saltSeparator' => '',
'signerKey' => ''
],
'inheritance' => [
'emailSendingConfig' => null
],
'mfaConfig' => [
'enabledProviders' => [
],
'providerConfigs' => [
[
'state' => '',
'totpProviderConfig' => [
'adjacentIntervals' => 0
]
]
],
'state' => ''
],
'monitoring' => [
'requestLogging' => [
'enabled' => null
]
],
'name' => '',
'recaptchaConfig' => [
'emailPasswordEnforcementState' => '',
'managedRules' => [
[
'action' => '',
'endScore' => ''
]
],
'recaptchaKeys' => [
[
'key' => '',
'type' => ''
]
],
'useAccountDefender' => null
],
'smsRegionConfig' => [
'allowByDefault' => [
'disallowedRegions' => [
]
],
'allowlistOnly' => [
'allowedRegions' => [
]
]
],
'testPhoneNumbers' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:parent/tenants');
$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}}/v2/:parent/tenants' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/tenants' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:parent/tenants", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/tenants"
payload = {
"allowPasswordSignup": False,
"autodeleteAnonymousUsers": False,
"client": { "permissions": {
"disabledUserDeletion": False,
"disabledUserSignup": False
} },
"disableAuth": False,
"displayName": "",
"emailPrivacyConfig": { "enableImprovedEmailPrivacy": False },
"enableAnonymousUser": False,
"enableEmailLinkSignin": False,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": { "emailSendingConfig": False },
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": { "adjacentIntervals": 0 }
}
],
"state": ""
},
"monitoring": { "requestLogging": { "enabled": False } },
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": False
},
"smsRegionConfig": {
"allowByDefault": { "disallowedRegions": [] },
"allowlistOnly": { "allowedRegions": [] }
},
"testPhoneNumbers": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/tenants"
payload <- "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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}}/v2/:parent/tenants")
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 \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\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/v2/:parent/tenants') do |req|
req.body = "{\n \"allowPasswordSignup\": false,\n \"autodeleteAnonymousUsers\": false,\n \"client\": {\n \"permissions\": {\n \"disabledUserDeletion\": false,\n \"disabledUserSignup\": false\n }\n },\n \"disableAuth\": false,\n \"displayName\": \"\",\n \"emailPrivacyConfig\": {\n \"enableImprovedEmailPrivacy\": false\n },\n \"enableAnonymousUser\": false,\n \"enableEmailLinkSignin\": false,\n \"hashConfig\": {\n \"algorithm\": \"\",\n \"memoryCost\": 0,\n \"rounds\": 0,\n \"saltSeparator\": \"\",\n \"signerKey\": \"\"\n },\n \"inheritance\": {\n \"emailSendingConfig\": false\n },\n \"mfaConfig\": {\n \"enabledProviders\": [],\n \"providerConfigs\": [\n {\n \"state\": \"\",\n \"totpProviderConfig\": {\n \"adjacentIntervals\": 0\n }\n }\n ],\n \"state\": \"\"\n },\n \"monitoring\": {\n \"requestLogging\": {\n \"enabled\": false\n }\n },\n \"name\": \"\",\n \"recaptchaConfig\": {\n \"emailPasswordEnforcementState\": \"\",\n \"managedRules\": [\n {\n \"action\": \"\",\n \"endScore\": \"\"\n }\n ],\n \"recaptchaKeys\": [\n {\n \"key\": \"\",\n \"type\": \"\"\n }\n ],\n \"useAccountDefender\": false\n },\n \"smsRegionConfig\": {\n \"allowByDefault\": {\n \"disallowedRegions\": []\n },\n \"allowlistOnly\": {\n \"allowedRegions\": []\n }\n },\n \"testPhoneNumbers\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/tenants";
let payload = json!({
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": json!({"permissions": json!({
"disabledUserDeletion": false,
"disabledUserSignup": false
})}),
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": json!({"enableImprovedEmailPrivacy": false}),
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": json!({
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
}),
"inheritance": json!({"emailSendingConfig": false}),
"mfaConfig": json!({
"enabledProviders": (),
"providerConfigs": (
json!({
"state": "",
"totpProviderConfig": json!({"adjacentIntervals": 0})
})
),
"state": ""
}),
"monitoring": json!({"requestLogging": json!({"enabled": false})}),
"name": "",
"recaptchaConfig": json!({
"emailPasswordEnforcementState": "",
"managedRules": (
json!({
"action": "",
"endScore": ""
})
),
"recaptchaKeys": (
json!({
"key": "",
"type": ""
})
),
"useAccountDefender": false
}),
"smsRegionConfig": json!({
"allowByDefault": json!({"disallowedRegions": ()}),
"allowlistOnly": json!({"allowedRegions": ()})
}),
"testPhoneNumbers": json!({})
});
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}}/v2/:parent/tenants \
--header 'content-type: application/json' \
--data '{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}'
echo '{
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": {
"permissions": {
"disabledUserDeletion": false,
"disabledUserSignup": false
}
},
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": {
"enableImprovedEmailPrivacy": false
},
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": {
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
},
"inheritance": {
"emailSendingConfig": false
},
"mfaConfig": {
"enabledProviders": [],
"providerConfigs": [
{
"state": "",
"totpProviderConfig": {
"adjacentIntervals": 0
}
}
],
"state": ""
},
"monitoring": {
"requestLogging": {
"enabled": false
}
},
"name": "",
"recaptchaConfig": {
"emailPasswordEnforcementState": "",
"managedRules": [
{
"action": "",
"endScore": ""
}
],
"recaptchaKeys": [
{
"key": "",
"type": ""
}
],
"useAccountDefender": false
},
"smsRegionConfig": {
"allowByDefault": {
"disallowedRegions": []
},
"allowlistOnly": {
"allowedRegions": []
}
},
"testPhoneNumbers": {}
}' | \
http POST {{baseUrl}}/v2/:parent/tenants \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "allowPasswordSignup": false,\n "autodeleteAnonymousUsers": false,\n "client": {\n "permissions": {\n "disabledUserDeletion": false,\n "disabledUserSignup": false\n }\n },\n "disableAuth": false,\n "displayName": "",\n "emailPrivacyConfig": {\n "enableImprovedEmailPrivacy": false\n },\n "enableAnonymousUser": false,\n "enableEmailLinkSignin": false,\n "hashConfig": {\n "algorithm": "",\n "memoryCost": 0,\n "rounds": 0,\n "saltSeparator": "",\n "signerKey": ""\n },\n "inheritance": {\n "emailSendingConfig": false\n },\n "mfaConfig": {\n "enabledProviders": [],\n "providerConfigs": [\n {\n "state": "",\n "totpProviderConfig": {\n "adjacentIntervals": 0\n }\n }\n ],\n "state": ""\n },\n "monitoring": {\n "requestLogging": {\n "enabled": false\n }\n },\n "name": "",\n "recaptchaConfig": {\n "emailPasswordEnforcementState": "",\n "managedRules": [\n {\n "action": "",\n "endScore": ""\n }\n ],\n "recaptchaKeys": [\n {\n "key": "",\n "type": ""\n }\n ],\n "useAccountDefender": false\n },\n "smsRegionConfig": {\n "allowByDefault": {\n "disallowedRegions": []\n },\n "allowlistOnly": {\n "allowedRegions": []\n }\n },\n "testPhoneNumbers": {}\n}' \
--output-document \
- {{baseUrl}}/v2/:parent/tenants
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowPasswordSignup": false,
"autodeleteAnonymousUsers": false,
"client": ["permissions": [
"disabledUserDeletion": false,
"disabledUserSignup": false
]],
"disableAuth": false,
"displayName": "",
"emailPrivacyConfig": ["enableImprovedEmailPrivacy": false],
"enableAnonymousUser": false,
"enableEmailLinkSignin": false,
"hashConfig": [
"algorithm": "",
"memoryCost": 0,
"rounds": 0,
"saltSeparator": "",
"signerKey": ""
],
"inheritance": ["emailSendingConfig": false],
"mfaConfig": [
"enabledProviders": [],
"providerConfigs": [
[
"state": "",
"totpProviderConfig": ["adjacentIntervals": 0]
]
],
"state": ""
],
"monitoring": ["requestLogging": ["enabled": false]],
"name": "",
"recaptchaConfig": [
"emailPasswordEnforcementState": "",
"managedRules": [
[
"action": "",
"endScore": ""
]
],
"recaptchaKeys": [
[
"key": "",
"type": ""
]
],
"useAccountDefender": false
],
"smsRegionConfig": [
"allowByDefault": ["disallowedRegions": []],
"allowlistOnly": ["allowedRegions": []]
],
"testPhoneNumbers": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/tenants")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.defaultSupportedIdpConfigs.create
{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs
QUERY PARAMS
parent
BODY json
{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs");
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 \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs" {:content-type :json
:form-params {:appleSignInConfig {:bundleIds []
:codeFlowConfig {:keyId ""
:privateKey ""
:teamId ""}}
:clientId ""
:clientSecret ""
:enabled false
:name ""}})
require "http/client"
url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"),
Content = new StringContent("{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
payload := strings.NewReader("{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v2/:parent/defaultSupportedIdpConfigs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 219
{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.setHeader("content-type", "application/json")
.setBody("{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.header("content-type", "application/json")
.body("{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
appleSignInConfig: {
bundleIds: [],
codeFlowConfig: {
keyId: '',
privateKey: '',
teamId: ''
}
},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs',
headers: {'content-type': 'application/json'},
data: {
appleSignInConfig: {bundleIds: [], codeFlowConfig: {keyId: '', privateKey: '', teamId: ''}},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"appleSignInConfig":{"bundleIds":[],"codeFlowConfig":{"keyId":"","privateKey":"","teamId":""}},"clientId":"","clientSecret":"","enabled":false,"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "appleSignInConfig": {\n "bundleIds": [],\n "codeFlowConfig": {\n "keyId": "",\n "privateKey": "",\n "teamId": ""\n }\n },\n "clientId": "",\n "clientSecret": "",\n "enabled": false,\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.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/v2/:parent/defaultSupportedIdpConfigs',
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({
appleSignInConfig: {bundleIds: [], codeFlowConfig: {keyId: '', privateKey: '', teamId: ''}},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs',
headers: {'content-type': 'application/json'},
body: {
appleSignInConfig: {bundleIds: [], codeFlowConfig: {keyId: '', privateKey: '', teamId: ''}},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
appleSignInConfig: {
bundleIds: [],
codeFlowConfig: {
keyId: '',
privateKey: '',
teamId: ''
}
},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs',
headers: {'content-type': 'application/json'},
data: {
appleSignInConfig: {bundleIds: [], codeFlowConfig: {keyId: '', privateKey: '', teamId: ''}},
clientId: '',
clientSecret: '',
enabled: false,
name: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"appleSignInConfig":{"bundleIds":[],"codeFlowConfig":{"keyId":"","privateKey":"","teamId":""}},"clientId":"","clientSecret":"","enabled":false,"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"appleSignInConfig": @{ @"bundleIds": @[ ], @"codeFlowConfig": @{ @"keyId": @"", @"privateKey": @"", @"teamId": @"" } },
@"clientId": @"",
@"clientSecret": @"",
@"enabled": @NO,
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"]
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}}/v2/:parent/defaultSupportedIdpConfigs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs",
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([
'appleSignInConfig' => [
'bundleIds' => [
],
'codeFlowConfig' => [
'keyId' => '',
'privateKey' => '',
'teamId' => ''
]
],
'clientId' => '',
'clientSecret' => '',
'enabled' => null,
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs', [
'body' => '{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'appleSignInConfig' => [
'bundleIds' => [
],
'codeFlowConfig' => [
'keyId' => '',
'privateKey' => '',
'teamId' => ''
]
],
'clientId' => '',
'clientSecret' => '',
'enabled' => null,
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'appleSignInConfig' => [
'bundleIds' => [
],
'codeFlowConfig' => [
'keyId' => '',
'privateKey' => '',
'teamId' => ''
]
],
'clientId' => '',
'clientSecret' => '',
'enabled' => null,
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
$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}}/v2/:parent/defaultSupportedIdpConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:parent/defaultSupportedIdpConfigs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
payload = {
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": False,
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
payload <- "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
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 \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v2/:parent/defaultSupportedIdpConfigs') do |req|
req.body = "{\n \"appleSignInConfig\": {\n \"bundleIds\": [],\n \"codeFlowConfig\": {\n \"keyId\": \"\",\n \"privateKey\": \"\",\n \"teamId\": \"\"\n }\n },\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"enabled\": false,\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs";
let payload = json!({
"appleSignInConfig": json!({
"bundleIds": (),
"codeFlowConfig": json!({
"keyId": "",
"privateKey": "",
"teamId": ""
})
}),
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs \
--header 'content-type: application/json' \
--data '{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}'
echo '{
"appleSignInConfig": {
"bundleIds": [],
"codeFlowConfig": {
"keyId": "",
"privateKey": "",
"teamId": ""
}
},
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
}' | \
http POST {{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "appleSignInConfig": {\n "bundleIds": [],\n "codeFlowConfig": {\n "keyId": "",\n "privateKey": "",\n "teamId": ""\n }\n },\n "clientId": "",\n "clientSecret": "",\n "enabled": false,\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"appleSignInConfig": [
"bundleIds": [],
"codeFlowConfig": [
"keyId": "",
"privateKey": "",
"teamId": ""
]
],
"clientId": "",
"clientSecret": "",
"enabled": false,
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")! 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()
GET
identitytoolkit.projects.tenants.defaultSupportedIdpConfigs.list
{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
require "http/client"
url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
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}}/v2/:parent/defaultSupportedIdpConfigs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
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/v2/:parent/defaultSupportedIdpConfigs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"))
.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}}/v2/:parent/defaultSupportedIdpConfigs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.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}}/v2/:parent/defaultSupportedIdpConfigs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs';
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}}/v2/:parent/defaultSupportedIdpConfigs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:parent/defaultSupportedIdpConfigs',
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}}/v2/:parent/defaultSupportedIdpConfigs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
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}}/v2/:parent/defaultSupportedIdpConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs';
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}}/v2/:parent/defaultSupportedIdpConfigs"]
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}}/v2/:parent/defaultSupportedIdpConfigs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs",
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}}/v2/:parent/defaultSupportedIdpConfigs');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/:parent/defaultSupportedIdpConfigs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")
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/v2/:parent/defaultSupportedIdpConfigs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs";
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}}/v2/:parent/defaultSupportedIdpConfigs
http GET {{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/defaultSupportedIdpConfigs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.getIamPolicy
{{baseUrl}}/v2/:resource:getIamPolicy
QUERY PARAMS
resource
BODY json
{
"options": {
"requestedPolicyVersion": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:resource:getIamPolicy");
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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:resource:getIamPolicy" {:content-type :json
:form-params {:options {:requestedPolicyVersion 0}}})
require "http/client"
url = "{{baseUrl}}/v2/:resource:getIamPolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\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}}/v2/:resource:getIamPolicy"),
Content = new StringContent("{\n \"options\": {\n \"requestedPolicyVersion\": 0\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}}/v2/:resource:getIamPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:resource:getIamPolicy"
payload := strings.NewReader("{\n \"options\": {\n \"requestedPolicyVersion\": 0\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/v2/:resource:getIamPolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"options": {
"requestedPolicyVersion": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:resource:getIamPolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:resource:getIamPolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"options\": {\n \"requestedPolicyVersion\": 0\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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:resource:getIamPolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:resource:getIamPolicy")
.header("content-type", "application/json")
.body("{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
.asString();
const data = JSON.stringify({
options: {
requestedPolicyVersion: 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}}/v2/:resource:getIamPolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:getIamPolicy',
headers: {'content-type': 'application/json'},
data: {options: {requestedPolicyVersion: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:resource:getIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"options":{"requestedPolicyVersion":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}}/v2/:resource:getIamPolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "options": {\n "requestedPolicyVersion": 0\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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:resource:getIamPolicy")
.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/v2/:resource:getIamPolicy',
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({options: {requestedPolicyVersion: 0}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:getIamPolicy',
headers: {'content-type': 'application/json'},
body: {options: {requestedPolicyVersion: 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}}/v2/:resource:getIamPolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
options: {
requestedPolicyVersion: 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}}/v2/:resource:getIamPolicy',
headers: {'content-type': 'application/json'},
data: {options: {requestedPolicyVersion: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:resource:getIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"options":{"requestedPolicyVersion":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 = @{ @"options": @{ @"requestedPolicyVersion": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:resource:getIamPolicy"]
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}}/v2/:resource:getIamPolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:resource:getIamPolicy",
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([
'options' => [
'requestedPolicyVersion' => 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}}/v2/:resource:getIamPolicy', [
'body' => '{
"options": {
"requestedPolicyVersion": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:resource:getIamPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'options' => [
'requestedPolicyVersion' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'options' => [
'requestedPolicyVersion' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:resource:getIamPolicy');
$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}}/v2/:resource:getIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"options": {
"requestedPolicyVersion": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:resource:getIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"options": {
"requestedPolicyVersion": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:resource:getIamPolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:resource:getIamPolicy"
payload = { "options": { "requestedPolicyVersion": 0 } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:resource:getIamPolicy"
payload <- "{\n \"options\": {\n \"requestedPolicyVersion\": 0\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}}/v2/:resource:getIamPolicy")
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 \"options\": {\n \"requestedPolicyVersion\": 0\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/v2/:resource:getIamPolicy') do |req|
req.body = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:resource:getIamPolicy";
let payload = json!({"options": json!({"requestedPolicyVersion": 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}}/v2/:resource:getIamPolicy \
--header 'content-type: application/json' \
--data '{
"options": {
"requestedPolicyVersion": 0
}
}'
echo '{
"options": {
"requestedPolicyVersion": 0
}
}' | \
http POST {{baseUrl}}/v2/:resource:getIamPolicy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "options": {\n "requestedPolicyVersion": 0\n }\n}' \
--output-document \
- {{baseUrl}}/v2/:resource:getIamPolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["options": ["requestedPolicyVersion": 0]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:resource:getIamPolicy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.inboundSamlConfigs.create
{{baseUrl}}/v2/:parent/inboundSamlConfigs
QUERY PARAMS
parent
BODY json
{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/inboundSamlConfigs");
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 \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:parent/inboundSamlConfigs" {:content-type :json
:form-params {:displayName ""
:enabled false
:idpConfig {:idpCertificates [{:x509Certificate ""}]
:idpEntityId ""
:signRequest false
:ssoUrl ""}
:name ""
:spConfig {:callbackUri ""
:spCertificates [{:expiresAt ""
:x509Certificate ""}]
:spEntityId ""}}})
require "http/client"
url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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}}/v2/:parent/inboundSamlConfigs"),
Content = new StringContent("{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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}}/v2/:parent/inboundSamlConfigs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
payload := strings.NewReader("{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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/v2/:parent/inboundSamlConfigs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 390
{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.setHeader("content-type", "application/json")
.setBody("{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/inboundSamlConfigs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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 \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.header("content-type", "application/json")
.body("{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [
{
x509Certificate: ''
}
],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [
{
expiresAt: '',
x509Certificate: ''
}
],
spEntityId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:parent/inboundSamlConfigs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/inboundSamlConfigs',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [{x509Certificate: ''}],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [{expiresAt: '', x509Certificate: ''}],
spEntityId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/inboundSamlConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","enabled":false,"idpConfig":{"idpCertificates":[{"x509Certificate":""}],"idpEntityId":"","signRequest":false,"ssoUrl":""},"name":"","spConfig":{"callbackUri":"","spCertificates":[{"expiresAt":"","x509Certificate":""}],"spEntityId":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:parent/inboundSamlConfigs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "displayName": "",\n "enabled": false,\n "idpConfig": {\n "idpCertificates": [\n {\n "x509Certificate": ""\n }\n ],\n "idpEntityId": "",\n "signRequest": false,\n "ssoUrl": ""\n },\n "name": "",\n "spConfig": {\n "callbackUri": "",\n "spCertificates": [\n {\n "expiresAt": "",\n "x509Certificate": ""\n }\n ],\n "spEntityId": ""\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 \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.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/v2/:parent/inboundSamlConfigs',
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({
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [{x509Certificate: ''}],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [{expiresAt: '', x509Certificate: ''}],
spEntityId: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/inboundSamlConfigs',
headers: {'content-type': 'application/json'},
body: {
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [{x509Certificate: ''}],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [{expiresAt: '', x509Certificate: ''}],
spEntityId: ''
}
},
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}}/v2/:parent/inboundSamlConfigs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [
{
x509Certificate: ''
}
],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [
{
expiresAt: '',
x509Certificate: ''
}
],
spEntityId: ''
}
});
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}}/v2/:parent/inboundSamlConfigs',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
enabled: false,
idpConfig: {
idpCertificates: [{x509Certificate: ''}],
idpEntityId: '',
signRequest: false,
ssoUrl: ''
},
name: '',
spConfig: {
callbackUri: '',
spCertificates: [{expiresAt: '', x509Certificate: ''}],
spEntityId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/inboundSamlConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","enabled":false,"idpConfig":{"idpCertificates":[{"x509Certificate":""}],"idpEntityId":"","signRequest":false,"ssoUrl":""},"name":"","spConfig":{"callbackUri":"","spCertificates":[{"expiresAt":"","x509Certificate":""}],"spEntityId":""}}'
};
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 = @{ @"displayName": @"",
@"enabled": @NO,
@"idpConfig": @{ @"idpCertificates": @[ @{ @"x509Certificate": @"" } ], @"idpEntityId": @"", @"signRequest": @NO, @"ssoUrl": @"" },
@"name": @"",
@"spConfig": @{ @"callbackUri": @"", @"spCertificates": @[ @{ @"expiresAt": @"", @"x509Certificate": @"" } ], @"spEntityId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:parent/inboundSamlConfigs"]
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}}/v2/:parent/inboundSamlConfigs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/inboundSamlConfigs",
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([
'displayName' => '',
'enabled' => null,
'idpConfig' => [
'idpCertificates' => [
[
'x509Certificate' => ''
]
],
'idpEntityId' => '',
'signRequest' => null,
'ssoUrl' => ''
],
'name' => '',
'spConfig' => [
'callbackUri' => '',
'spCertificates' => [
[
'expiresAt' => '',
'x509Certificate' => ''
]
],
'spEntityId' => ''
]
]),
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}}/v2/:parent/inboundSamlConfigs', [
'body' => '{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/inboundSamlConfigs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'displayName' => '',
'enabled' => null,
'idpConfig' => [
'idpCertificates' => [
[
'x509Certificate' => ''
]
],
'idpEntityId' => '',
'signRequest' => null,
'ssoUrl' => ''
],
'name' => '',
'spConfig' => [
'callbackUri' => '',
'spCertificates' => [
[
'expiresAt' => '',
'x509Certificate' => ''
]
],
'spEntityId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'displayName' => '',
'enabled' => null,
'idpConfig' => [
'idpCertificates' => [
[
'x509Certificate' => ''
]
],
'idpEntityId' => '',
'signRequest' => null,
'ssoUrl' => ''
],
'name' => '',
'spConfig' => [
'callbackUri' => '',
'spCertificates' => [
[
'expiresAt' => '',
'x509Certificate' => ''
]
],
'spEntityId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:parent/inboundSamlConfigs');
$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}}/v2/:parent/inboundSamlConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/inboundSamlConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:parent/inboundSamlConfigs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
payload = {
"displayName": "",
"enabled": False,
"idpConfig": {
"idpCertificates": [{ "x509Certificate": "" }],
"idpEntityId": "",
"signRequest": False,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
payload <- "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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}}/v2/:parent/inboundSamlConfigs")
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 \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\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/v2/:parent/inboundSamlConfigs') do |req|
req.body = "{\n \"displayName\": \"\",\n \"enabled\": false,\n \"idpConfig\": {\n \"idpCertificates\": [\n {\n \"x509Certificate\": \"\"\n }\n ],\n \"idpEntityId\": \"\",\n \"signRequest\": false,\n \"ssoUrl\": \"\"\n },\n \"name\": \"\",\n \"spConfig\": {\n \"callbackUri\": \"\",\n \"spCertificates\": [\n {\n \"expiresAt\": \"\",\n \"x509Certificate\": \"\"\n }\n ],\n \"spEntityId\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs";
let payload = json!({
"displayName": "",
"enabled": false,
"idpConfig": json!({
"idpCertificates": (json!({"x509Certificate": ""})),
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
}),
"name": "",
"spConfig": json!({
"callbackUri": "",
"spCertificates": (
json!({
"expiresAt": "",
"x509Certificate": ""
})
),
"spEntityId": ""
})
});
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}}/v2/:parent/inboundSamlConfigs \
--header 'content-type: application/json' \
--data '{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}'
echo '{
"displayName": "",
"enabled": false,
"idpConfig": {
"idpCertificates": [
{
"x509Certificate": ""
}
],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
},
"name": "",
"spConfig": {
"callbackUri": "",
"spCertificates": [
{
"expiresAt": "",
"x509Certificate": ""
}
],
"spEntityId": ""
}
}' | \
http POST {{baseUrl}}/v2/:parent/inboundSamlConfigs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "displayName": "",\n "enabled": false,\n "idpConfig": {\n "idpCertificates": [\n {\n "x509Certificate": ""\n }\n ],\n "idpEntityId": "",\n "signRequest": false,\n "ssoUrl": ""\n },\n "name": "",\n "spConfig": {\n "callbackUri": "",\n "spCertificates": [\n {\n "expiresAt": "",\n "x509Certificate": ""\n }\n ],\n "spEntityId": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v2/:parent/inboundSamlConfigs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"displayName": "",
"enabled": false,
"idpConfig": [
"idpCertificates": [["x509Certificate": ""]],
"idpEntityId": "",
"signRequest": false,
"ssoUrl": ""
],
"name": "",
"spConfig": [
"callbackUri": "",
"spCertificates": [
[
"expiresAt": "",
"x509Certificate": ""
]
],
"spEntityId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/inboundSamlConfigs")! 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()
GET
identitytoolkit.projects.tenants.inboundSamlConfigs.list
{{baseUrl}}/v2/:parent/inboundSamlConfigs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/inboundSamlConfigs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/:parent/inboundSamlConfigs")
require "http/client"
url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
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}}/v2/:parent/inboundSamlConfigs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/inboundSamlConfigs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
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/v2/:parent/inboundSamlConfigs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/inboundSamlConfigs"))
.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}}/v2/:parent/inboundSamlConfigs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.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}}/v2/:parent/inboundSamlConfigs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2/:parent/inboundSamlConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/inboundSamlConfigs';
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}}/v2/:parent/inboundSamlConfigs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:parent/inboundSamlConfigs',
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}}/v2/:parent/inboundSamlConfigs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/:parent/inboundSamlConfigs');
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}}/v2/:parent/inboundSamlConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/inboundSamlConfigs';
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}}/v2/:parent/inboundSamlConfigs"]
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}}/v2/:parent/inboundSamlConfigs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/inboundSamlConfigs",
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}}/v2/:parent/inboundSamlConfigs');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/inboundSamlConfigs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:parent/inboundSamlConfigs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:parent/inboundSamlConfigs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/inboundSamlConfigs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/:parent/inboundSamlConfigs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/inboundSamlConfigs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:parent/inboundSamlConfigs")
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/v2/:parent/inboundSamlConfigs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/inboundSamlConfigs";
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}}/v2/:parent/inboundSamlConfigs
http GET {{baseUrl}}/v2/:parent/inboundSamlConfigs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/:parent/inboundSamlConfigs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/inboundSamlConfigs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
identitytoolkit.projects.tenants.list
{{baseUrl}}/v2/:parent/tenants
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/tenants");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/:parent/tenants")
require "http/client"
url = "{{baseUrl}}/v2/:parent/tenants"
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}}/v2/:parent/tenants"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/tenants");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/tenants"
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/v2/:parent/tenants HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/:parent/tenants")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/tenants"))
.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}}/v2/:parent/tenants")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/:parent/tenants")
.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}}/v2/:parent/tenants');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2/:parent/tenants'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/tenants';
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}}/v2/:parent/tenants',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/tenants")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:parent/tenants',
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}}/v2/:parent/tenants'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/:parent/tenants');
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}}/v2/:parent/tenants'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/tenants';
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}}/v2/:parent/tenants"]
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}}/v2/:parent/tenants" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/tenants",
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}}/v2/:parent/tenants');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/tenants');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:parent/tenants');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:parent/tenants' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/tenants' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/:parent/tenants")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/tenants"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/tenants"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:parent/tenants")
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/v2/:parent/tenants') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/tenants";
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}}/v2/:parent/tenants
http GET {{baseUrl}}/v2/:parent/tenants
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/:parent/tenants
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/tenants")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.oauthIdpConfigs.create
{{baseUrl}}/v2/:parent/oauthIdpConfigs
QUERY PARAMS
parent
BODY json
{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/oauthIdpConfigs");
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 \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:parent/oauthIdpConfigs" {:content-type :json
:form-params {:clientId ""
:clientSecret ""
:displayName ""
:enabled false
:issuer ""
:name ""
:responseType {:code false
:idToken false
:token false}}})
require "http/client"
url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\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}}/v2/:parent/oauthIdpConfigs"),
Content = new StringContent("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/oauthIdpConfigs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
payload := strings.NewReader("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\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/v2/:parent/oauthIdpConfigs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 198
{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/oauthIdpConfigs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.header("content-type", "application/json")
.body("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
.asString();
const data = JSON.stringify({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {
code: false,
idToken: false,
token: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:parent/oauthIdpConfigs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/oauthIdpConfigs',
headers: {'content-type': 'application/json'},
data: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/oauthIdpConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":"","displayName":"","enabled":false,"issuer":"","name":"","responseType":{"code":false,"idToken":false,"token":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:parent/oauthIdpConfigs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientId": "",\n "clientSecret": "",\n "displayName": "",\n "enabled": false,\n "issuer": "",\n "name": "",\n "responseType": {\n "code": false,\n "idToken": false,\n "token": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.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/v2/:parent/oauthIdpConfigs',
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({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/oauthIdpConfigs',
headers: {'content-type': 'application/json'},
body: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v2/:parent/oauthIdpConfigs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {
code: false,
idToken: false,
token: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:parent/oauthIdpConfigs',
headers: {'content-type': 'application/json'},
data: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/oauthIdpConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":"","displayName":"","enabled":false,"issuer":"","name":"","responseType":{"code":false,"idToken":false,"token":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientId": @"",
@"clientSecret": @"",
@"displayName": @"",
@"enabled": @NO,
@"issuer": @"",
@"name": @"",
@"responseType": @{ @"code": @NO, @"idToken": @NO, @"token": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:parent/oauthIdpConfigs"]
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}}/v2/:parent/oauthIdpConfigs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/oauthIdpConfigs",
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([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v2/:parent/oauthIdpConfigs', [
'body' => '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/oauthIdpConfigs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:parent/oauthIdpConfigs');
$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}}/v2/:parent/oauthIdpConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/oauthIdpConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:parent/oauthIdpConfigs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
payload = {
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": False,
"issuer": "",
"name": "",
"responseType": {
"code": False,
"idToken": False,
"token": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
payload <- "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\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}}/v2/:parent/oauthIdpConfigs")
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 \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v2/:parent/oauthIdpConfigs') do |req|
req.body = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs";
let payload = json!({
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": json!({
"code": false,
"idToken": false,
"token": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v2/:parent/oauthIdpConfigs \
--header 'content-type: application/json' \
--data '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
echo '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}' | \
http POST {{baseUrl}}/v2/:parent/oauthIdpConfigs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientId": "",\n "clientSecret": "",\n "displayName": "",\n "enabled": false,\n "issuer": "",\n "name": "",\n "responseType": {\n "code": false,\n "idToken": false,\n "token": false\n }\n}' \
--output-document \
- {{baseUrl}}/v2/:parent/oauthIdpConfigs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": [
"code": false,
"idToken": false,
"token": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/oauthIdpConfigs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
identitytoolkit.projects.tenants.oauthIdpConfigs.delete
{{baseUrl}}/v2/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v2/:name")
require "http/client"
url = "{{baseUrl}}/v2/:name"
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}}/v2/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:name"
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/v2/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v2/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:name"))
.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}}/v2/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v2/:name")
.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}}/v2/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v2/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:name';
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}}/v2/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:name")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:name',
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}}/v2/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v2/:name');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/v2/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:name';
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}}/v2/:name"]
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}}/v2/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:name",
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}}/v2/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v2/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:name")
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/v2/:name') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:name";
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}}/v2/:name
http DELETE {{baseUrl}}/v2/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v2/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
identitytoolkit.projects.tenants.oauthIdpConfigs.get
{{baseUrl}}/v2/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/:name")
require "http/client"
url = "{{baseUrl}}/v2/:name"
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}}/v2/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:name"
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/v2/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:name"))
.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}}/v2/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/:name")
.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}}/v2/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:name';
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}}/v2/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:name',
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}}/v2/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/:name');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v2/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:name';
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}}/v2/:name"]
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}}/v2/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:name",
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}}/v2/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:name")
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/v2/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:name";
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}}/v2/:name
http GET {{baseUrl}}/v2/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
identitytoolkit.projects.tenants.oauthIdpConfigs.list
{{baseUrl}}/v2/:parent/oauthIdpConfigs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:parent/oauthIdpConfigs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/:parent/oauthIdpConfigs")
require "http/client"
url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
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}}/v2/:parent/oauthIdpConfigs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:parent/oauthIdpConfigs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
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/v2/:parent/oauthIdpConfigs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:parent/oauthIdpConfigs"))
.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}}/v2/:parent/oauthIdpConfigs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.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}}/v2/:parent/oauthIdpConfigs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2/:parent/oauthIdpConfigs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:parent/oauthIdpConfigs';
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}}/v2/:parent/oauthIdpConfigs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:parent/oauthIdpConfigs',
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}}/v2/:parent/oauthIdpConfigs'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/:parent/oauthIdpConfigs');
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}}/v2/:parent/oauthIdpConfigs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:parent/oauthIdpConfigs';
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}}/v2/:parent/oauthIdpConfigs"]
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}}/v2/:parent/oauthIdpConfigs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:parent/oauthIdpConfigs",
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}}/v2/:parent/oauthIdpConfigs');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:parent/oauthIdpConfigs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/:parent/oauthIdpConfigs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/:parent/oauthIdpConfigs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:parent/oauthIdpConfigs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/:parent/oauthIdpConfigs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:parent/oauthIdpConfigs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:parent/oauthIdpConfigs")
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/v2/:parent/oauthIdpConfigs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:parent/oauthIdpConfigs";
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}}/v2/:parent/oauthIdpConfigs
http GET {{baseUrl}}/v2/:parent/oauthIdpConfigs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/:parent/oauthIdpConfigs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:parent/oauthIdpConfigs")! 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()
PATCH
identitytoolkit.projects.tenants.oauthIdpConfigs.patch
{{baseUrl}}/v2/:name
QUERY PARAMS
name
BODY json
{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:name");
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 \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v2/:name" {:content-type :json
:form-params {:clientId ""
:clientSecret ""
:displayName ""
:enabled false
:issuer ""
:name ""
:responseType {:code false
:idToken false
:token false}}})
require "http/client"
url = "{{baseUrl}}/v2/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/v2/:name"),
Content = new StringContent("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/:name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:name"
payload := strings.NewReader("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/v2/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 198
{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v2/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v2/:name")
.header("content-type", "application/json")
.body("{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
.asString();
const data = JSON.stringify({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {
code: false,
idToken: false,
token: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v2/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v2/:name',
headers: {'content-type': 'application/json'},
data: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":"","displayName":"","enabled":false,"issuer":"","name":"","responseType":{"code":false,"idToken":false,"token":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientId": "",\n "clientSecret": "",\n "displayName": "",\n "enabled": false,\n "issuer": "",\n "name": "",\n "responseType": {\n "code": false,\n "idToken": false,\n "token": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/:name',
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({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v2/:name',
headers: {'content-type': 'application/json'},
body: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/v2/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {
code: false,
idToken: false,
token: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v2/:name',
headers: {'content-type': 'application/json'},
data: {
clientId: '',
clientSecret: '',
displayName: '',
enabled: false,
issuer: '',
name: '',
responseType: {code: false, idToken: false, token: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":"","displayName":"","enabled":false,"issuer":"","name":"","responseType":{"code":false,"idToken":false,"token":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientId": @"",
@"clientSecret": @"",
@"displayName": @"",
@"enabled": @NO,
@"issuer": @"",
@"name": @"",
@"responseType": @{ @"code": @NO, @"idToken": @NO, @"token": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/v2/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/v2/:name', [
'body' => '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientId' => '',
'clientSecret' => '',
'displayName' => '',
'enabled' => null,
'issuer' => '',
'name' => '',
'responseType' => [
'code' => null,
'idToken' => null,
'token' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:name');
$request->setRequestMethod('PATCH');
$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}}/v2/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v2/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:name"
payload = {
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": False,
"issuer": "",
"name": "",
"responseType": {
"code": False,
"idToken": False,
"token": False
}
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:name"
payload <- "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/:name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/v2/:name') do |req|
req.body = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"displayName\": \"\",\n \"enabled\": false,\n \"issuer\": \"\",\n \"name\": \"\",\n \"responseType\": {\n \"code\": false,\n \"idToken\": false,\n \"token\": false\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:name";
let payload = json!({
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": json!({
"code": false,
"idToken": false,
"token": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/v2/:name \
--header 'content-type: application/json' \
--data '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}'
echo '{
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": {
"code": false,
"idToken": false,
"token": false
}
}' | \
http PATCH {{baseUrl}}/v2/:name \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "clientId": "",\n "clientSecret": "",\n "displayName": "",\n "enabled": false,\n "issuer": "",\n "name": "",\n "responseType": {\n "code": false,\n "idToken": false,\n "token": false\n }\n}' \
--output-document \
- {{baseUrl}}/v2/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientId": "",
"clientSecret": "",
"displayName": "",
"enabled": false,
"issuer": "",
"name": "",
"responseType": [
"code": false,
"idToken": false,
"token": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.setIamPolicy
{{baseUrl}}/v2/:resource:setIamPolicy
QUERY PARAMS
resource
BODY json
{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:resource:setIamPolicy");
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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:resource:setIamPolicy" {:content-type :json
:form-params {:policy {:auditConfigs [{:auditLogConfigs [{:exemptedMembers []
:logType ""}]
:service ""}]
:bindings [{:condition {:description ""
:expression ""
:location ""
:title ""}
:members []
:role ""}]
:etag ""
:version 0}
:updateMask ""}})
require "http/client"
url = "{{baseUrl}}/v2/:resource:setIamPolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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}}/v2/:resource:setIamPolicy"),
Content = new StringContent("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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}}/v2/:resource:setIamPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:resource:setIamPolicy"
payload := strings.NewReader("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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/v2/:resource:setIamPolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 488
{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:resource:setIamPolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:resource:setIamPolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:resource:setIamPolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:resource:setIamPolicy")
.header("content-type", "application/json")
.body("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
.asString();
const data = JSON.stringify({
policy: {
auditConfigs: [
{
auditLogConfigs: [
{
exemptedMembers: [],
logType: ''
}
],
service: ''
}
],
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:resource:setIamPolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:setIamPolicy',
headers: {'content-type': 'application/json'},
data: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:resource:setIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":{"auditConfigs":[{"auditLogConfigs":[{"exemptedMembers":[],"logType":""}],"service":""}],"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","version":0},"updateMask":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:resource:setIamPolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "policy": {\n "auditConfigs": [\n {\n "auditLogConfigs": [\n {\n "exemptedMembers": [],\n "logType": ""\n }\n ],\n "service": ""\n }\n ],\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "version": 0\n },\n "updateMask": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:resource:setIamPolicy")
.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/v2/:resource:setIamPolicy',
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({
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:setIamPolicy',
headers: {'content-type': 'application/json'},
body: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
},
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}}/v2/:resource:setIamPolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
policy: {
auditConfigs: [
{
auditLogConfigs: [
{
exemptedMembers: [],
logType: ''
}
],
service: ''
}
],
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
});
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}}/v2/:resource:setIamPolicy',
headers: {'content-type': 'application/json'},
data: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:resource:setIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":{"auditConfigs":[{"auditLogConfigs":[{"exemptedMembers":[],"logType":""}],"service":""}],"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","version":0},"updateMask":""}'
};
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 = @{ @"policy": @{ @"auditConfigs": @[ @{ @"auditLogConfigs": @[ @{ @"exemptedMembers": @[ ], @"logType": @"" } ], @"service": @"" } ], @"bindings": @[ @{ @"condition": @{ @"description": @"", @"expression": @"", @"location": @"", @"title": @"" }, @"members": @[ ], @"role": @"" } ], @"etag": @"", @"version": @0 },
@"updateMask": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:resource:setIamPolicy"]
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}}/v2/:resource:setIamPolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:resource:setIamPolicy",
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([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]),
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}}/v2/:resource:setIamPolicy', [
'body' => '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:resource:setIamPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2/:resource:setIamPolicy');
$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}}/v2/:resource:setIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:resource:setIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:resource:setIamPolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:resource:setIamPolicy"
payload = {
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:resource:setIamPolicy"
payload <- "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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}}/v2/:resource:setIamPolicy")
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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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/v2/:resource:setIamPolicy') do |req|
req.body = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:resource:setIamPolicy";
let payload = json!({
"policy": json!({
"auditConfigs": (
json!({
"auditLogConfigs": (
json!({
"exemptedMembers": (),
"logType": ""
})
),
"service": ""
})
),
"bindings": (
json!({
"condition": json!({
"description": "",
"expression": "",
"location": "",
"title": ""
}),
"members": (),
"role": ""
})
),
"etag": "",
"version": 0
}),
"updateMask": ""
});
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}}/v2/:resource:setIamPolicy \
--header 'content-type: application/json' \
--data '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
echo '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}' | \
http POST {{baseUrl}}/v2/:resource:setIamPolicy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "policy": {\n "auditConfigs": [\n {\n "auditLogConfigs": [\n {\n "exemptedMembers": [],\n "logType": ""\n }\n ],\n "service": ""\n }\n ],\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "version": 0\n },\n "updateMask": ""\n}' \
--output-document \
- {{baseUrl}}/v2/:resource:setIamPolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"policy": [
"auditConfigs": [
[
"auditLogConfigs": [
[
"exemptedMembers": [],
"logType": ""
]
],
"service": ""
]
],
"bindings": [
[
"condition": [
"description": "",
"expression": "",
"location": "",
"title": ""
],
"members": [],
"role": ""
]
],
"etag": "",
"version": 0
],
"updateMask": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:resource:setIamPolicy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
identitytoolkit.projects.tenants.testIamPermissions
{{baseUrl}}/v2/:resource:testIamPermissions
QUERY PARAMS
resource
BODY json
{
"permissions": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/:resource:testIamPermissions");
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 \"permissions\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2/:resource:testIamPermissions" {:content-type :json
:form-params {:permissions []}})
require "http/client"
url = "{{baseUrl}}/v2/:resource:testIamPermissions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"permissions\": []\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}}/v2/:resource:testIamPermissions"),
Content = new StringContent("{\n \"permissions\": []\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}}/v2/:resource:testIamPermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"permissions\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/:resource:testIamPermissions"
payload := strings.NewReader("{\n \"permissions\": []\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/v2/:resource:testIamPermissions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"permissions": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2/:resource:testIamPermissions")
.setHeader("content-type", "application/json")
.setBody("{\n \"permissions\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/:resource:testIamPermissions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"permissions\": []\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 \"permissions\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2/:resource:testIamPermissions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2/:resource:testIamPermissions")
.header("content-type", "application/json")
.body("{\n \"permissions\": []\n}")
.asString();
const data = JSON.stringify({
permissions: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2/:resource:testIamPermissions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:testIamPermissions',
headers: {'content-type': 'application/json'},
data: {permissions: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/:resource:testIamPermissions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"permissions":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2/:resource:testIamPermissions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "permissions": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"permissions\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2/:resource:testIamPermissions")
.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/v2/:resource:testIamPermissions',
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({permissions: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2/:resource:testIamPermissions',
headers: {'content-type': 'application/json'},
body: {permissions: []},
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}}/v2/:resource:testIamPermissions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
permissions: []
});
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}}/v2/:resource:testIamPermissions',
headers: {'content-type': 'application/json'},
data: {permissions: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/:resource:testIamPermissions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"permissions":[]}'
};
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 = @{ @"permissions": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2/:resource:testIamPermissions"]
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}}/v2/:resource:testIamPermissions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"permissions\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/:resource:testIamPermissions",
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([
'permissions' => [
]
]),
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}}/v2/:resource:testIamPermissions', [
'body' => '{
"permissions": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2/:resource:testIamPermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'permissions' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'permissions' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2/:resource:testIamPermissions');
$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}}/v2/:resource:testIamPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"permissions": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/:resource:testIamPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"permissions": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"permissions\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2/:resource:testIamPermissions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/:resource:testIamPermissions"
payload = { "permissions": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/:resource:testIamPermissions"
payload <- "{\n \"permissions\": []\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}}/v2/:resource:testIamPermissions")
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 \"permissions\": []\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/v2/:resource:testIamPermissions') do |req|
req.body = "{\n \"permissions\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/:resource:testIamPermissions";
let payload = json!({"permissions": ()});
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}}/v2/:resource:testIamPermissions \
--header 'content-type: application/json' \
--data '{
"permissions": []
}'
echo '{
"permissions": []
}' | \
http POST {{baseUrl}}/v2/:resource:testIamPermissions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "permissions": []\n}' \
--output-document \
- {{baseUrl}}/v2/:resource:testIamPermissions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["permissions": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/:resource:testIamPermissions")! 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()
GET
identitytoolkit.getRecaptchaConfig
{{baseUrl}}/v2/recaptchaConfig
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2/recaptchaConfig");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2/recaptchaConfig")
require "http/client"
url = "{{baseUrl}}/v2/recaptchaConfig"
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}}/v2/recaptchaConfig"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2/recaptchaConfig");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2/recaptchaConfig"
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/v2/recaptchaConfig HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2/recaptchaConfig")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2/recaptchaConfig"))
.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}}/v2/recaptchaConfig")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2/recaptchaConfig")
.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}}/v2/recaptchaConfig');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2/recaptchaConfig'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2/recaptchaConfig';
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}}/v2/recaptchaConfig',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2/recaptchaConfig")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2/recaptchaConfig',
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}}/v2/recaptchaConfig'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2/recaptchaConfig');
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}}/v2/recaptchaConfig'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2/recaptchaConfig';
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}}/v2/recaptchaConfig"]
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}}/v2/recaptchaConfig" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2/recaptchaConfig",
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}}/v2/recaptchaConfig');
echo $response->getBody();
setUrl('{{baseUrl}}/v2/recaptchaConfig');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2/recaptchaConfig');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2/recaptchaConfig' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2/recaptchaConfig' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2/recaptchaConfig")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2/recaptchaConfig"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2/recaptchaConfig"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2/recaptchaConfig")
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/v2/recaptchaConfig') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2/recaptchaConfig";
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}}/v2/recaptchaConfig
http GET {{baseUrl}}/v2/recaptchaConfig
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2/recaptchaConfig
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2/recaptchaConfig")! 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()