Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

84
Vistas
Implementing Twilio Api call from a CURL example to js returns status code of 200 but does not seem to update data

I am trying to update my sim fleet name and sim unique name without any success

  const url = `https://supersim.twilio.com/v1/Sims/${sid}? fleet=${fleet}&uniqueName=${uniqueName}`;


  const resp = await fetch(url, {
    method: "POST",
    headers: new Headers({
      Authorization: auth.twilioAuth,
      "Content-Type": "application/x-www-form-urlencoded",
    }),
    body: new URLSearchParams({
      Iccid: iccid,
    }).toString(),
  });

I get a 200 response with my sim object as follows

account_sid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
date_created: "2022-01-08T21:05:00Z"
date_updated: "2022-01-08T21:05:00Z"
fleet_sid: null  //did not update
iccid: "XXXXXXXXXXXXX"
links: {billing_periods: 'https://supersim.twilio.com/v1/Sims/HSXXXXXXXXXXXXXXXXXXXXXXXX/BillingPeriods'}
sid: "HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
status: "new"
unique_name: null  //did not update
url: "https://supersim.twilio.com/v1/Sims/HSXXXXXXXXXXXXXXXXXXXXXXXXXXX"


Twilio documentation

and this is what their CURL example website says

curl -X POST https://wireless.twilio.com/v1/Sims/DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
--data-urlencode "CallbackMethod=POST" \
--data-urlencode "CallbackUrl=https://sim-manager.mycompany.com/sim-update-callback/AliceSmithSmartMeter" \
--data-urlencode "Status=active" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should send the parameters you want to update in the body of the request, not in the query parameters. Also note that the parameter names are in Pascal case. Try this:

  const url = `https://supersim.twilio.com/v1/Sims/${sid}`;

  const resp = await fetch(url, {
    method: "POST",
    headers: new Headers({
      Authorization: auth.twilioAuth,
      "Content-Type": "application/x-www-form-urlencoded",
    }),
    body: new URLSearchParams({
      Iccid: iccid,
      Fleet: fleet,
      UniqueName: uniqueName
    }).toString(),
  });
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda