Create Provider
curl --request POST \
--url https://api.example.com/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": {
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"name": "<string>",
"description": "<string>",
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
}
}
'import requests
url = "https://api.example.com/providers"
payload = { "provider": {
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"name": "<string>",
"description": "<string>",
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: {
apiType: 'REST',
visibilityType: 'PUBLIC',
baseURL: '<string>',
documentURL: '<string>',
iconURL: '<string>',
name: '<string>',
description: '<string>',
oauth2Config: {
clientID: '<string>',
clientSecret: '<string>',
authURL: '<string>',
tokenURL: '<string>'
}
}
})
};
fetch('https://api.example.com/providers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/providers",
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([
'provider' => [
'apiType' => 'REST',
'visibilityType' => 'PUBLIC',
'baseURL' => '<string>',
'documentURL' => '<string>',
'iconURL' => '<string>',
'name' => '<string>',
'description' => '<string>',
'oauth2Config' => [
'clientID' => '<string>',
'clientSecret' => '<string>',
'authURL' => '<string>',
'tokenURL' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/providers"
payload := strings.NewReader("{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"provider": {
"id": "kSuB9Gf6aD4",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123,
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"secretPrefix": "<string>",
"name": "<string>",
"description": "<string>",
"tools": [
{
"id": "kSuB9Gf6aD4",
"providerID": "kSuB9Gf6aD4",
"method": "GET",
"path": "/users/{id}",
"name": "makePayment",
"title": "Make Payment",
"description": "<string>",
"pathArgsJSONSchema": {},
"queryArgsJSONSchema": {},
"reqBodyJSONSchema": {},
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"oauth2Scopes": [
"<string>"
]
}
],
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
}
}Providers
Create Provider
POST
/
providers
Create Provider
curl --request POST \
--url https://api.example.com/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": {
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"name": "<string>",
"description": "<string>",
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
}
}
'import requests
url = "https://api.example.com/providers"
payload = { "provider": {
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"name": "<string>",
"description": "<string>",
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: {
apiType: 'REST',
visibilityType: 'PUBLIC',
baseURL: '<string>',
documentURL: '<string>',
iconURL: '<string>',
name: '<string>',
description: '<string>',
oauth2Config: {
clientID: '<string>',
clientSecret: '<string>',
authURL: '<string>',
tokenURL: '<string>'
}
}
})
};
fetch('https://api.example.com/providers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/providers",
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([
'provider' => [
'apiType' => 'REST',
'visibilityType' => 'PUBLIC',
'baseURL' => '<string>',
'documentURL' => '<string>',
'iconURL' => '<string>',
'name' => '<string>',
'description' => '<string>',
'oauth2Config' => [
'clientID' => '<string>',
'clientSecret' => '<string>',
'authURL' => '<string>',
'tokenURL' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/providers"
payload := strings.NewReader("{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": {\n \"apiType\": \"REST\",\n \"visibilityType\": \"PUBLIC\",\n \"baseURL\": \"<string>\",\n \"documentURL\": \"<string>\",\n \"iconURL\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"oauth2Config\": {\n \"clientID\": \"<string>\",\n \"clientSecret\": \"<string>\",\n \"authURL\": \"<string>\",\n \"tokenURL\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"provider": {
"id": "kSuB9Gf6aD4",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123,
"apiType": "REST",
"visibilityType": "PUBLIC",
"baseURL": "<string>",
"documentURL": "<string>",
"iconURL": "<string>",
"secretPrefix": "<string>",
"name": "<string>",
"description": "<string>",
"tools": [
{
"id": "kSuB9Gf6aD4",
"providerID": "kSuB9Gf6aD4",
"method": "GET",
"path": "/users/{id}",
"name": "makePayment",
"title": "Make Payment",
"description": "<string>",
"pathArgsJSONSchema": {},
"queryArgsJSONSchema": {},
"reqBodyJSONSchema": {},
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"oauth2Scopes": [
"<string>"
]
}
],
"oauth2Config": {
"clientID": "<string>",
"clientSecret": "<string>",
"authURL": "<string>",
"tokenURL": "<string>"
}
}
}⌘I