JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const documents = await client.hris.documents.list();
console.log(documents.documents);from finch import Finch
client = Finch(
access_token="My Access Token",
)
documents = client.hris.documents.list()
print(documents.documents)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"),
)
documents, err := client.HRIS.Documents.List(context.TODO(), finchgo.HRISDocumentListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", documents.Documents)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.DocumentListResponse;
import com.tryfinch.api.models.HrisDocumentListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
DocumentListResponse documents = client.hris().documents().list();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.DocumentListResponse
import com.tryfinch.api.models.HrisDocumentListParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val documents: DocumentListResponse = client.hris().documents().list()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
documents = finch.hris.documents.list
puts(documents)curl --request GET \
--url https://api.tryfinch.com/employer/documents \
--header 'Authorization: Bearer <token>' \
--header 'Finch-API-Version: <finch-api-version>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"paging": {
"count": 1,
"offset": 0
},
"documents": [
{
"id": "238b1d2a-3172-4b4a-a825-b04c0b2d0cac",
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"year": 2020,
"url": "https://api.tryfinch.com/employer/documents/238b1d2a-3172-4b4a-a825-b04c0b2d0cac",
"type": "w4_2020"
}
]
}{
"code": 400,
"finch_code": "w4_sync_required",
"message": "W4 documents are not available. Please trigger a W4 sync job first.",
"name": "bad_request",
"context": {
"docs_url": "https://developer.tryfinch.com/api-reference/management/enqueue-a-new-automated-job#w4-form-employee-sync"
}
}Documents
List Documents
Beta: This endpoint is in beta and may change. Retrieve a list of company-wide documents.
GET
/
employer
/
documents
JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const documents = await client.hris.documents.list();
console.log(documents.documents);from finch import Finch
client = Finch(
access_token="My Access Token",
)
documents = client.hris.documents.list()
print(documents.documents)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"),
)
documents, err := client.HRIS.Documents.List(context.TODO(), finchgo.HRISDocumentListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", documents.Documents)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.DocumentListResponse;
import com.tryfinch.api.models.HrisDocumentListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
DocumentListResponse documents = client.hris().documents().list();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.DocumentListResponse
import com.tryfinch.api.models.HrisDocumentListParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val documents: DocumentListResponse = client.hris().documents().list()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
documents = finch.hris.documents.list
puts(documents)curl --request GET \
--url https://api.tryfinch.com/employer/documents \
--header 'Authorization: Bearer <token>' \
--header 'Finch-API-Version: <finch-api-version>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"paging": {
"count": 1,
"offset": 0
},
"documents": [
{
"id": "238b1d2a-3172-4b4a-a825-b04c0b2d0cac",
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"year": 2020,
"url": "https://api.tryfinch.com/employer/documents/238b1d2a-3172-4b4a-a825-b04c0b2d0cac",
"type": "w4_2020"
}
]
}{
"code": 400,
"finch_code": "w4_sync_required",
"message": "W4 documents are not available. Please trigger a W4 sync job first.",
"name": "bad_request",
"context": {
"docs_url": "https://developer.tryfinch.com/api-reference/management/enqueue-a-new-automated-job#w4-form-employee-sync"
}
}Authorizations
Please use your Access Token
Headers
Header used to specify the version for a given API request. Current version is 2020-09-17.
Pattern:
([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Query Parameters
The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.
Required array length:
1 elementExample:
["550e8400-e29b-41d4-a716-446655440000"]
Number of documents to return (defaults to all)
Index to start from (defaults to 0)
Comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all individuals
Comma-delimited list of document types to filter on. If empty, defaults to all types
Available options:
w4_2020, w4_2005 Was this page helpful?
⌘I