Replies: 5 comments
-
|
Tokens belong to a customer. Customers can have many sites. You can fetch a list of sites using the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Myles,If it’s not pushing it, any chance you could send a snippet how I would cater/extract each Site returned?CheersOn 29 Jun 2025, at 12:17, Myles Eftos ***@***.***> wrote:
Tokens belong to a customer. Customers can have many sites. You can fetch a list of sites using the /sites endpoint.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Easiest way to see the output is to use the dev docs at https://app.amber.com.au/developers/ An example of the structureof the json response to the sites query is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/api/Sites.java My code to parse the sites and match against an nmi (or to grab the 1st siteid) is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/AmberElectricHandler.java#L140 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks! 👏🏻👏🏻👍I’ll check it out 😉👍On 29 Jun 2025, at 14:45, Paul Smedley ***@***.***> wrote:
Easiest way to see the output is to use the dev docs at https://app.amber.com.au/developers/
An example of the structureof the json response to the sites query is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/api/Sites.java
My code to parse the sites and match against an nmi (or to grab the 1st siteid) is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/AmberElectricHandler.java#L140
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I finally got around to check these out and I very quickly realised your code is way above my pay-grade … I’m still at the ‘vanilla’ JavaScript level 🤦🏻Any chance you could downgrade the response to my level? 🤞🏻From: Ian Howse ***@***.***>Date: 29 June 2025 at 18:37:32 GMT+10To: amberelectric public-api ***@***.***>Subject: Re: [amberelectric/public-api] Newbie Question re api token/site relationship (Discussion #252)Thanks! 👏🏻👏🏻👍I’ll check it out 😉👍On 29 Jun 2025, at 14:45, Paul Smedley ***@***.***> wrote:
Easiest way to see the output is to use the dev docs at https://app.amber.com.au/developers/
An example of the structureof the json response to the sites query is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/api/Sites.java
My code to parse the sites and match against an nmi (or to grab the 1st siteid) is at https://github.com/psmedley/openhab-addons/blob/main/bundles/org.openhab.binding.amberelectric/src/main/java/org/openhab/binding/amberelectric/internal/AmberElectricHandler.java#L140
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
is the API token/key a 1-for-1 relationship with the Site code ie. does every token/key relate to only 1 Site and does every Site relate to only 1 token/key?
Beta Was this translation helpful? Give feedback.
All reactions