Current Situation
I wonder why no example using curl is provided.
I found this (at https://libraries.io/npm/homebridge-switchbot-discomfort-index):
TOKEN="..."
SECRET="..."
T=$(date +%s%3N)
NONCE=$(uuidgen)
SIGN=$(echo -n "${TOKEN}${T}${NONCE}" | openssl dgst -sha256 -hmac "${SECRET}" -binary | base64)
curl -s https://api.switch-bot.com/v1.1/devices
-H "Authorization: ${TOKEN}"
-H "sign: ${SIGN}"
-H "t: ${T}"
-H "nonce: ${NONCE}" | jq
Works great.
Note: uuidgen is part of the uuid-runtime package.
Proposed Change
Add a curl example, preferably also for Windows environments.
Additional Context
No response
Current Situation
I wonder why no example using curl is provided.
I found this (at https://libraries.io/npm/homebridge-switchbot-discomfort-index):
TOKEN="..."
SECRET="..."
T=$(date +%s%3N)
NONCE=$(uuidgen)
SIGN=$(echo -n "${TOKEN}${T}${NONCE}" | openssl dgst -sha256 -hmac "${SECRET}" -binary | base64)
curl -s https://api.switch-bot.com/v1.1/devices
-H "Authorization: ${TOKEN}"
-H "sign: ${SIGN}"
-H "t: ${T}"
-H "nonce: ${NONCE}" | jq
Works great.
Note: uuidgen is part of the uuid-runtime package.
Proposed Change
Add a curl example, preferably also for Windows environments.
Additional Context
No response