Now that I got my API key, still having problems, I'm getting a response...
{ "errors" : [ { "message" : "Invalid json" } ] }
Batch file is like...
curl.exe -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic [consisting of dev:+api-key base64 encoded]" -H "Cache-Control: no-cache" --data-ascii "@C:\\lametric\test.json" http://[inside IP of my LaMetric]:8080/api/v2/device/notifications
test.json file is like...
{ "priority": "warning", "model": { "cycles": 1, "frames": [ { "icon": "i660", "text": "Test" } "sound": { "category": "notifications", "id": "cat", "repeat": 1 } } }
Found it. I'd forgotten to close the square brackets.
{ "priority": "critical", "model": { "cycles": 1, "frames": [ { "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAUklEQVQYlWNUVFBgYGBgYBC98uE/AxJ4rSPAyMDAwMCETRJZjAnGgOlAZote+fCfCV0nOmA0+yKAYTwygJuAzQoGBgYGRkUFBQZ0dyDzGQl5EwCTESNpFb6zEwAAAABJRU5ErkJggg==", "text": "HELLO!" }], "sound": { "category": "notifications", "id": "cat" } } }
This worked & might give a starting point to work from.
I've been working on this as well. I've previously had trouble JSON formatting.
JSONLint suggests your JSON is invalid.
I've had success with :
{ "priority": "info", "icon_type": "none", "model": { "cycles": 0, "frames": [{ "icon": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAUklEQVQYlWNUVFBgYGBgYBC98uE\/AxJ4rSPAyMDAwMCETRJZjAnGgOlAZote+fCfCV0nOmA0+yKAYTwygJuAzQoGBgYGRkUFBQZ0dyDzGQl5EwCTESNpFb6zEwAAAABJRU5ErkJggg==", "text": "Hello" }] } }
But I've been unable to get the sound working.
Thanks!
That does work. Wish the example in the API v2 reference would be as good.
JSON Formatter suggests your JSON is invalid.
JP
Now that I got my API key, still having problems, I'm getting a response...
Batch file is like...
test.json file is like...
Found it. I'd forgotten to close the square brackets.
This worked & might give a starting point to work from.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPG
I've been working on this as well. I've previously had trouble JSON formatting.
JSONLint suggests your JSON is invalid.
I've had success with :
But I've been unable to get the sound working.
PG
Found it. I'd forgotten to close the square brackets.
This worked & might give a starting point to work from.
JP
Thanks!
That does work. Wish the example in the API v2 reference would be as good.
Aaron
JSON Formatter suggests your JSON is invalid.
-
How to pull data from external site to display?
-
nodejs request "gets acces denied"
-
curl to python for eventghost
-
Push text from Eventghost to LaMetric via python
-
Basic API pull and json parse example....
-
A guide for starting an app?
-
A small wrapper to push your just created JIRA issues to your LaMetric.
-
Simple project to push home consumption data to be shown on a Lametric device
-
Interface to have Slack send messages to a LaMetric Time
-
Very simple module to push frames to LaMetric
See all 149 topics