Proxy POST request
curl --request POST \
--url https://api.nango.dev/proxy/{anyPath} \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Id: <connection-id>' \
--header 'Content-Type: application/json' \
--header 'Provider-Config-Key: <provider-config-key>' \
--data '
{
"$ANY_BODY_PARAMS": "<string>"
}
'import requests
url = "https://api.nango.dev/proxy/{anyPath}"
payload = { "$ANY_BODY_PARAMS": "<string>" }
headers = {
"Connection-Id": "<connection-id>",
"Provider-Config-Key": "<provider-config-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Id': '<connection-id>',
'Provider-Config-Key': '<provider-config-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({$ANY_BODY_PARAMS: '<string>'})
};
fetch('https://api.nango.dev/proxy/{anyPath}', 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.nango.dev/proxy/{anyPath}",
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([
'$ANY_BODY_PARAMS' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Id: <connection-id>",
"Content-Type: application/json",
"Provider-Config-Key: <provider-config-key>"
],
]);
$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.nango.dev/proxy/{anyPath}"
payload := strings.NewReader("{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Id", "<connection-id>")
req.Header.Add("Provider-Config-Key", "<provider-config-key>")
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.nango.dev/proxy/{anyPath}")
.header("Connection-Id", "<connection-id>")
.header("Provider-Config-Key", "<provider-config-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/proxy/{anyPath}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Id"] = '<connection-id>'
request["Provider-Config-Key"] = '<provider-config-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyProxy
Proxy - POST requests
Make a POST request with the Proxy.
POST
/
proxy
/
{anyPath}
Proxy POST request
curl --request POST \
--url https://api.nango.dev/proxy/{anyPath} \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Id: <connection-id>' \
--header 'Content-Type: application/json' \
--header 'Provider-Config-Key: <provider-config-key>' \
--data '
{
"$ANY_BODY_PARAMS": "<string>"
}
'import requests
url = "https://api.nango.dev/proxy/{anyPath}"
payload = { "$ANY_BODY_PARAMS": "<string>" }
headers = {
"Connection-Id": "<connection-id>",
"Provider-Config-Key": "<provider-config-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Id': '<connection-id>',
'Provider-Config-Key': '<provider-config-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({$ANY_BODY_PARAMS: '<string>'})
};
fetch('https://api.nango.dev/proxy/{anyPath}', 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.nango.dev/proxy/{anyPath}",
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([
'$ANY_BODY_PARAMS' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Id: <connection-id>",
"Content-Type: application/json",
"Provider-Config-Key: <provider-config-key>"
],
]);
$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.nango.dev/proxy/{anyPath}"
payload := strings.NewReader("{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Id", "<connection-id>")
req.Header.Add("Provider-Config-Key", "<provider-config-key>")
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.nango.dev/proxy/{anyPath}")
.header("Connection-Id", "<connection-id>")
.header("Provider-Config-Key", "<provider-config-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/proxy/{anyPath}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Id"] = '<connection-id>'
request["Provider-Config-Key"] = '<provider-config-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"$ANY_BODY_PARAMS\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequires an API key with the
environment:proxy scope. Learn more about API key scopes.API request
The path, query params, and headers you send to the Proxy are all passed on to the external API, except for the configuration headers mentioned here:- Authorization: See Nango API Authentication. Nango will add a new Authorization header for the external API as needed.
- Provider-Config-Key
- Connection-Id
- Retries
API response
The response from the external API is passed back to you exactly as Nango gets it:- Response code
- Response headers
- Response body
Authorizations
Headers
Response
200
The response exactly as returned by the external API
Was this page helpful?