User Tools

Site Tools


packet:bpq-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:bpq-api [2024/10/06 20:42] g7tajpacket:bpq-api [2025/01/02 19:13] (current) – [Route Roadmap] m0lte
Line 3: Line 3:
 ===== The one built into BPQ ===== ===== The one built into BPQ =====
  
-BPQ has a latent, undocumented, API, which Steve is going to document here :D+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)
 +
 +<code>
 +/api/request_token
 +/api/ports
 +/api/nodes
 +/api/users
 +/api/info
 +/api/links
 +/api/mheardport/<port#>
 +</code>
 +
 +Requested like so:
 +<code>curl 127.0.0.1:9122/api/request_token</code>
 +
 +Output:
 +<code>{"access_token":"OSTWFHSGAPKZWMZORFEFWOFIHMOZUMJK", "expires_in":3600, "scope":"create"}</code>
 +
 +Example of MH for Port 1: ( >ver 6.0.24.33 )
 +<code>curl 127.0.0.1:9122/api/mheardport?1 -H "Authorization: Bearer OSTWFHSGAPKZWMZORFEFWOFIHMOZUMJK"</code>
 +
 +Output:
 +<code>{"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"  }</code>
 +
 +==== 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/<port#> | 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                                                                                                                                                                                                                                                                    |
 +| /api/v1/mail/msgs   | GET    | Gets a list of messages                                             | yes                      | yes but incomplete responses | |
 ===== The one Tom built ===== ===== The one Tom built =====
  
Line 13: Line 54:
 https://github.com/M0LTE/bpqapi https://github.com/M0LTE/bpqapi
  
-===== The one Twom is building ===== 
- 
-Twom is patching MQTT support into BPQ itself. 
  
-==== Some bits from Steve G7TAJ ====+==== UI scraping notes from Steve G7TAJ ====
  
 Getting a message list with parameters Getting a message list with parameters
Line 142: Line 180:
                         =========================                         =========================
 September 3, 2024 September 3, 2024
 +</code>
 <color #ed1c24>SNIP</color> <color #ed1c24>SNIP</color>
 +<code>
 </textarea><br><br><input name=Save value=Save type=submit class='btn'><input name=Cancel value=Cancel type=submit class='btn'><br></form></body></html> </textarea><br><br><input name=Save value=Save type=submit class='btn'><input name=Cancel value=Cancel type=submit class='btn'><br></form></body></html>
  
 </code> </code>
  
 +===== The one Twom is building =====
 +
 +Twom is patching MQTT support into BPQ itself.
packet/bpq-api.1728247372.txt.gz · Last modified: 2024/10/06 20:42 by g7taj