Skip to content

Commit

Permalink
start ipynp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JJFlorian committed Mar 22, 2024
1 parent fbefe01 commit 5d518da
Showing 1 changed file with 116 additions and 0 deletions.
116 changes: 116 additions & 0 deletions upload_examples.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Inleiding\n",
"---------\n",
"Om data aan te leveren wordt het uploadtask endpoint gebruikt. Met behulp van een POST request kan een type levering worden geselecteerd, en de data daarvoor aangeleverd worden. Deze data dient in json formaat aangeleverd te worden. De API zet de data om in een XML formaat en levert de data aan. De status van dit proces kan bijgehouden worden in de upload task instance die wordt aangemaakt na een POST request.\n",
"\n",
"Hieronver een voorbeeld van hoe vanuit een script een POST request kan gemaakt worden voor een GMN StartRegistration:\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"\n",
"url = \"http://brostar.nl/api/uploadtasks/\"\n",
"\n",
"metadata = {\n",
" \"requestReference\":\"test\",\n",
" \"deliveryAccountableParty\":\"12345678\",\n",
" \"qualityRegime\":\"IMBRO\"\n",
" }\n",
"\n",
"sourcedocument_data = {\n",
" \"objectIdAccountableParty\":\"test\",\n",
" \"name\":\"test\",\n",
" \"deliveryContext\":\"kaderrichtlijnWater\",\n",
" \"monitoringPurpose\":\"strategischBeheerKwaliteitRegionaal\",\n",
" \"groundwaterAspect\":\"kwantiteit\",\n",
" \"startDateMonitoring\":\"2024-01-01\",\n",
" \"measuringPoints\":[\n",
" {\n",
" \"measuringPointCode\":\"PUT00001\",\n",
" \"broId\":\"GMW000000000001\",\n",
" \"tubeNumber\":\"1\"\n",
" }\n",
" ]\n",
"}\n",
"\n",
"payload = {\n",
" \"bro_domain\": \"GMN\",\n",
" \"project_number\": \"1234\",\n",
" \"registration_type\": \"GMN_StartRegistration\",\n",
" \"request_type\": \"registration\",\n",
" \"metadata\": metadata,\n",
" \"sourcedocument_data\": sourcedocument_data\n",
"}\n",
"\n",
"r = requests.post(url, json=payload)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Mogelijke berichten\n",
"--------------------\n",
"\n",
"**GMW**\n",
"- registration\n",
"\n",
"**GMN_StartRegistration**\n",
"- registration\n",
"- move\n",
"- replace\n",
" \n",
"**GMN_MeasuringPoint**\n",
"- registration\n",
"- move\n",
"- replace\n",
"- insert\n",
"- delete\n",
"\n",
"**GMN_MeasuringPointEndDate**\n",
"- registration\n",
"- move\n",
"- delete\n",
"\n",
"**GMN_TubeReference**\n",
"- registration\n",
"- insert\n",
"- move\n",
"- replace\n",
"- delete\n",
"\n",
"**GMN_Closure**\n",
"- registration\n",
"- move\n",
"- delete"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Input per berichttype\n",
"---------------------\n",
"\n",
"**GMW**\n"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 5d518da

Please sign in to comment.