Open HaydenRichardson opened 3 years ago
Please include more details about where you're getting stuck.
@codetheweb ok so const OpenAPI = require('@tuyapi/openapi');
const api = new OpenAPI({key: '10101010', secret: '1010101010', schema: '10101010'});
(async () => { // Must be called before any other operations to get auth token await api.getToken();
const uid = await api.putUser({ countryCode: '1', username: 'my-username', password: 'c7fb2740c5fc45660d9e4ed765a479fa', usernameType: 1});
console.log(uid);
const token = await api.getDeviceToken({uid, timezone: 'America/Chicago'});
console.log(token);
console.log(await api.getDevicesByToken('EkjQjlbo')); })(); i have all of this and i get this error UnhandledPromiseRejectionWarning: Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/root/ping-pong-bot/my-bot/node_modules/@tuyapi/openapi/dist/api.js:74:31) also i was wondering if you had a discord?
actually this is my code const OpenAPI = require('@tuyapi/openapi'); const api = new OpenAPI({key: '*', secret: '*****', schema: 'sjmnsjdkag09kd08zf9m'});
(async () => { // Must be called before any other operations to get auth token await api.getToken();
const uid = await api.putUser({ countryCode: '1', username: 'hayden.richardson625@yahoo.com', password: '*****', usernameType: 1});
console.log(uid);
const token = await api.getDeviceToken({uid, timezone: 'America/New-York'});
console.log(token);
console.log(await api.getDevicesByToken('EkjQjlbo')); })();
If you're getting sign invalid
either your key or secret is probably wrong. Please double-check those values.
is that how i would do the timezone?
@codetheweb Do i put the devices id or the projects id for schema?
I need to start asking these questions in one comment but for username and password i use the email and password for https://iot.tuya.com/.
@codetheweb i think i fixed that error but now its telling me permission denied.
You should use the user account you sign into the app with for credentials here instead of the credentials used to sign into iot.tuya.com.
o ok
Can someone help me with the setup.