# Lead Overview

# Lead

Field Name Type Description
id number The identifier of the sent lead.
contact_firstname string The first name of the lead.
contact_name string The last name of the lead.
contact_street string The street address of the lead.
contact_zip string The postcode of the lead.
contact_city string The city of the lead.
contact_email string The E-Mail of the lead.
contact_tel string The phone number of the lead.
contact_mobile string The mobile phone number of the lead.
contact_gender enum The gender of the lead.
lead_type enum The lead_type of the lead.
comment_extern string Notes that our Team deemed interesting.
sent_at string The Date & Time the lead was sent in UTC +1.
lead_data LeadData[] Array of LeadData

# contact_gender values

  • MALE
  • FEMALE

# lead_type values

  • ALARMANLAGE
  • AUTOMAT
  • ERBTEILUNG
  • FENSTER
  • GARAGE
  • HEIZUNG
  • IMMOBILIE
  • JOB
  • KAFFEEVOLLAUTOMAT
  • KAMIN
  • MARKISEN
  • SOLARANLAGE
  • TERRASSENDACH
  • TREPPENLIFT
  • WASSERSPENDER
  • WEBSEITE
  • WINTERGARTEN

# LeadData

Field Name Type Description
data_key string The key used to identify the information of the data field.
data_value string The data field value.

LeadData Keys are different for each lead_type

# GET Get a single Lead

Fetches a single Lead.

# Endpoint

GET /api/v1/leads/{LEAD_ID}

# Code Example

  • CURL
  • JavaScript
  • PHP
curl --request GET \
  --url https://api.einfach-zum-angebot.de/api/v1/leads/135861 \
  --header 'Authorization: Bearer <PERSONAL TOKEN>' \
  --header 'content-type: application/json' \

# Example Response

{
  "data": {
    "id": 135861,
    "contact_firstname": "Max",
    "contact_name": "Mustermann",
    "contact_street": "Weißenseestraße 101",
    "contact_zip": "81539",
    "contact_city": "München",
    "contact_email": "test@ajaska.de",
    "contact_tel": "00000000000",
    "contact_mobile": "11111111111",
    "contact_gender": "MALE",
    "lead_type": "IMMOBILIE",
    "comment_extern": "Test Kommentar für Anbieter",
    "sent_at": "2022-03-09 11:05:04",
    "lead_data": [
      {
        "data_key": "type",
        "data_value": "Haus"
      },
      {
        "data_key": "haus_flaeche_grund",
        "data_value": "500"
      },
      {
        "data_key": "haus_flaeche_wohn",
        "data_value": "100"
      },
      {
        "data_key": "haus_etagenanzahl",
        "data_value": "1,5"
      },
      {
        "data_key": "haus_anzahl_zimmer",
        "data_value": "5"
      },
      {
        "data_key": "haus_baujahr",
        "data_value": "1980"
      },
      {
        "data_key": "interesse",
        "data_value": "Verkauf"
      },
      {
        "data_key": "teilverkauf",
        "data_value": "Telefonische Beratung"
      },
      {
        "data_key": "verkaufszeitpunkt",
        "data_value": "Innerhalb 6 Monaten"
      },
      {
        "data_key": "firma",
        "data_value": ""
      },
      {
        "data_key": "contact_mobile",
        "data_value": ""
      },
      {
        "data_key": "termin_erwuenscht",
        "data_value": "Ja"
      },
      {
        "data_key": "verkauf_erwuenscht",
        "data_value": "Ja"
      },
      {
        "data_key": "verkaufszeitpunkt_abfrage",
        "data_value": "Innerhalb 6 Monate"
      },
      {
        "data_key": "ist_eigentuemer",
        "data_value": "Ja"
      },
      {
        "data_key": "makler_vorhanden",
        "data_value": "Nein"
      }
    ]
  }
}

# GET Get all Leads

Fetch all Leads, including already processed ones. Result is paginated if there are more than 20 Leads.

# Endpoint

GET /api/v1/leads

# Example Code

  • CURL
  • JavaScript
  • PHP
curl --request GET \
  --url https://api.einfach-zum-angebot.de/api/v1/leads \
  --header 'Authorization: Bearer <PERSONAL TOKEN>' \
  --header 'content-type: application/json' \

# Example Response

