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

73
Vistas
Push data from console.log to html
const access_token = ""


fetch('https://api.fitbit.com/1/user/-/profile.json', {
    method: "GET",
    headers: {"Authorization": "Bearer " + access_token}
})
.then(response => response.json())
//.then(json => console.log(json))
.then((out) =>
{ 
   
    console.log(out.data);
    document.getElementById('log').innerHTML=out.data;
    
})

hi, I have been trying to fetch wep API using the above js code. i have successfully fetched the data inside my debug console but now I want to fetch inside my firebase. Can someone help with this. For security purpose i removed the access token.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You code seems OK. Either your access token is not correct, or the JSON object you receive has no "data" key.

If I'm on the right page, it seems that you should use "out.user" instead of "out.data": https://dev.fitbit.com/build/reference/web-api/user/get-profile/

about 4 years ago · Juan Pablo Isaza Denunciar

0

make sure the out.data is string not an array or object.

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