Classe 100X16E & Easy Kit Connected
Hello,
the OATH flow works great, I get a access_token, an id_token and a refresh_token.
Now I try:
curl "https://api.developer.legrand.com/vdeproducts/v1.0/plants" \
-H "Ocp-Apim-Subscription-Key:{my key}" \
-H "Authorization:Bearer {access_token}"
or:
curl "https://api.developer.legrand.com/vdeproducts/v1.0/plants" \
-H "Ocp-Apim-Subscription-Key:{my key}" \
-H "Authorization:Bearer {id_token}"
but I get:
{“message”: “Expression evaluation failed. JWT_ERROR”}
or:
{“message”: “Invalid token”, “code”: 12}
What is wrong with this curl? Do I try-it, then it works.
Thanks fiveyears
Hello,
At the bottom of each call page, you find Code samples : https://portal.developer.legrand.com/docs/services/classe-100x16e-easy-kit-connected/operations/Plants
Can you please try to follow this pattern ?
Also, a token is valid 1 hour. The error seems to be linked to it. Please verify that it didn’t expired (and try also without “Bearer”)
Have a good day,
Leslie – Community Manager
Hi,
without out Bearer results in “No token”
With bearer and my access code (always just refreshed and never used) I get this:
{
“message”: “Expression evaluation failed. JWT_ERROR”,
“code”: 7
}
If I copy the Authorization of the Try-it response into my curl instead my own authorisation token, then it works, maybe a wring encoding of the token?
The Try-it token cannot be refreshed, so it can be used to retrieve data on a one-shot, but not to maintain connectivity at long term
Did you try to make a request with the Sample code + using “access_token” instead of “id_token” ? It’s maybe an error in documentation
On my side, I’ll try to have access to a C100X in order to make tests
Have a good day,
Leslie – Community Manager
I know,
I use the sample code, but my access_token brings the “<span style=”color: #575757; font-family: Segoe UI, Noto Sans, sans-serif;”><span style=”caret-color: #575757;”>Expression evaluation failed. JWT_ERROR”-error. The try-it_token works with the sample code, that’s is the question why</span></span>
Hi again,
After several tests, I think I found your issue
Did you ask for audiovideo.read + .write scopes in your application ? If no, ask for them by editing your app and I’ll add them
I confirm you must also use “access_token”
I asked the teams to correct the documentation
Have a good day,
Leslie – Community Manager
Hello,
now it works smoothly after updating my app (I set all rights), the status is still “update requested”
fiveyears
Now I understand, I get the message:
{
“message”: “Expression evaluation failed. JWT_ERROR”,
“code”: 7
}
when the App is not authorised for this.
Now I can get plants and topology without problems, but I get the error above when trying to get the open lock ticket??
Hello,
I’ve just validated the new scopes for your app
Can you try again ?
Have a good day,
Leslie – Community Manager
Hello again,
plants and topology work, open lock gets the <span style=”caret-color: #575757; color: #575757; font-family: ‘Segoe UI’, ‘Noto Sans’, sans-serif;”>JWT_ERROR</span>
fiveyears
Hello,
Seems to work for me via the Try It
Do you have a lock recognized in your installation ? If you make a GET Topology (https://portal.developer.legrand.com/docs/services/classe-100x16e-easy-kit-connected/operations/Topology/console) you retrieve a JSON looking like this one :
{ “topology“: { “plant“: { “id“: “b16b4cf8-XXXXXXXXXXX”, “name“: “Eliot”, “type“: “house”, “modules“: [{ “device“: “lock”, “system“: “automation”, “id“: “ee691b61-XXXXXXXXXXXXX”,
Then, if you make a GET Open lock request (https://portal.developer.legrand.com/docs/services/classe-100x16e-easy-kit-connected/operations/Open-lock/console) with plant ID and lock device ID you should correctly retrieve a ticket :
{ “locks“: [{ “ticket“: “eyJhbGciOiJSU0EtT0FFUCIsImVuYyXXXXXXXXXXXXXXXXXX”,
Have a good day,
Leslie – Community Manager
Yes, topology works fine, I got 3 Ids for 3 locks (dunno why, I got 1 lock installed).
Get ticket doesn’t work (<span style=”caret-color: #575757; color: #575757; font-family: ‘Segoe UI’, ‘Noto Sans’, sans-serif;”>JWT_ERROR)</span>, but when I do “try-it” whit the Ids, then I get a ticket for each id.
fiveyears
Strange …
Can you please send me via the contact form the JSON you retrieve with the 3 IDs + the email address of the end-user account your use on the app ? I’ll ask the teams to take a look in database in order to see what happens
Also, as it seems to work via Try It, can you please send me the code of the request you send which sends you the JWT_ERROR ?
Have a good day,
Leslie – Community Manager
Thank you, I re-authorized the app and now I can get a ticket.
Last question, how do I open the lock after getting the ticket. There is no method to open the lock
Yes I can get all tickets, but what then?
I tried the <span style=”caret-color: #575757; color: #575757; font-family: wf_segoe-ui_normal, ‘Segoe UI’, ‘Segoe WP’, Tahoma, Arial, sans-serif; font-size: 14px;”> </span>Door Entry SDK too, but it doesn’t compile anymore (Xcode 12.4). What is the step to use the ticket?
You must be logged in to reply to this topic.