Skip to main content

Quick Start Guide

This guide walks you through the most common integration scenario: pulling extraction results into your ERP or Materialwirtschaft system.

Prerequisites

  • An API token (starting with okt_live_)
  • Your Auftragsnummer(n) that you want to look up

Step 1: Verify Your Token

Test that your token works by calling the health endpoint (no auth required) and then a simple list:
# Health check (no token needed)
curl https://api.oktavius.ai/v1/openapi/health

# List your completed extractions
curl -X GET "https://api.oktavius.ai/v1/openapi/extractions" \
  -H "Authorization: Bearer okt_live_your_token_here"

Step 2: Query by Auftragsnummer

Find all extractions for a specific order. If multiple Regiescheine were uploaded for the same Auftrag, all of them are returned.
curl -X GET "https://api.oktavius.ai/v1/openapi/extractions?auftragsnummer=22201161" \
  -H "Authorization: Bearer okt_live_your_token_here"
Example response:
{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "completed",
      "auftragsnummer": "22201161",
      "baustelle": "Mokka",
      "completed_at": "2026-03-03T14:00:00Z",
      "created_at": "2026-03-03T13:00:00Z",
      "positionen_count": 4
    }
  ],
  "pagination": { "page": 1, "page_size": 20, "total": 1 }
}

Step 3: Get Full Extraction Detail (Rückimport)

Once you have an extraction ID, fetch the full detail with all line items — this is the data you import back into your system.
curl -X GET "https://api.oktavius.ai/v1/openapi/extractions/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer okt_live_your_token_here"
Example detail response:
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "completed_at": "2026-03-03T14:00:00Z",
    "created_at": "2026-03-03T13:00:00Z",
    "auftragsnummer": "22201161",
    "baustelle": "Mokka",
    "regietaetigkeit": "Aufgrund von mehrmaligen Planänderungen. Kabel eingezogen.",
    "positionen": [
      {
        "kategorie": "ARBEIT",
        "artikelnummer": "",
        "bezeichnung": "Obermonteurstunden",
        "menge": 55,
        "eh": "Std",
        "preis_einheit": 80.5,
        "positionspreis": 4427.5
      },
      {
        "kategorie": "MATERIAL",
        "artikelnummer": "12011900716",
        "bezeichnung": "NYM-J 5x2,5mm²",
        "menge": 500,
        "eh": "m",
        "preis_einheit": 1.15,
        "positionspreis": 575
      }
    ],
    "gesamtuebersicht": {
      "summe_arbeit": 4427.5,
      "summe_material": 836.75,
      "summe_gesamt": 5264.24
    }
  }
}

Field Mapping for Your System

Based on the “Rückimport” requirements:
Your FieldAPI FieldNotes
Auftragsnummer (required)data.auftragsnummerProject/order number
Text der durchgeführten Arbeitendata.regietaetigkeitMay be null if not entered
Position: Menge (required)positionen[].mengeQuantity
Position: Artikelnummer (required)positionen[].artikelnummerMay be empty if no article match
When artikelnummer is an empty string, the technician entered free text that could not be matched to an article in the catalog. Your system should handle this case (e.g. flag for manual resolution).

Step 4: Poll for New Results

To continuously sync new extractions, use the since parameter with the timestamp of your last successful sync:
curl -X GET "https://api.oktavius.ai/v1/openapi/extractions?since=2026-03-03T00:00:00Z" \
  -H "Authorization: Bearer okt_live_your_token_here"

Error Handling

All error responses follow the same format:
{
  "success": false,
  "error": "Unauthorized",
  "message": "Invalid API token."
}
StatusMeaning
401Invalid, expired, or missing API token
403Token not associated with an organization
404Extraction not found (or belongs to a different organization)
429Rate limit exceeded (1,000 requests/hour)
500Internal server error