API v2 Dokumentation

Die API ist derzeit ohne Authentifizierung nutzbar.

Die API Base URL lautet /api/v2.

Die folgenden Ressourcen bündeln die Menge der verfügbaren Actions, welche per POST-Request an die API genutzt werden können

RESOURCE

NLS.OfferResource

ACTION

list

RETURN Array NLS.Offer
PARAMS
FILTERS q qfield order page_size page offer_type_id offer_type_key actor_id categories categories_operator boundingBox timespan accessible free child_friendly
FIELDS title short_description description property_list costs requirements curriculum free child_friendly accessible climate_protection event_online event_canceled target_group info_url video_url updated_at created_at offer_type locations contacts times categories logo_url image_url actor
{
  "resource": NLS.OfferResource,
  "action": list
  "fields": {
      "title": true,
        "short_description": true,
        "description": true,
        "property_list": true,
        "costs": true,
        "requirements": true,
        "curriculum": true,
        "free": true,
        "child_friendly": true,
        "accessible": true,
        "climate_protection": true,
        "event_online": true,
        "event_canceled": true,
        "target_group": true,
        "info_url": true,
        "video_url": true,
        "updated_at": true,
        "created_at": true,
        "offer_type": true|{fields}, // set to true for ID or define list of eager loaded fields
        "locations": true|{fields}, // set to true for ID or define list of eager loaded fields
        "contacts": true|{fields}, // set to true for ID or define list of eager loaded fields
        "times": true|{fields}, // set to true for ID or define list of eager loaded fields
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "logo_url": true,
        "image_url": true,
        "actor": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
ACTION

get

RETURN NLS.Offer
PARAMS id
FILTERS
FIELDS title short_description description property_list costs requirements curriculum free child_friendly accessible climate_protection event_online event_canceled target_group info_url video_url updated_at created_at offer_type locations contacts times categories logo_url image_url actor
{
  "resource": NLS.OfferResource,
  "action": get
  "fields": {
      "title": true,
        "short_description": true,
        "description": true,
        "property_list": true,
        "costs": true,
        "requirements": true,
        "curriculum": true,
        "free": true,
        "child_friendly": true,
        "accessible": true,
        "climate_protection": true,
        "event_online": true,
        "event_canceled": true,
        "target_group": true,
        "info_url": true,
        "video_url": true,
        "updated_at": true,
        "created_at": true,
        "offer_type": true|{fields}, // set to true for ID or define list of eager loaded fields
        "locations": true|{fields}, // set to true for ID or define list of eager loaded fields
        "contacts": true|{fields}, // set to true for ID or define list of eager loaded fields
        "times": true|{fields}, // set to true for ID or define list of eager loaded fields
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "logo_url": true,
        "image_url": true,
        "actor": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
RESOURCE

NLS.LocationResource

ACTION

list

RETURN Array NLS.Location
PARAMS
FILTERS q qfield order page_size page
FIELDS title street city zip lat long owner
{
  "resource": NLS.LocationResource,
  "action": list
  "fields": {
      "title": true,
        "street": true,
        "city": true,
        "zip": true,
        "lat": true,
        "long": true,
        "owner": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
ACTION

get

RETURN NLS.Location
PARAMS id
FILTERS
FIELDS title street city zip lat long owner
{
  "resource": NLS.LocationResource,
  "action": get
  "fields": {
      "title": true,
        "street": true,
        "city": true,
        "zip": true,
        "lat": true,
        "long": true,
        "owner": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
RESOURCE

NLS.ActorResource

ACTION

list

RETURN Array NLS.Actor
PARAMS
FILTERS q qfield order page_size page categories categories_operator boundingBox
FIELDS title description slug info_url updated_at created_at logo_url image_url contacts categories locations
{
  "resource": NLS.ActorResource,
  "action": list
  "fields": {
      "title": true,
        "description": true,
        "slug": true,
        "info_url": true,
        "updated_at": true,
        "created_at": true,
        "logo_url": true,
        "image_url": true,
        "contacts": true|{fields}, // set to true for ID or define list of eager loaded fields
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "locations": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
ACTION

get

RETURN NLS.Actor
PARAMS id
FILTERS
FIELDS title description slug info_url updated_at created_at logo_url image_url contacts categories locations
{
  "resource": NLS.ActorResource,
  "action": get
  "fields": {
      "title": true,
        "description": true,
        "slug": true,
        "info_url": true,
        "updated_at": true,
        "created_at": true,
        "logo_url": true,
        "image_url": true,
        "contacts": true|{fields}, // set to true for ID or define list of eager loaded fields
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "locations": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
RESOURCE

NLS.ModelTypeResource

ACTION

list

RETURN Array NLS.ModelType
PARAMS
FILTERS q qfield order page_size page
FIELDS key display_name description used_attributes
{
  "resource": NLS.ModelTypeResource,
  "action": list
  "fields": {
      "key": true,
        "display_name": true,
        "description": true,
        "used_attributes": true,
    }
}
        
ACTION

get

RETURN NLS.ModelType
PARAMS id
FILTERS
FIELDS key display_name description used_attributes
{
  "resource": NLS.ModelTypeResource,
  "action": get
  "fields": {
      "key": true,
        "display_name": true,
        "description": true,
        "used_attributes": true,
    }
}
        
ACTION

save

RETURN NLS.ModelType
PARAMS id
FILTERS
FIELDS key display_name description used_attributes
{
  "resource": NLS.ModelTypeResource,
  "action": save
  "fields": {
      "key": true,
        "display_name": true,
        "description": true,
        "used_attributes": true,
    }
}
        
RESOURCE

NLS.CategoryResource

ACTION

list

RETURN Array NLS.Category
PARAMS category_type_key
FILTERS q qfield order page_size page top_level_categories
FIELDS title description sub_categories category_type
{
  "resource": NLS.CategoryResource,
  "action": list
  "fields": {
      "title": true,
        "description": true,
        "sub_categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "category_type": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
ACTION

get

RETURN NLS.Category
PARAMS id
FILTERS
FIELDS title description sub_categories category_type
{
  "resource": NLS.CategoryResource,
  "action": get
  "fields": {
      "title": true,
        "description": true,
        "sub_categories": true|{fields}, // set to true for ID or define list of eager loaded fields
        "category_type": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
RESOURCE

NLS.CategoryTypeResource

ACTION

list

RETURN Array NLS.CategoryType
PARAMS
FILTERS q qfield order page_size page
FIELDS target_type key title categories
{
  "resource": NLS.CategoryTypeResource,
  "action": list
  "fields": {
      "target_type": true,
        "key": true,
        "title": true,
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
ACTION

get

RETURN NLS.CategoryType
PARAMS id
FILTERS
FIELDS target_type key title categories
{
  "resource": NLS.CategoryTypeResource,
  "action": get
  "fields": {
      "target_type": true,
        "key": true,
        "title": true,
        "categories": true|{fields}, // set to true for ID or define list of eager loaded fields
    }
}
        
TYPE

NLS.Offer

FIELDS
title of type Afeefa.StringAttribute
short_description of type Afeefa.StringAttribute
description of type Afeefa.StringAttribute
property_list of type Afeefa.StringAttribute
costs of type Afeefa.StringAttribute
requirements of type Afeefa.StringAttribute
curriculum of type Afeefa.StringAttribute
free of type Afeefa.BooleanAttribute
child_friendly of type Afeefa.BooleanAttribute
accessible of type Afeefa.BooleanAttribute
climate_protection of type Afeefa.BooleanAttribute
event_online of type Afeefa.BooleanAttribute
event_canceled of type Afeefa.BooleanAttribute
target_group of type Afeefa.StringAttribute
info_url of type Afeefa.StringAttribute
video_url of type Afeefa.StringAttribute
updated_at of type Afeefa.DateAttribute
created_at of type Afeefa.DateAttribute
offer_type of type Afeefa.Relation of type NLS.ModelType
locations of type Afeefa.Relation of type NLS.Location
contacts of type Afeefa.Relation of type NLS.Contact
times of type Afeefa.Relation of type NLS.Time
categories of type Afeefa.Relation of type NLS.Category
logo_url of type Afeefa.StringAttribute
image_url of type Afeefa.StringAttribute
actor of type Afeefa.Relation of type NLS.Actor
TYPE

NLS.ModelType

FIELDS
key of type Afeefa.StringAttribute
display_name of type Afeefa.StringAttribute
description of type Afeefa.StringAttribute
used_attributes of type Afeefa.IntAttribute
TYPE

NLS.Location

FIELDS
title of type Afeefa.StringAttribute
street of type Afeefa.StringAttribute
city of type Afeefa.StringAttribute
zip of type Afeefa.StringAttribute
lat of type Afeefa.NumberAttribute
long of type Afeefa.NumberAttribute
owner of type Afeefa.Relation of type
TYPE

NLS.Actor

FIELDS
title of type Afeefa.StringAttribute
description of type Afeefa.StringAttribute
slug of type Afeefa.StringAttribute
info_url of type Afeefa.StringAttribute
updated_at of type Afeefa.DateAttribute
created_at of type Afeefa.DateAttribute
logo_url of type Afeefa.StringAttribute
image_url of type Afeefa.StringAttribute
contacts of type Afeefa.Relation of type NLS.Contact
categories of type Afeefa.Relation of type NLS.Category
locations of type Afeefa.Relation of type NLS.Location
TYPE

NLS.Contact

FIELDS
title of type Afeefa.StringAttribute
contact_urls of type Afeefa.Relation of type NLS.ContactUrl
contact_persons of type Afeefa.Relation of type NLS.ContactPerson
TYPE

NLS.ContactUrl

FIELDS
title of type Afeefa.StringAttribute
url of type Afeefa.StringAttribute
TYPE

NLS.ContactPerson

FIELDS
name of type Afeefa.StringAttribute
role of type Afeefa.StringAttribute
email of type Afeefa.StringAttribute
phone of type Afeefa.StringAttribute
keyfacts of type Afeefa.Relation of type NLS.Keyfact
TYPE

NLS.Keyfact

FIELDS
display_name of type Afeefa.StringAttribute
value of type Afeefa.StringAttribute
TYPE

NLS.Category

FIELDS
title of type Afeefa.StringAttribute
description of type Afeefa.StringAttribute
sub_categories of type Afeefa.Relation of type NLS.Category
category_type of type Afeefa.Relation of type NLS.CategoryType
TYPE

NLS.CategoryType

FIELDS
target_type of type Afeefa.StringAttribute
key of type Afeefa.StringAttribute
title of type Afeefa.StringAttribute
categories of type Afeefa.Relation of type NLS.Category
TYPE

NLS.Time

FIELDS
start of type Afeefa.DateAttribute
end of type Afeefa.DateAttribute

Bilddateien

Über eine URL referenzierte Bilddateien können in verschiedenen Größen angefordert werden. Dazu können der Bild-URL folgende GET-Parameter angehängt werden:

width : maximale Breite in Pixeln

height: maximale Höhe in Pixeln

Die Bild-URL in Originalgröße erhält man z.B. über die Attribute image_url_base bei Angeboten oder via organization_logo_url_base bei Organisationen. Diese kann als Basis für die Ergänzung von Parametern für die gewünschte Bildgröße verwendet werden.

Beispiel:

Bild in Originalgröße via Attribut organization_logo_url_base aus users.json

» https://daten.nachhaltiges-sachsen.de/media/2374/duw_logo_farbe_text_no_cutout.png

Dimensioniertes Bild über angehängte GET-Parameter

» https://daten.nachhaltiges-sachsen.de/media/2374/duw_logo_farbe_text_no_cutout.png?width=200&height=200

Breite und Höhe des Bildes sind jeweils auf max. 200 Pixel dimensioniert, d.h. ein Querformat-Bild ist max. 200 Pixel breit bzw. ein Hochformat-Bild ist max. 200 Pixel hoch