Forum

Browse topics, discover Works With Legrand community!

Home + Control : Get user plant empty

Hello,

I've looked for any suggestion for my problem but nothing found to resolve it.

 

Explanation of my problem :

I have a user + password to connect to my Home + control application. All is Ok, and I can manage my Bubendorff devices with application.

I have created a partner application account for Alexa. It works fine too (Devices and scenes voice controls Ok).

I have created a developer account and subscribed to starter kit. When I try to send a "get users plants" request by clicking on "try it" button, I receive a http 200, but json is : "plants": [] (empty).

In field "OAuth Server for Try it Eliot API", I enter my user and password used to connect to home + control Application. After this a message like "Access token expires on: 12/23/2020 5:43 PM" appears to the right of this field. Before click "Send" Button, I've checked that "Ocp-Apim-Subscription-Key" and "Subscription key" contain my primary key, and "Authorization" contains "Bearer xxxxxxxx".

Could you help me to understand why response is empty please ?

 

Thanks

 

Hello,

I tested this call via Try It and Postman : it works for me

I only see 2 possible explanations :

  • you log in in the Try It with an other end-user account than the one where your devices are linked (but according to explanations you gave me, I doubt it)
  • Or you didn't give user consents to use this application. You can check it by going in Menu > My account > Third-party applications in your Home + Control application. You should see the name or the ID of your Works with Legrand application

If you don't see it, copy/paste this URL in your web browser : https://partners-login.eliotbylegrand.com/authorize?response_type=code&redirect_uri=YOUR_URI&client_id=YOUR_ID. Then, you will be asked to authenticate with your Home + Control credentials and to accept scopes

Have a good day,

Leslie - Community Manager

Hello

Tanks.

Actually I dont see the name nor the id in my Works With legrand application.

Could you tell me where I can fini My_URI and My_ID to subit url you give me please ?

 

Thanks

Hi,

Connect to your Works with Legrand account and go in your application's details : https://mysettings.developer.legrand.com/Application

First Reply Uri is the address you defined to redirect users to consents page and to use in your /authorize request

Application Id = client_id

Have a good day,

Leslie - Community Manager

Hi,

Thanks.

 

I've vreated my application and received by mail client_id and client_secret.

 

I've tried to get users plant using two methods :

 

1/ First Method with Postman :

 

1st step : on web browser

-> https://partners-login.eliotbylegrand.com/authorize?client_id=<my client ID received by mail>&response_type=code&redirect_uri=<redirect_uri_specified in my application>

-> Login on Eliot with my home+control user and password.

-> Accept authorization => <redirect_uri specified in my application>/?code=<Code to use at next step>

 

2nd step : on Postman

https://partners-login.eliotbylegrand.com/token with body parameters :

client_id -> <client_id received by mail>

grant_type -> authorization_code

code -> <code received on first step>

client_secret -> <client_secret received by mail>

And Authorization Type -> OAuth 2.0

 

3rd step : on Postman

https://api.developer.legrand.com/hc/api/v1.0/plants with Headers parameters :

Ocp-Apim-Subscription-Key -> <Primary Key of my starter kit subscription>

Authorization type -> Bearer Token

Token -> <access_token received previous step>

 

Response : 200 Ok, but {"plants": []} (plants empty)

 

2/ Second Method with API List Try it -> Home + Control Get users' plants :

 

Ocp-Apim-Subscription-Key -> <Primary Key of my starter kit subscription>

OAuth Server for Try it Eliot API ->  Authorization code

Subscription key -> Primary-<Primary Key of my starter kit subscription>

Field Authorization updated with : Bearer xxxxxxxxxxxxxxxxxxxx And Access token expires on: 12/31/2020 1:44 PM

 

Same response as with Postman : 200 Ok, but {"plants": []} (plants empty)

 

I dont understand why plants is empty.

An idea ?

 

Thanks

 

 

 

 

Hi Ges,

Your requests seems OK for me. Are you sure about the credentials of your end-user account asked in your /authorize request ?

You can check the correct email address of your installation in your Home + Control application in "Account" section in the menu

You must use the credentials of your Home + Control application to access your plants. Otherwise, you will retrieve a 200 OK response but with an empty plant

Have a good day,

Leslie - Community Manager

Hello Ges,

I think we found why you have this issue. Can you please test :

  • Go in your Home + Control application
  • Menu > My account > Third-party applications
  • At the bottom click on the link "I can't install a partner application"
  • Follow the steps

Can you please tell me if it resolved your issue ?

Thanks and have a good day,

Leslie - Community Manager

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Information

watch_later 11 months ago
message6 replies
people2 participants