Benutzer-Werkzeuge

Webseiten-Werkzeuge


dapnetapisendcall

Dies ist eine alte Version des Dokuments!


Send individual call via REST-API

Example for curl from linux console

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

Example for python

import requests

headers = {'Content-type': 'application/json'}
 
data = '{ "text": "this is the message", "callSignNames": ["destinationcallsign"], "transmitterGroupNames": ["txgroup"], "emergency": false }'

data = data.encode('utf-8')

response = requests.post('http://dapnet.db0sda.ampr.org:8080/calls', headers=headers, auth=('yourcallsign', 'yourpassword'), data=data)

print(response)

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.

["dl1abc", "dk9xyz", "dj1uvw"]

But be aware: If one call sign fails (not registered, typo), the whole call is discarded.

calls to more than one tx group

The tx groups have to be comma separated.

["group1", "group2", "group3"]

But be aware: If one group is invalid (does not exist, typo), the whole call is discarded.

dapnetapisendcall.1643544413.txt.gz · Zuletzt geändert: 2022/01/30 13:06 von dj7lc