Open gth001 opened 2 years ago
Could you screenshot your webhooks (minus any API keys) please?
You would get the URL from the Firebase console. You should see your deployed functions on the Functions Dashboard. There will be a table listing the names and URLs.
The method is POST. Content type is application/json
. The body is a JSON document like this:
{ "authentication": "AUTHKEY", "items": [ {"body": "{{TextField}}", "qty": 1} ] }
AUTHKEY
is taken from functions.config().ifttt.secretkey
. This can be set in your Firebase environment.
I appreciate the help. Is AUTHKEY the same as LC_FIREBASE_API_KEY in env.sh? And is it the same as the string in Project settings > Cloud messaging > Server key ?
AUTHKEY
can be anything. It's unrelated to LC_FIREBASE_API_KEY
. I'd recommend using a long (20+ chars) random password here.
It's a pre-shared secret that you send in the POST body so that the cloud function can authenticate the request. Without it, anyone who stumbled upon your endpoint could make your label printer spit out endless labels!
Thanks, that seems to work. There is still a mysterious "response error", but it's no longer showing secretkey errors.
Another issue I am running into on the Raspberry Pi is:
raise HTTPError(e, request_object.text)
requests.exceptions.HTTPError: [Errno 404 Client Error: Not Found for url: https://georgelabelcommander.firebaseio.com/print_jobs.json] {
"error" : "404 Not Found"
}
That URL doesn't seem to exist. If I activate a Realtime Database on the project, I see it does create a https://georgelabelcommander-default-rtdb.firebaseio.com URL but there doesn't appear to be anything at https://georgelabelcommander-default-rtdb.firebaseio.com/print_jobs.json . I don't have an ideas of what to try next.
I updated a bunch of things over at https://github.com/heston/label-commander-server, including adding installation instructions in the README. I've verified that I can deploy these functions and they work as expected. Give the updated version a try.
Hmm. I'll have to give the RPI client another look over. There may a missing setup step somewhere. My database also doesn't have that key most of the time (since it gets cleared after the print queue is processed).
Hi - I'd love to make this for my own Dymo, but could you point me to the webhooks info?
I have google assistant and a text ingredient, but I need these for the webhook: URL Method Content type Additional headers Body
Sorry, I've never used firebase, and I didn't see info on REST endpoint or whatever it's called. I did deploy the firebase cloud function, got my API key, installed raspbian and CUPS and dymo drivers on my RPi3b.
Thank you