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

145
Vistas
Saving token is postman envvar automatically not working

API Response :

{
 "token" :"eyJ0eXAiOiJKV1QiLCfhfgJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyLCJ1c2VybmFtZSI6ImRiYWRtaW5AY2lkbnkub3JnIiwiZXhwIjoxNjMyNTY3OTY1LCJlbWFphbCI6ImRiYWRtaW5AY2gjglkbnkub3JnIiwib3JpZ19pYXQiOjE2MzI1NDk5NjV9.3ZtHRy0_jBao7hvQLSVcQuvIMIgjgjg7mmvKqlegS5Jo0-Q"
}

This is in Test

var res = pm.response.json();
pm.environment.set('env',token);

This is expected to save the token in env variable but the token did not work after saving.

What is the issue here?

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

0

Try this , it should work:

var res = pm.response.json();
pm.environment.set('env',res.token);

Basically the token you saved contained full response, not the token only.

about 4 years ago · Juan Pablo Isaza Denunciar

0

var {token} = pm.response.json();
pm.environment.set('env',token);

You should access the property , you can access it by pm.response.json().token or by using destructure assignment

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