Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
dapnetapisendcall [2022/01/30 13:13] dj7lc [Example for python] |
dapnetapisendcall [2023/11/12 19:03] (aktuell) pe2kmv |
||
---|---|---|---|
Zeile 11: | Zeile 11: | ||
<code> | <code> | ||
import requests | import requests | ||
+ | |||
+ | url = 'http://dapnet.db0sda.ampr.org:8080/calls' | ||
headers = {'Content-type': 'application/json'} | headers = {'Content-type': 'application/json'} | ||
Zeile 18: | Zeile 20: | ||
data = data.encode('utf-8') | data = data.encode('utf-8') | ||
- | response = requests.post('http://dapnet.db0sda.ampr.org:8080/calls', headers=headers, auth=('yourcallsign', 'yourpassword'), data=data) | + | response = requests.post(url, headers=headers, auth=('yourcallsign', 'yourpassword'), data=data) |
print(response) | print(response) | ||
</code> | </code> | ||
+ | |||
+ | ===== make sure to select the correct DAPNET server ===== | ||
+ | When you are connected to HAMNET (either through the air or via VPN) you can use the HAMNET node http://www.hampager.de:8080/calls | ||
+ | |||
+ | If you're not connected to HAMNET please use the server connected to the public internet http://www.hampager.de:8080/calls | ||
+ | |||
===== calls to more than one callsign ===== | ===== calls to more than one callsign ===== | ||
- | It is also possible to hand over more than one call sign to the API. The call signs then have to be comma separated. | + | It is also possible to hand over more than one call sign to the API. The call signs then have to be comma separated and quoted. |
<code> | <code> | ||
Zeile 34: | Zeile 42: | ||
===== calls to more than one tx group ===== | ===== calls to more than one tx group ===== | ||
- | The tx groups have to be comma separated. | + | The tx groups have to be comma separated and quoted. |
<code> | <code> |