====== BPQ APIs ====== ===== The one built into BPQ ===== BPQ has a simple and evolving HTTP REST API. It is used though the HTTPPORT (in this example is port 9122) endpoints: (note older versions were prefixed with 'get' (except request_token) /api/request_token /api/ports /api/nodes /api/users /api/info /api/links /api/mheardport/ Requested like so: curl 127.0.0.1:9122/api/request_token Output: {"access_token":"OSTWFHSGAPKZWMZORFEFWOFIHMOZUMJK", "expires_in":3600, "scope":"create"} Example of MH for Port 1: ( >ver 6.0.24.33 ) curl 127.0.0.1:9122/api/mheardport?1 -H "Authorization: Bearer OSTWFHSGAPKZWMZORFEFWOFIHMOZUMJK" Output: {"callSign": "G7TAJ-15", "port": "1", "packets": 10, "lastHeard": "2024-3-6 17:14:01" }, {"callSign": "G7TAJ", "port": "1", "packets": 5, "lastHeard": "2024-3-3 15:46:07" } ==== Route Roadmap ==== Detailed info about the routes that exist and those yet to come. ^ Route ^ Method ^ Description ^ Authentication required? ^ Implemented? ^ Example response ^ | /api/request_token | GET | Get a token that you will need for authenticated routes | no | yes | `{ "access_token":"TJFCQDBRVSSHGPWIXFHAJFFKSMZISADL", "expires_in":3600, "scope":"create" }` | | /api/ports | GET | A list of the available ports | no | yes | `{ "ports": [ {"ID":"Telnet Server (internal only)", "Driver":"TELNET", "Number":1,"State":"Open"}, {"ID":"AX/IP/UDP", "Driver":"BPQAXIP", "Number":2,"State":"Open"}, {"ID":"2m FM 144.950 MHz 1.2k", "Driver":"ASYNC", "Number":3,"State":"Open"} ] }` | | /api/nodes | GET | A list of known nodes | no | yes | `{ "nodes": [ { "Call":"G4ZJH-7", "Alias":"SAXNOD", "Routes": [ {"Call":"G4ZJH-7", "Port":2, "Quality":192}, {"Call":"GB7PKT", "Port":2, "Quality":144}, {"Call":"GB7MSX", "Port":2, "Quality":144}]} ] }` | | /api/users | GET | A list of currently active users | no | yes | `{ "users": [ {"Call": "M7GMT"} ] }` | | /api/info | GET | Basic info about the node | no | yes | `{ "info": { "NodeCall":"M7GMT-5", "Alias":"WYMOND", "Locator":"JO02nn", "Version":"6.0.24.42" } }` | | /api/links | GET | A list of current links to other nodes | no | yes | `{ "links": [ {"farCall":"GB7MSX", "ourCall":"M7GMT-5", "port":"2", "state":"Active", "linkType":"Node-Node", "ax25Version":"2"} ] }` | | /api/mheard/ | GET | A list of stations that have been recently heard on a specific port | no | yes | | | /api/routes | GET | A list of available routes | no | no | | | /api/stats | GET | Version, uptime stats, etc | no | no | | ===== The one Tom built ===== Tom is building a docker container that sits next to BPQ and wraps its various interfaces, including the UI, exposing OpenAPI / Swagger endpoints. Perhaps one day this one will become redundant and can be put out to pasture. https://github.com/M0LTE/bpqapi ==== UI scraping notes from Steve G7TAJ ==== Getting a message list with parameters M$ID = the token the options can be null /Mail/MsgInfo.txt?M$ID --data "||||" response: a list of message numbers delimitered by | (odd end of html at the end) 1234|1235|1236| Get the message header information /Mail/MsgDetails?M$ID --data "54144" MsgEdit

Message 54144

From   Sent         Type     
To    Received        Status   
BID    Last Changed  Size  

Email From
 VIA  
Title  



Green = Sent, Yellow = Queued
G6JME G7TAJ G8BPQ GB7BED GB7BEX GB7BPQ GB7BTN GB7CIP
Get the message body: Mail/EditM?M0000FBE24729?54144 response:



===== The one Twom is building ===== Twom is patching MQTT support into BPQ itself.