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

295
Vistas
AWS Lambda: extract id from path

I have a resource in API Gateway /{id}/contacts, which calls my lambda method contacts.

In the lambda, how do I access the {id} from the path, or pass it in the event body in the api gateway?

exports.handler = (event, context, callback) => {...}

I checked the 'Use Lambda Proxy integration' but the event does not contain that data in the lambda itself.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I got it working.

After checking off Use Lambda Proxy integration I also had to handle the HTTP response in the code, which I didn't do at first and got errors.

The path data does appear in the event object now, but the function needs to return output with HTTP data as well, like this:

   var response = {
        statusCode: 200,
        headers: {
            "x-custom-header" : "my custom header value"
        },
        body: JSON.stringify(event)
    };
     callback(null, response);
over 4 years ago · Santiago Trujillo 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