JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const job = await client.sandbox.jobs.create({ type: 'data_sync_all' });
console.log(job.job_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
job = client.sandbox.jobs.create(
type="data_sync_all",
)
print(job.job_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
job, err := client.Sandbox.Jobs.New(context.TODO(), finchgo.SandboxJobNewParams{
Type: finchgo.F(finchgo.SandboxJobNewParamsTypeDataSyncAll),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", job.JobID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.JobCreateResponse;
import com.tryfinch.api.models.SandboxJobCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
SandboxJobCreateParams params = SandboxJobCreateParams.builder()
.type(SandboxJobCreateParams.Type.DATA_SYNC_ALL)
.build();
JobCreateResponse job = client.sandbox().jobs().create(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.JobCreateResponse
import com.tryfinch.api.models.SandboxJobCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: SandboxJobCreateParams = SandboxJobCreateParams.builder()
.type(SandboxJobCreateParams.Type.DATA_SYNC_ALL)
.build()
val job: JobCreateResponse = client.sandbox().jobs().create(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
job = finch.sandbox.jobs.create(type: :data_sync_all)
puts(job)curl --request POST \
--url https://api.tryfinch.com/sandbox/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "data_sync_all"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/jobs",
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([
'type' => 'data_sync_all'
]),
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;
}{
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"job_url": "https://api.tryfinch.com/jobs/automated/453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"allowed_refreshes": 2,
"remaining_refreshes": 1
}Sandbox
Enqueue a new sandbox job
POST
/
sandbox
/
jobs
JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const job = await client.sandbox.jobs.create({ type: 'data_sync_all' });
console.log(job.job_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
job = client.sandbox.jobs.create(
type="data_sync_all",
)
print(job.job_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
job, err := client.Sandbox.Jobs.New(context.TODO(), finchgo.SandboxJobNewParams{
Type: finchgo.F(finchgo.SandboxJobNewParamsTypeDataSyncAll),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", job.JobID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.JobCreateResponse;
import com.tryfinch.api.models.SandboxJobCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
SandboxJobCreateParams params = SandboxJobCreateParams.builder()
.type(SandboxJobCreateParams.Type.DATA_SYNC_ALL)
.build();
JobCreateResponse job = client.sandbox().jobs().create(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.JobCreateResponse
import com.tryfinch.api.models.SandboxJobCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: SandboxJobCreateParams = SandboxJobCreateParams.builder()
.type(SandboxJobCreateParams.Type.DATA_SYNC_ALL)
.build()
val job: JobCreateResponse = client.sandbox().jobs().create(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
job = finch.sandbox.jobs.create(type: :data_sync_all)
puts(job)curl --request POST \
--url https://api.tryfinch.com/sandbox/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "data_sync_all"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/jobs",
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([
'type' => 'data_sync_all'
]),
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;
}{
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"job_url": "https://api.tryfinch.com/jobs/automated/453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"allowed_refreshes": 2,
"remaining_refreshes": 1
}Analogous to
POST /jobs/automated, but for automated and assisted Finch Sandbox connections. Use this endpoint after updating a Finch Sandbox connection’s data to “sync” the data with Finch and see it reflected in /employer data API calls.
Assisted connections will return
null for job_id and job_url, since no job is actually being created. Simply call this endpoint, and then call the /employer API to see the updated data.Authorizations
Please use your Access Token
Body
application/json
The type of job to start. Currently the only supported type is data_sync_all
Available options:
data_sync_all Response
200 - application/json
OK
The id of the job that has been created.
The url that can be used to retrieve the job status
The number of allowed refreshes per hour (per hour, fixed window)
The number of remaining refreshes available (per hour, fixed window)
Was this page helpful?
⌘I