SwitchBotAPI
SwitchBotAPI copied to clipboard
When executing the device control command of the Bot using the API, statusCode: 190 is returned.
Current Situation
When executing the device control command of the Bot using the API, statusCode: 190 is returned. When using the iOS application, it works correctly. Other devices (Lock Pro) work correctly using the API. The Bot has been initialized. However, the same error occurs.
Logs
Request Message:
{
mode: 'cors',
credentials: 'include',
method: 'POST',
headers: {
Authorization: 'dc81d51b5e16879709b58c6310fcf4a08522d2cf94b......',
sign: 'iXGsiMm3epPvjpFd2St2zpCQ.....',
nonce: 'e9a7ea58-6bd1-4f97-b978-c4c24403f8a7',
t: '1719902144509',
'Content-Type': 'application/json'
},
body: '{"commandType":"command","command":"press","parameter":"default"}'
}
Response Message:
{
status: 200,
statusText: 'OK',
headers: Headers {
date: 'Tue, 02 Jul 2024 06:35:47 GMT',
'content-type': 'application/json',
'content-length': '90',
connection: 'keep-alive',
'x-amzn-requestid': '7ddbd890-5174-4482-a4f5-0ff13dd57229',
'x-amz-apigw-id': 'aRXmMGHDIAMEPag=',
'x-amzn-trace-id': 'Root=1-66839fc0-3a12f93732e6073d2d045288;Parent=0aa31fa23dd99796;Sampled=0;lineage=c8c2b0f2:0|bf95bacf:0'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: 'basic',
url: 'https://api.switch-bot.com/v1.1/devices/D63533334479/commands'
}
Body parsed
{
statusCode: 190,
body: {},
message: "Cannot read properties of undefined (reading '0')"
}
Configuration
There are no relevant configurations.
Environment
- OS:Rocky Linux release 9.4 (Blue Onyx)
- Software:Next.js v14.2.3
- Node:v20.14.0
- npm:10.8.1
Additional Context
No response