RoeiOfri / homebridge-palgate-opener

PalGates homebridge plugin
MIT License
27 stars 8 forks source link

How i can use API Pal Gate? #18

Closed damire-da closed 10 months ago

damire-da commented 10 months ago

Problem: We have the Pal Gate app installed on our phone. We have a parking lot. There are automatic gates in the parking lot. To open them, the user sends a call to the number. This call is somehow intercepted by Pal Gate and captures a record of whether the user has entered or left. So, I need data to analyze who left or drove in. Is there a Pal Gate API? (I didn't find it). But I came across this repository. Will it help me? Thanks in advance for the answers.

zcahana commented 10 months ago

There's indeed a PalGate API, though it isn't designed for public use, but rather for the PalGate app, desktop client, ...

A few years back I did some reverse engineering for parts of their API - and specifically for gate entires log records. This might be outdated, but you're welcome to take a look at it as a starting point.

API definitions: https://github.com/zcahana/palgate-sdk

CLI app: https://github.com/zcahana/palgate-cli

Another app that fetches the log records and stores them in a Google Sheets doc. I had this app run periodically on a schedule, and archives the log records beyond the "last 50 entries" which is displayed in the PalGate app. https://github.com/zcahana/palgate-log-archiver

Note that the hard part remains to get a hold of the API auth token (in the past it was rather easy). You can follow #17 for ideas and status of these efforts. Also note that you need an admin-level token to access many of these APIs (including log records).

damire-da commented 10 months ago

Thanks, i'll try everything you wrote!

andybenichou commented 6 months ago

I have tried to reversed engineering also to get the token from the networks calls when using the desktop app. But it wasn't working.

Do you have some way to get the authentification token?

Thanks