Forum

Browse topics, discover Works With Legrand community!

“Unauthorized” when get plants

Hi all

i have message {“statusCode”:”401″,”message”:”Unauthorized”} when i try to get plants

Authorization and token request are ok

I use python code

my account is “gius.faccilongo@gmail.com” but the third part access access authorization in Thermostat app is for “giuseppe.faccilongo@tin.it” my old email

if i try to disconnect that account I have “Service not available” error message

Can you help me, please?

Thank you

Hello Guiseppe,

Can you use the Try-it tool to confirm if the problem is linked to the authentication or to your python code ? :

  • Check the email address to use for 3rd party authentication in Thermostat app (but I seem to understand that you already did this) : Menu > Account >  Third-party access > “your account is connected to email@email.com
  • Use the Sign-In button here : https://developer.legrand.com/works-with-legrand/
  • Once signed-in, click on “List of APIs” > APIs > Smarther legacy v2 > click on “GET Plants” method
  • Click on the green “Try it” button and choose “Authorization_code” in the Authorization flow. It will open a connection window
  • Use the credentials for the email address you checked in Step 1
  • If it correctly worked the OCP-Apim-Subscription-Key + the token will be automatically filled in
  • Click on “Send” to receive the JSON response

If it fails, it’s linked to the credentials used. If it works, it’s a problem with the python code

 

Have a good day,

Leslie – Community Manager

Hi Leslie

Even with Try-Tool I got the same error

I follow all you’s instructions (even if I try several time in the past):
<ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Check the email address to use for 3rd party authentication in Thermostat app (but I seem to understand that you already did this) : Menu > Account >  Third-party access > “your account is connected to email@email.com
  • 3rd party authentication email in the app is giuseppe.faccilongo@tin.it (that is my very old access email since 2004, but I have changed it many years ago) and my access email is gius.faccilongo@gmail.com
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Use the Sign-In button here : https://developer.legrand.com/works-with-legrand/
  • Point OK
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Once signed-in, click on “List of APIs” > APIs > Smarther legacy v2 > click on “GET Plants” method
  • Point OK
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Click on the green “Try it” button and choose “Authorization_code” in the Authorization flow. It will open a connection window
  • Point OK
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Use the credentials for the email address you checked in Step 1
  • Point OK
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • If it correctly worked the OCP-Apim-Subscription-Key + the token will be automatically filled in
  • Point OK
    <ul style=”box-sizing: border-box; color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>

  • Click on “Send” to receive the JSON response
  • I got the error 401-unauthorized

     

    I send the screeshots

    Thank you for the help, I appreciate it

     

    Giuseppe

     

    Images:
    You must be logged in to view attached files.

    Hello,

    Strange 😮

    Did you try in Private navigation by connecting first via https://developer.legrand.com/works-with-legrand/ and then go to the backoffice part by clicking on “List of APIs” ?

    If it still fails, can you try to create a new developer account with an other mail and then re-try ?

    Have a good day,

    Leslie – Community Manager

    Hi Leslie

    thank you for the answer
    I try and also in private navigation the error was the same

     

    Unfortunately  I don’t have any other email for try.

    Furthermore, I have with Legrand-BTicino some other things related with this account, like Control & Project and I think that I have to rebuild all my House if I change the account and manage two account is not the best thing

    I’m almost sure that the problem is related to the account mismatching, but I ask if it is possible for you delete my third part authorizing for Smather so I will be able to connect the other one

    Please help me, thank you

    Giuseppe

    Hi Guiseppe,

    We took a better look at it with our developers :

    • “disconnect” button also fails on my side (I have the same kind of configuration where my app account is my legrand mail address, and the third-party one a gmail one)
    • we don’t find your @tin.it account in the database (as if it was deleted)

    In the “Third-party access” page you have a link “Open this link and connect with this email address to see connected applications” <= if you try to log in with your @tin.it address, does it work ?

    Meanwhile, I reported the problem to the Thermostat app developers and ask them if they have an idea about what could happen

    Have a good day,

    Leslie – Community Manager

    Hi Leslie

    then you for help

    the link <span style=”color: #545354; font-family: ‘Source Sans Pro’, sans-serif; font-size: 18px;”>“Third-party access” works with @gmail address, but If I try to log in with @tin.it address it replay with “Account not found” error</span>

    Thank you much!

    I will wait for you

    Giuseppe

    Hi Leslie

    Please have you any news?

    Thank you

    Hi Guiseppe,

    I performed some more tests with the developers :

    • the “Disconnect” button for 3rd party access is broken on the Android app. It works with an iOS device. I asked them to fix that and warn me once done
    • I confirm that your third-party account doesn’t exist anymore. But it could possible to re-create it with the same email address and will not affect your installation and the access to your products via the Thermostat app

    I will warn you once I have more news

    Have a good day,

    Leslie – Community Manager

    Thank you very much Leslie!

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

    You must be logged in to reply to this topic.

    Information

    9 replies
    2 participants