Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

300
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda