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

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

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 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