6 api v1 ecoaccount get_de
mpeltriaux edited this page 2023-02-23 10:58:17 +01:00

Spezifikation

GET Response allgemein

Jeder erfolgreiche GET Request wird mit folgender Response Struktur beantwortet:

{
    "rpp": 5,
    "p": 1,
    "next": "http://example.org/api/v1/xyz/?rpp=5&p=2",
    "results": {
        ...
    }
}

Erklärung:

  • rpp: Results per page. Bestimmt wie viele Ergebnisse pro Seite zurückgeliefert werden
  • p: Page. Gibt die zurückgelieferte Seitennummer an
  • next: URL zur nächsten Seite. Sollte keine weitere Seite existieren wird hier null stehen
  • results: Die angefragten Daten.
    • Alle folgenden Response Beispiele beziehen sich auf den Inhalt von results

Request Parameter:

  • rpp: Kann direkt als GET Parameter im Request mitgegeben werden (s. next URL). Muss eine Zahl > 0 sein. Falls nicht angegeben, wird ein Standardwert verwendet
  • p: Kann direkt als GET Parameter im Request mitgegeben werden (s. next URL). Muss eine Zahl > 0 sein. Falls nicht angegeben, wird ein Standardwert verwendet

Ökokonten

GET alle

/api/v1/ecoaccount

