Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 2.05 KB

README.md

File metadata and controls

50 lines (39 loc) · 2.05 KB

Tibber repository

GitHub language count  GitHub top language  GitHub code size in bytes  GitHub repo size  GitHub  GitHub forks  GitHub watchers  GitHub last commit 

Scripts and example files for Tibber

Find your API token at Tibber Developer

Place it in a file, as shown here: demo-token-header

Shell usage:

$ ./curlfile -h demo-token-header example-queries/01-logged-in-user.gql | jq
{
  "data": {
    "viewer": {
      "name": "Arya Stark"
    }
  }
}

$ ./curlfile -h demo-token-header example-queries/02-homes.gql
{"data":{"viewer":{"homes":[{"address":{"address1":"Winterfell Castle 1",
"address2":null,"address3":null,"postalCode":null,"city":null,
"country":null,"latitude":null,"longitude":null}}]}}}

$ ./curlfile -h demo-token-header example-queries/03-current-energy-price.gql | head -c79
{"data":{"viewer":{"homes":[{"currentSubscription":{"priceInfo":{"current":{"to

graphqurl not supported at the moment:

$ gq https://api.tibber.com/v1-beta/gql -q '{ viewer { name } }' -H 'Authorization: Bearer 476c477d8a039529478ebd690d35ddd80e3308ffc49b59c65b142321aee963a4'
Executing query... error
Error:  { errors: [ { message: 'failed to fetch' } ] }

$ gq https://api.tibber.com/v1-beta/gql --queryFile example-queries/01-logged-in-user.gql -H demo-token-header
 ›   Error: cannot parse header 'demo-token-header' (multiple ':')