Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Sending request with scriptable app to Shelly cloud

After connecting and wiring the Shelly2.5 with my shutter, trying to connect it with Siri. Decided to do this with Scriptable app and then connect Siri commands to it, so it will run.

Currently have an issue to send the request from the Scriptable app as the code is written below, when i tried to fire it from Postman it works.


// # open shutter

let url = "https://domain.shelly.cloud";
let suffix ="/device/relay/roller/control/";
let auth_key = "AAAABBBBCCCDDDEEEEFFFFFF____EXAMPLE_TOKEN___AAAABBBBCCCDDDEEEEFFFFFF";

let channel = 0;
let turn = "on";

let direction = "open";
let id = "C45bbe75f1bd";


let body = { 
  "auth_key":auth_key, 
  "id": id, 
  "direction":direction
  };
// console.log(body);
let req = new Request(url + suffix); 
// console.log(url+suffix);
req.method = "POST";
req.body = body;

req.headers = { "Content-Type":"application/x-www-form-urlencoded" };


// req.body = JSON.stringify(body)
let json = await req.loadJSON()
console.log(json);

the current response:

2021-09-13 11:20:46: {"isok":false,"errors":{"invalid_header":"Unauthorized! Wrong authorization header provided!","invalid_token":"The login information is invalid! Please login again!"}}

please notice that i change the real token and the real sub domain for shelly cloud. It will be grate if someone know how to fix this, Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

looks like the Shelly expect form-encoded body. Try this

let form  = Object.keys(body).map( k => `${k}=${encodeURIComponent(body[k])}`).join('&')

req.body = form
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!