Argument | Value | Description |
api_key | ---' | DAHITI API-Key (Where can I get the API key?) |
dahiti_id | e.g. '8814' | DAHITI ID |
https://dahiti.dgfi.tum.de/api/v2/get-target-info/
{
'code': 200,
'message': 'Request successful!',
'data': {
'id': 8814,
'target_name': 'Richland Chambers, Reservoir',
'location': None,
'country': 'us',
'continent': 'North America',
'longitude': -96.181,
'latitude': 31.9766,
'type': 'Reservoir'
},
}
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/get-target-info/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8814
response = requests.post(url, json=args)
if response.status_code == 200:
''' convert json string in python list '''
data = json.loads(response.text)
pprint.pprint(data)
else:
print (response.text)
print (response.status_code)
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/get-target-info/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8814
response = requests.get(url,params=args)
if response.status_code == 200:
''' convert json string in python list '''
data = json.loads(response.text)
pprint.pprint(data)
else:
print (response.text)
print (response.status_code)
curl --data "api_key=### ADD HERE API_KEY ###&dahiti_id=8814" -X POST https://dahiti.dgfi.tum.de/api/v2/get-target-info/
curl -X GET "https://dahiti.dgfi.tum.de/api/v2/get-target-info/?api_key=### ADD HERE API_KEY ###&dahiti_id=8814"