This API connects to the AH Mobile App API to easily allow a Raspberry Pi / ESP8266 to connect. This project belongs to the ah-scanner project which allows a barcode scanner to scan a GTIN to automatically add products to your shopping list.
Get an auth code by logging in to:
https://login.ah.nl/secure/oauth/authorize?client_id=appie&redirect_uri=appie://login-exit&response_type=code
This will then redirect you to: appie://login-exit?code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is your auth code. Put this into the root of the project in a file named code.txt
This will be used the first time to get the access token. The access token will then be stored in token.json.
go run main.goPOST("/shoppinglist/add")
Body:
{
"type": "FIR",
"id": 366138
}POST("/shoppinglist/add")
Body:
{
"type": "GTIN",
"id": 8710739491087
}