Beispiel Response
{
    "3e7acd84-bb67-408d-886e-91004c319f38": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        7.764930725097654,
                        50.530801443594385
                    ],
                    [
                        7.763471603393552,
                        50.52709125717179
                    ],
                    [
                        7.761154174804686,
                        50.524581259743805
                    ],
                    [
                        7.762441635131831,
                        50.52141629007823
                    ],
                    [
                        7.766475677490232,
                        50.51950629189859
                    ],
                    [
                        7.770338058471677,
                        50.51868769758818
                    ],
                    [
                        7.778749465942381,
                        50.51928800147066
                    ],
                    [
                        7.780122756958003,
                        50.52763689111973
                    ],
                    [
                        7.775144577026365,
                        50.533965783820754
                    ],
                    [
                        7.768535614013667,
                        50.533965783820754
                    ],
                    [
                        7.764930725097654,
                        50.530801443594385
                    ]
                ]
            ]
        ],
        "properties": {
            "id": "3e7acd84-bb67-408d-886e-91004c319f38",
            "identifier": "OEK-12022-TW4ECJ",
            "title": "Tolles Ökokonto",
            "created_on": "2022-01-12T11:41:14.328Z",
            "modified_on": "2022-01-12T11:47:45.303Z",
            "deductable_surface": 10000.0,
            "deductable_surface_available": 9000.0,
            "responsible": {
                "conservation_office": {
                    "id": 7547474,
                    "long_name": "LK Ahrweiler",
                    "short_name": "10"
                },
                "conservation_file_number": "123-TEST",
                "handler": {
                    "type": {
                        "id": 8585865,
                        "long_name": "Sonstige und private Träger",
                        "short_name": "Sonstige und private Träger"
                    },
                    "detail": "Firma Mustermann234"
                }
            },
            "legal": {
                "agreement_date": "2022-01-11"
            },
            "before_states": [
                {
                    "biotope": {
                        "id": 747474,
                        "long_name": "Eichen-Buchenmischwald",
                        "short_name": "AA1"
                    },
                    "biotope_details": [],
                    "surface": 10000.0
                }
            ],
            "after_states": [
                {
                    "biotope": {
                        "id": 3542352,
                        "long_name": "Buchenmischwald mit einheimischen Laubbaumarten",
                        "short_name": "AA2"
                    },
                    "biotope_details": [
                        {
                            "id": 352525,
                            "long_name": "Hausmüll",
                            "short_name": "gt8"
                        }
                    ],
                    "surface": 10000.0
                }
            ],
            "actions": [
                {
                    "action_types": [
                        {
                            "id": 7537357,
                            "long_name": "Sonstiges (s. Erläuterungen)",
                            "short_name": null
                        }
                    ],
                    "action_details": [
                        {
                            "id": 53757574,
                            "long_name": "mit Freischneider (Kehrwalze)",
                            "short_name": "Freischneider"
                        },
                        {
                            "id": 644337,
                            "long_name": "Wollschwein",
                            "short_name": "Wollschwein"
                        }
                    ],
                    "amount": 1.0,
                    "unit": "cm",
                    "comment": ""
                }
            ],
            "deadlines": [],
            "deductions": [
                {
                    "id": "f784e131-afb7-4e15-ad57-0b2469f5e967",
                    "eco_account": {
                        "id": "3e7acd84-bb67-408d-886e-91004c319f38",
                        "identifier": "OEK-12022-TW4ECJ",
                        "title": "Tolles Ökokonto"
                    },
                    "surface": 1000.0,
                    "intervention": {
                        "id": "97d7cce8-83e9-4043-bc76-317caf983a41",
                        "identifier": "EIV-12022-B6XGM9",
                        "title": "Tolles Baugebiet GEÄNDERT1"
                    }
                }
            ]
        }
    },
    "978ea565-83fd-4ad6-890f-babd16a1aa6a": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        7.764930725097654,
                        50.530801443594385
                    ],
                    [
                        7.763471603393552,
                        50.52709125717179
                    ],
                    [
                        7.761154174804686,
                        50.524581259743805
                    ],
                    [
                        7.762441635131831,
                        50.52141629007823
                    ],
                    [
                        7.766475677490232,
                        50.51950629189859
                    ],
                    [
                        7.770338058471677,
                        50.51868769758818
                    ],
                    [
                        7.778749465942381,
                        50.51928800147066
                    ],
                    [
                        7.780122756958003,
                        50.52763689111973
                    ],
                    [
                        7.775144577026365,
                        50.533965783820754
                    ],
                    [
                        7.768535614013667,
                        50.533965783820754
                    ],
                    [
                        7.764930725097654,
                        50.530801443594385
                    ]
                ]
            ]
        ],
        "properties": {
            "id": "978ea565-83fd-4ad6-890f-babd16a1aa6a",
            "identifier": "OEK-012022-NNMBVE",
            "title": "Tolles Ökokonto",
            "created_on": "2022-01-24T15:53:58.062Z",
            "modified_on": "2022-01-24T15:55:33.602Z",
            "deductable_surface": 100.0,
            "deductable_surface_available": 100.0,
            "responsible": {
                "conservation_office": {
                    "id": 757475,
                    "long_name": "LK Ahrweiler",
                    "short_name": "10"
                },
                "conservation_file_number": "123-TEST",
                "handler": {
                    "type": {
                        "id": 767474,
                        "long_name": "Sonstige und private Träger",
                        "short_name": "Sonstige und private Träger"
                    },
                    "detail": "Firma Mustermann234"
                }
            },
            "legal": {
                "agreement_date": "2022-01-11"
            },
            "before_states": [
                {
                    "biotope": {
                        "id": 75375,
                        "long_name": "Eichen-Buchenmischwald",
                        "short_name": "AA1"
                    },
                    "biotope_details": [
                        {
                            "id": 75735,
                            "long_name": "dystroph",
                            "short_name": "stc"
                        },
                        {
                            "id": 575375,
                            "long_name": "Hausmüll",
                            "short_name": "gt8"
                        }
                    ],
                    "surface": 10000.0
                }
            ],
            "after_states": [
                {
                    "biotope": {
                        "id": 7547574,
                        "long_name": "Buchenmischwald mit einheimischen Laubbaumarten",
                        "short_name": "AA2"
                    },
                    "biotope_details": [
                        {
                            "id": 88586543,
                            "long_name": "dystroph",
                            "short_name": "stc"
                        },
                        {
                            "id": 35456,
                            "long_name": "Hausmüll",
                            "short_name": "gt8"
                        }
                    ],
                    "surface": 10000.0
                }
            ],
            "actions": [
                {
                    "action_types": [
                        {
                            "id": 7537573,
                            "long_name": "Sonstiges (s. Erläuterungen)",
                            "short_name": null
                        }
                    ],
                    "action_details": [],
                    "amount": 1.0,
                    "unit": "cm",
                    "comment": ""
                }
            ],
            "deadlines": [],
            "deductions": []
        }
    },
    ...
}
    

