Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
JcBorgs 52
Any experts on the net.HTTPClient() coding in here?
Am trying to build a QA for my car charger (Charge Amps HALO) and have access to the REST API. They have a bit different implementation to what I have worked with before, you need to login with email, password & APIkey to get a ”token” that you then use in other request. If I do this login on their swagger page I am able to get a token and then build a simple function to pull out information about my Charger, and this works just fine:
Code:
Please login or register to see this link.
d"Please login or register to see this link.
d'Request URL from the Charge Amps swagger page>
Please login or register to see this code.
Curl from the Charge Amps swagger page>
Please login or register to see this code.
200
Response body from the Charge Amps swagger page>
Please login or register to see this code.
Log output in Fibaro HC3>
Curl from the Charge Amps swagger page>
Please login or register to see this code.
Request URL from the Charge Amps swagger page>
Please login or register to see this code.
Response body from the Charge Amps swagger page>
Please login or register to see this code.
Code I have tried:
xxzzyyxxzzyyxxzzyy==
"Link to comment
Share on other sites
Top Posters For This Question
25
12
5
1
Popular Days
Apr 22
7
Apr 21
6
Jan 14
5
Jan 10
4
Top Posters For This Question
JcBorgs 25 posts
Håkan Enhager 12 posts
jgab 5 posts
tinman 1 post
Popular Days
Apr 22 2022
7 posts
Apr 21 2022
6 posts
Jan 14 2023
5 posts
Jan 10 2023
4 posts
Popular Posts
JcBorgs
@jgab Spent some time on this over the weekend, managed to get a fully operational QA and then did an effort in trying to learn the method your code was built in and eventually managed to underst
jgab
So the result is an array of key-value tables. To use the first item (can there be more then one? Maybe if you have multiple accounts/chargers?) Please login or register to see this code. al
JcBorgs
@jgab Works just fine now! Your updated code is probably the best way to do it, but for someone that doesn’t possess your coding skill it starts to look really complicated ? an
Posted Images
42 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.