2.7.2. Paging via API¶
In order to send a page via the API it’s necessary to have an API key. You can obtain your API key or generate a new one on your profile page.
If you don’t already have an API key you can create a “New Key”. Use the “Copy” button add the key to your copy buffer ready to paste it into your code.
Note
The page can either be sent to a RIC or callsign.
curl 'https://raynet.m0guy.com/api/v1/page' -H 'Content-Type: application/json' -u '<APIKEY>:'
-d '{ "rics":["123456"],
"groups":[ 281 ],
"message":'Hello World'
}'
If you use a callsign then the first RIC which matches for the callsign will be used.
curl 'https://raynet.m0guy.com/api/v1/page' -H 'Content-Type: application/json' -u '<APIKEY>:'
-d '{ "callsigns":["m0guy"],
"groups":[ 281, 116 ],
"message":'Hello World'
}'
The “groups” field is an array of raynet group IDs, 281 is the NATIONAL Group which everyone is a member of, so in this case, the page will be sent to all hotspots and repeaters which are currently on-line. To find the group ID, look on your profile page under “Groups”, and click on the group you want the number for and look at the URL in the address bar (https://raynet.m0guy.com/group/281, for National, so the group ID is 281).
As a good practice it’s suggested to pick the smallest group which is likely to get the message to the intended recipient. You can specify multiple groups if you need to span multiple groups.
Warning
You can only send to a group to which you are a member