Forum > TGIF Hotspot Configurartion
Using the API
(1/1)
K5MRE:
All of you are familiar with the Selfcare page. However, I wanted to make sure you're also familiar with the API that selfcare uses in the event that you want to do something creative with it.
An example is the hotspot screen that EA7KDO is working on that allows you to disconnect an active talkgroup by pushing a button on the screen. That works by leveraging the API.
Keep in mind that right now, the API is bound to your source IP address.
To get a list of all of your hotspots that have connected to TGIF from your current IP address, their connection status, and other information, use:
http://tgif.network:5040/api/sessions
To change talkgroups, use the following:
http://tgif.network:5040/api/sessions/update/{repeater_id}/{timeslot}/{talkgroup}
Replacing {repeater_id} {timeslot} and {talkgroup} with the appropriate timeslot and talkgroup.
NOTE: For the API, timeslot 1 is '0' and timeslot 2 is '1'.
So if you wanted to, you could create a bookmark in your tool bar with a URL like:
http://tgif.network:5040/api/sessions/update/123123101/1/4000
... which would move Timeslot 2 on hotspot 123123101 to TG 4000 (no transmit).
If you get a 200 response, the call was made successfully. If you get any other, such as a 404, something is wrong with your query or you're not coming from the right IP address.
K5MRE
WB3IHY:
Heh. I was wondering if/when this would actually be published. Had all my favorite talkgroups (plus 4000 disconnect) bookmarked ever since I saw the code on Mitch's Github and figured out how it worked.
Kept it to myself too, since I wasn't sure if doing that was officially "allowed" outside use on Mitch's screens.
Commandment number one: Thou shalt not "hack" the API...LOL.
K5MRE:
Ha! No worries at all. Enjoy!
N4VKF:
Is there a way to add an API to the pi-star software like the brandmeister network has created?
Kn4usa:
Seems the folks that run this show don't keep up with it. I would love to know that too since when I am in pi-star adn cant connect or disonect to tgif. and it gives me a API error
Navigation
[0] Message Index
Go to full version