GET einzeln

/api/v1/ecoaccount/<uuid>

Beispiel Response
{
    "3e7acd84-bb67-408d-886e-91004c319f38": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        7.764930725097654,
                        50.530801443594385
                    ],
                    [
                        7.763471603393552,
                        50.52709125717179
                    ],
                    [
                        7.761154174804686,
                        50.524581259743805
                    ],
                    [
                        7.762441635131831,
                        50.52141629007823
                    ],
                    [
                        7.766475677490232,
                        50.51950629189859
                    ],
                    [
                        7.770338058471677,
                        50.51868769758818
                    ],
                    [
                        7.778749465942381,
                        50.51928800147066
                    ],
                    [
                        7.780122756958003,
                        50.52763689111973
                    ],
                    [
                        7.775144577026365,
                        50.533965783820754
                    ],
                    [
                        7.768535614013667,
                        50.533965783820754
                    ],
                    [
                        7.764930725097654,
                        50.530801443594385
                    ]
                ]
            ]
        ],
        "properties": {
            "id": "3e7acd84-bb67-408d-886e-91004c319f38",
            "identifier": "OEK-12022-TW4ECJ",
            "title": "Tolles Ökokonto",
            "created_on": "2022-01-12T11:41:14.328Z",
            "modified_on": "2022-01-12T11:47:45.303Z",
            "deductable_surface": 10000.0,
            "deductable_surface_available": 9000.0,
            "responsible": {
                "conservation_office": {
                    "id": 6536357,
                    "long_name": "LK Ahrweiler",
                    "short_name": "10"
                },
                "conservation_file_number": "123-TEST",
                "handler": {
                    "type": {
                        "id": 753733,
                        "long_name": "Sonstige und private Träger",
                        "short_name": "Sonstige und private Träger"
                    },
                    "detail": "Firma Mustermann234"
                }
            },
            "legal": {
                "agreement_date": "2022-01-11"
            },
            "before_states": [
                {
                    "biotope": {
                        "id": 747443,
                        "long_name": "Eichen-Buchenmischwald",
                        "short_name": "AA1"
                    },
                    "biotope_details": [],
                    "surface": 10000.0
                }
            ],
            "after_states": [
                {
                    "biotope": {
                        "id": 6436436,
                        "long_name": "Buchenmischwald mit einheimischen Laubbaumarten",
                        "short_name": "AA2"
                    },
                    "biotope_details": [],
                    "surface": 10000.0
                }
            ],
            "actions": [
                {
                    "action_types": [
                        {
                            "id": 643637,
                            "long_name": "Sonstiges (s. Erläuterungen)",
                            "short_name": null
                        }
                    ],
                    "action_details": [],
                    "amount": 1.0,
                    "unit": "cm",
                    "comment": ""
                }
            ],
            "deadlines": [],
            "deductions": [
                {
                    "id": "f784e131-afb7-4e15-ad57-0b2469f5e967",
                    "eco_account": {
                        "id": "3e7acd84-bb67-408d-886e-91004c319f38",
                        "identifier": "OEK-12022-TW4ECJ",
                        "title": "Tolles Ökokonto"
                    },
                    "surface": 1000.0,
                    "intervention": {
                        "id": "97d7cce8-83e9-4043-bc76-317caf983a41",
                        "identifier": "EIV-12022-B6XGM9",
                        "title": "Tolles Baugebiet GEÄNDERT1"
                    }
                }
            ]
        }
    }
}