Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Letzte Überarbeitung Beide Seiten der Revision | ||
dapnetapisendcall [2022/01/30 13:06] dj7lc [calls to more than one tx group] |
dapnetapisendcall [2022/01/30 13:18] dj7lc [Example for python3] |
||
---|---|---|---|
Zeile 4: | Zeile 4: | ||
<code> | <code> | ||
- | curl -H "Content-Type: application/json" -X POST -u yourcallsign:yourpassword -d '{ "text": "this is the message", "callSignNames": ["destinationcallsign"], "transmitterGroupNames": ["txgroup"], "emergency": false }' URL/calls | + | curl -H "Content-Type: application/json" -X POST -u yourcallsign:yourpassword -d '{ "text": "this is the message", "callSignNames": ["destinationcallsign"], "transmitterGroupNames": ["txgroup"], "emergency": false }' http://dapnet.db0sda.ampr.org:8080/calls |
</code> | </code> | ||
- | ===== Example for python ===== | + | ===== Example for python3 ===== |
<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) |