ThAFF Embed DocumentationThAFF Embed Documentation
Installation
Installation
  • ThAFF Embed

    • Installation
    • Authentication
    • Jobs
    • Changelog

Jobs

To fetch a company's jobs, you first need their token via Authentication. Once you have the token, you can store it on your server. It won't expire unless it is manually deleted via logout. This logout can occur on the client's account in their ThAFF profile, so be cautious when you receive 401 responses. Alternatively, use Webhooks to be informed when users log out.

JS SDK
import {Loader} from 'thaff-embed-scripts';
import 'thaff-embed-scripts/dist/thaff-embed-scripts.css';

const loader = new Loader({
    key: '{key}',
});

const ThaffJobs = await loader.importJobs();
const jobService = new ThaffJobs(token);
const jobs = await jobService.getJobs();
Plain JS
await fetch('https://thaff-thueringen.de/api/v2/jobs', {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${token}`,
        'Accept': 'application/json',
    },
});
Guzzle
$client = new \GuzzleHttp\Client();
$res = $client->get('https://thaff-thueringen.de/api/v2/jobs', [
    'headers' => [
        'Authorization' => 'Bearer {token}'
    ]
]);
$jobs = json_decode($res->getBody()->getContents(), true);
curl
curl 'https://thaff-thueringen.de/api/v2/jobs' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer {token}' \

This will return an array of Jobs with the following format

interface Job {
    id: number,
    reference: string
    title: string
    description: string
    address: {
        zip: string | null
        city: string | null
        houseNumber: string | null
        street: string | null
        lat: number | null
        lng: number | null
    },
    companyName: string
    publishDate: string
    url: string
    categories: Category[],
    professions: Category[]
    industrySectors: Category[]
}

interface Category {
    id: number,
    name: string
}
Attributetypedescription
idintthe internal unique ID of this dataset
referencestringexternal unique number of this dataset, should be used to display the JobId
titlestringname of the job
companyNamestringname of company for this job
address.zipstring | nullzip code of the working location
address.citystring | nullcity of the working location
address.houseNumberstring | nullhouse number of the working location
address.streetstring | nullstreet number of the working location
address.latstring | nullgeo latitude of the working location
address.lngstring | nullgeo longitude number of the working location
publishDatestringTime representation when this job was published in Y-m-d\TH:i:sP
urlstringDetail URL
categories{id: number, title: string}[]Job categories eg "Vollzeit", "Teilzeit"
professions{id: number, title: string}[]Job categories eg "Öffentlicher Dienst", "Recht, Steuern, Finanzen"
industrySectors{id: number, title: string}[]Job categories eg "Banken", "Einzelhandel"

Pagination

the API is currently limited to max 100 jobs in all cases with a default page size of 100 jobs per request. You can pass a page size and page number to the getJobs function in order to fetch less than 100 jobs. For example to show only the first 5 jobs.

JS SDK
// grab first 5 jobs
const jobs = await jobService.getJobs(1, 5);
console.log(jobService.getPagination());
{
    perPage: 5
    pageCount: x
    currentPage: 1
    totalPages: x
}

// grab next 5 jobs
const nextJobs = await jobService.getJobs(2, 5);
console.log(jobService.getPagination());
{
    perPage: 5
    pageCount: x
    currentPage: 2
    totalPages: x
}
Plain JS
const res = await fetch('https://thaff-thueringen.de/api/v2/jobs?page=1&per-page=5', {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${token}`,
        'Accept': 'application/json',
    },
});
res.headers.get('x-pagination-per-page')
res.headers.get('x-pagination-page-count')
res.headers.get('x-pagination-current-page')
res.headers.get('x-pagination-total-count')
Guzzle
$client = new \GuzzleHttp\Client();
$res = $client->get('https://thaff-thueringen.de/api/v2/jobs', [
    'headers' => [
        'Authorization' => 'Bearer {token}'
    ],
    'query' => [
      'page' => 1,
      'per-page' => 5
   ]
]);
$jobs = json_decode($res->getBody()->getContents(), true);
curl
curl 'https://thaff-thueringen.de/api/v2/jobs?per-page=5&page=1' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer {token}' \

Methods

export interface ThaffJobs {
    getJobs(page?: number, pageSize?: number): Promise<Job[]>;
    // Get the last pagination object
    getPagination(): Pagination | null;
}
Last Updated:: 06/05/2025, 12:07
Contributors: Robin Schambach
Prev
Authentication
Next
Changelog