No matter what I try: API call doesnt return any plants
As the title says: Set up the application and subscription, I can see the application listed as installed under the Home+ app (Settings / My Account / Partner Apps) – authentication is successful, but the API call returns no plants. Things I have tried:
– same id for the Home+ app and for developer.legrand.com account
– separate ids for the Home+ app and for developer.legrand.com account
Here is what I get with the “Try It” function offered on developer.legrand.com – again the application shows in the Home+ app:
Any ideas anyone… ?
<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px;" data-bind="text: headers">Pragma: no-cache Cache-Control: no-cache Set-Cookie: TiPMix=24.406152136813; path=/; HttpOnly; Domain=cwn-website-prod.azurewebsites.net; Max-Age=3600; Secure,x-ms-routing-name=self; path=/; HttpOnly; Domain=cwn-website-prod.azurewebsites.net; Max-Age=3600; Secure X-AspNet-Version: 4.0.30319 Request-Context: appId=cid-v1:17d898fc-adbd-487e-96a4-c4287796f34d Access-Control-Expose-Headers: Request-Context Date: Wed, 26 May 2021 18:42:59 GMT Content-Length: 13 Content-Type: application/json; charset=utf-8 Expires: -1 <code class="json hljs" style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: #000000; background-color: #ffffff; border-radius: 0px; display: block; overflow-x: auto; text-size-adjust: none;" data-bind="snippet: { brush: bodyBrush, body: body }">{ "<span class="hljs-attribute" style="box-sizing: border-box;">plants</span>": <span class="hljs-value" style="box-sizing: border-box;">[] </span>}
Hello Jan,
Home + Control end-user account, and Works with Legrand developer accounts are on 2 separate databases. So it’s not a problem if you have the same or different credentials for the 2. You just need to be careful to use your end-user account for authentication part
I think that you gave a wrong mail/password when authenticating in the Try-It
Here are things you can check :
- Verify in Home + Control app > Menu > Account : you will see the email address of your account. Are you using the right end-user account to authenticate in the Try It ? (the one you use to see and manage your devices in the app)
- Retry to make a GET user’s plant request via the Try-It (https://portal.developer.legrand.com/docs/services/59e9ad7f8bda9e0b3caea28c/operations/getusersplants/console) while connected to your Works with Legrand developer account on the website. Then, in “Oauth server for Eliot Try It API” choose “Authoriztion code”. A pop-up will open : use the credentials from your end-user account
Have a good day,
Leslie – Community Manager
Hi Leslie,
thank you so much for your response. I tried your suggestions, but this didnt work: When I try to authenticate in the pop up using the end user credentials, I get an error “We cant seem to find your account”.
Just to make sure we are talking about the same thing:
1. Credentials I used for Home+ Control App: legrand@jsimon.33mail.com / Password
2. Credentials for https://portal.developer.legrand.com: legrandapi@jsimon.33mail.com / Password
3. I log into https://portal.developer.legrand.com with credentials from 2)
4. I make a GET user’s plant request via Try-It
5. The subscription key / Ocp-Apim-Subcription-Key is populated automatically, it is the primary key I generated previously under subscriptions.
6. Under OAuth Server for Try it Eliot API I select “Authorzation Code” – which opens a pop up.
7. In that pop-up I enter the credentials from 1) (Home+ Control App) as you suggested
=> “We cant seem to find your account”. Just to make sure I didnt mess up the password I tried “Forgot your Password”, confirmed the authentication code – but here I also get an error “I cant seem to find that user”.
If I try step 7 with the developer credentials, I authenticate successfully – but the API call returns no plants. What I do then see is after that API call, is an” Application installed” in the Home+ Control App / Settings / My Account / Partner Apps.
Where am I going wrong ?
Is the API even the right one? I am trying to retrieve Smarther2 thermostats – I didnt see any reference to thermostats when I defined the scope for the application. I did come across another URL: Works with Legrand that seems to be what I am looking for – but here the authorization doesnt work: “Authorization Code” brings up a pop up that immediately closes again before I can enter any credentials.
You must be logged in to reply to this topic.