{
  "data": [
    {
      "id": 135861,
      "contact_firstname": "Max",
      "contact_name": "Mustermann",
      "contact_street": "Weißenseestraße 101",
      "contact_zip": "81539",
      "contact_city": "München",
      "contact_email": "test@ajaska.de",
      "contact_tel": "00000000000",
      "contact_mobile": "11111111111",
      "contact_gender": "MALE",
      "lead_type": "IMMOBILIE",
      "comment_extern": "Test Kommentar für Anbieter",
      "sent_at": "2022-03-09 11:05:04",
      "lead_data": [
        {
          "data_key": "type",
          "data_value": "Haus"
        },
        {
          "data_key": "haus_flaeche_grund",
          "data_value": "500"
        },
        {
          "data_key": "haus_flaeche_wohn",
          "data_value": "100"
        },
        {
          "data_key": "haus_etagenanzahl",
          "data_value": "1,5"
        },
        {
          "data_key": "haus_anzahl_zimmer",
          "data_value": "5"
        },
        {
          "data_key": "haus_baujahr",
          "data_value": "1980"
        },
        {
          "data_key": "interesse",
          "data_value": "Verkauf"
        },
        {
          "data_key": "teilverkauf",
          "data_value": "Telefonische Beratung"
        },
        {
          "data_key": "verkaufszeitpunkt",
          "data_value": "Innerhalb 6 Monaten"
        },
        {
          "data_key": "firma",
          "data_value": ""
        },
        {
          "data_key": "contact_mobile",
          "data_value": ""
        },
        {
          "data_key": "termin_erwuenscht",
          "data_value": "Ja"
        },
        {
          "data_key": "verkauf_erwuenscht",
          "data_value": "Ja"
        },
        {
          "data_key": "verkaufszeitpunkt_abfrage",
          "data_value": "Innerhalb 6 Monate"
        },
        {
          "data_key": "ist_eigentuemer",
          "data_value": "Ja"
        },
        {
          "data_key": "makler_vorhanden",
          "data_value": "Nein"
        }
      ]
    }
  ],
  "links": {
    "first": "https://api.einfach-zum-angebot.de/api/v1/leads?page=1",
    "last": "https://api.einfach-zum-angebot.de/api/v1/leads?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "active": false
      },
      {
        "url": "https://api.einfach-zum-angebot.de/api/v1/leads?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "active": false
      }
    ],
    "path": "https://api.einfach-zum-angebot.de/api/v1/leads",
    "per_page": 20,
    "to": 1,
    "total": 1
  }
}

# GET Get all unprocessed Leads

Get all Leads that have no processed Flag.

# Endpoint

GET /api/v1/leads/unprocessed

# Code Example

  • CURL
  • JavaScript
  • PHP
curl --request GET \
  --url https://api.einfach-zum-angebot.de/api/v1/leads/unprocessed \
  --header 'Authorization: Bearer <PERSONAL TOKEN>' \
  --header 'content-type: application/json' \

# Example Response

{
  "data": [
    {
      "id": 135861,
      "contact_firstname": "Max",
      "contact_name": "Mustermann",
      "contact_street": "Weißenseestraße 101",
      "contact_zip": "81539",
      "contact_city": "München",
      "contact_email": "test@ajaska.de",
      "contact_tel": "00000000000",
      "contact_mobile": "11111111111",
      "contact_gender": "MALE",
      "lead_type": "IMMOBILIE",
      "comment_extern": "Test Kommentar für Anbieter",
      "sent_at": "2022-03-09 11:05:04",
      "lead_data": [
        {
          "data_key": "type",
          "data_value": "Haus"
        },
        {
          "data_key": "haus_flaeche_grund",
          "data_value": "500"
        },
        {
          "data_key": "haus_flaeche_wohn",
          "data_value": "100"
        },
        {
          "data_key": "haus_etagenanzahl",
          "data_value": "1,5"
        },
        {
          "data_key": "haus_anzahl_zimmer",
          "data_value": "5"
        },
        {
          "data_key": "haus_baujahr",
          "data_value": "1980"
        },
        {
          "data_key": "interesse",
          "data_value": "Verkauf"
        },
        {
          "data_key": "teilverkauf",
          "data_value": "Telefonische Beratung"
        },
        {
          "data_key": "verkaufszeitpunkt",
          "data_value": "Innerhalb 6 Monaten"
        },
        {
          "data_key": "firma",
          "data_value": ""
        },
        {
          "data_key": "contact_mobile",
          "data_value": ""
        },
        {
          "data_key": "termin_erwuenscht",
          "data_value": "Ja"
        },
        {
          "data_key": "verkauf_erwuenscht",
          "data_value": "Ja"
        },
        {
          "data_key": "verkaufszeitpunkt_abfrage",
          "data_value": "Innerhalb 6 Monate"
        },
        {
          "data_key": "ist_eigentuemer",
          "data_value": "Ja"
        },
        {
          "data_key": "makler_vorhanden",
          "data_value": "Nein"
        }
      ]
    }
  ]
}

# PUT Process a single Lead

Process a single Lead so it disappears from the /unprocessed/ Endpoint.

# Endpoint

PUT /api/v1/leads/{LEAD_ID}/process
  • CURL
  • JavaScript
  • PHP
curl --request PUT \
  --url https://api.einfach-zum-angebot.de/api/v1/leads/135861/process \
  --header 'Authorization: Bearer <PERSONAL TOKEN>' \
  --header 'content-type: application/json' \

# Example Response

{
  "status": "success",
  "processed": [
    "135861"
  ]
}

# POST Batch Process Leads

Process an array of Lead IDs at once. They disappear from the /unprocessed/ Endpoint.

# Endpoint

POST /api/v1/leads/process

# Parameters

Name Type Description Required
leads Array Array of Lead Ids YES

# Example Body

{
  "leads": [32957,32958]
}

# Example Code

  • CURL
  • JavaScript
  • PHP
curl --request POST \
  --url https://api.einfach-zum-angebot.de/api/v1/leads/process \
  --header 'Authorization: Bearer <PERSONAL TOKEN>' \
  --header 'content-type: application/json' \
  --data '{
  "leads": [32957,32958]
}'

# Example Response

{
  "status": "success",
  "processed": [
    32957
  ],
  "unprocessed": [
    32958
  ]
}