JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const response = await client.requestForwarding.forward({ method: 'method', route: 'route' });
console.log(response.request);from finch import Finch
client = Finch(
access_token="My Access Token",
)
response = client.request_forwarding.forward(
method="method",
route="route",
)
print(response.request)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
response, err := client.RequestForwarding.Forward(context.TODO(), finchgo.RequestForwardingForwardParams{
Method: finchgo.F("method"),
Route: finchgo.F("route"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Request)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.RequestForwardingForwardParams;
import com.tryfinch.api.models.RequestForwardingForwardResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RequestForwardingForwardParams params = RequestForwardingForwardParams.builder()
.method("method")
.route("route")
.build();
RequestForwardingForwardResponse response = client.requestForwarding().forward(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.RequestForwardingForwardParams
import com.tryfinch.api.models.RequestForwardingForwardResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: RequestForwardingForwardParams = RequestForwardingForwardParams.builder()
.method("method")
.route("route")
.build()
val response: RequestForwardingForwardResponse = client.requestForwarding().forward(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
response = finch.request_forwarding.forward(method_: "method", route: "route")
puts(response)curl --request POST \
--url https://api.tryfinch.com/forward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"method": "<string>",
"route": "<string>",
"params": {},
"data": "<string>",
"request_headers": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/forward",
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([
'method' => '<string>',
'route' => '<string>',
'params' => [
],
'data' => '<string>',
'request_headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"statusCode": 123,
"request": {
"method": "<string>",
"route": "<string>",
"headers": {},
"params": {},
"data": "<string>"
},
"headers": {},
"data": "<string>"
}Management
Request Forwarding
The Forward API allows you to make direct requests to an employment system. If Finch’s unified API doesn’t have a data model that cleanly fits your needs, then Forward allows you to push or pull data models directly against an integration’s API.
POST
/
forward
JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const response = await client.requestForwarding.forward({ method: 'method', route: 'route' });
console.log(response.request);from finch import Finch
client = Finch(
access_token="My Access Token",
)
response = client.request_forwarding.forward(
method="method",
route="route",
)
print(response.request)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
response, err := client.RequestForwarding.Forward(context.TODO(), finchgo.RequestForwardingForwardParams{
Method: finchgo.F("method"),
Route: finchgo.F("route"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Request)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.RequestForwardingForwardParams;
import com.tryfinch.api.models.RequestForwardingForwardResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RequestForwardingForwardParams params = RequestForwardingForwardParams.builder()
.method("method")
.route("route")
.build();
RequestForwardingForwardResponse response = client.requestForwarding().forward(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.RequestForwardingForwardParams
import com.tryfinch.api.models.RequestForwardingForwardResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: RequestForwardingForwardParams = RequestForwardingForwardParams.builder()
.method("method")
.route("route")
.build()
val response: RequestForwardingForwardResponse = client.requestForwarding().forward(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
response = finch.request_forwarding.forward(method_: "method", route: "route")
puts(response)curl --request POST \
--url https://api.tryfinch.com/forward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"method": "<string>",
"route": "<string>",
"params": {},
"data": "<string>",
"request_headers": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/forward",
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([
'method' => '<string>',
'route' => '<string>',
'params' => [
],
'data' => '<string>',
'request_headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"statusCode": 123,
"request": {
"method": "<string>",
"route": "<string>",
"headers": {},
"params": {},
"data": "<string>"
},
"headers": {},
"data": "<string>"
}Headers
Body
application/json
Response
200 - application/json
Successful response
Was this page helpful?