Keep in mind that I'm very new and lost when it comes to coding.
I'm trying to generate a temporary for a smart lock that uses the Tuya App using Postman. I am currently stuck on the password as it requires it to be encrypted. password requirements from tuya It says that i need to decrypt the "ticket_key" (which i manage get through the "Get a temporary key for password encryption" request) using the "accessKey". Can anyone help me locate this accessKey and explain how i am supposed to encrypt and decrypt (do i need to create a program for it or is there one already available).
Thanks in advance!
I tried using ChatGPT to write me a program that encrypts and decrypts but didnt manage to get anything usable out of it.
I encountered a similar challenge and managed to achieve the desired outcome through a JavaScript program. Below are the steps I followed, which can also be accomplished using only Postman and online tools:
Obtain Access Token:
/v1.0/token?grant_type=1
(GET method)Request Access Key:
/v1.0/devices/[device_id]/door-lock/password-ticket
(POST method)Decrypt Access Key:
Encrypt Pin Code:
Create a Password:
/v1.0/devices/[device_id]/door-lock/temp-password
(POST method){ "password": "9c63efba8fb57e89319dff9117d3765a", "password_type": "ticket", "ticket_id": "cNOYOdpM", "effective_time": 1701187200000, "invalid_time": 1701360000000, "name": "test666", "time_zone": "" }
Note: For Postman users, it's recommended to use the Postman collection from https://developer.tuya.com/en/docs/iot/set-up-postman-environment?id=Ka7o385w1svns. This collection includes pre-written JavaScript code that calculates the sign value for each request.