by

Sending all HTTP parameters in API Gateway

Here’s an API Gateway mapping template to send all HTTP path, query string, and header parameters to your backend integration (i.e. Lambda function).

#set($allParams = $input.params())
{
    "body-json" : "$input.json('$')",
    "params" : {
    #foreach($type in $allParams.keySet())
        #set($params = $allParams.get($type))
        "$type" : {
            #foreach($paramName in $params.keySet())
                "$paramName" : "$util.escapeJavaScript($params.get($paramName))"
                #if($foreach.hasNext),#end
            #end
        }
        #if($foreach.hasNext),#end
    #end
    }
}

will produce something like:

{
   "body-json":"{}",
   "params":{
      "path":{
         "pathParamName1":"pathParamValue1",
         "pathParamName2":"pathParamValue2",
         "pathParamName3":"pathParamValue3"
      },
      "querystring":{
         "queryParamName1":"queryParamValue1",
         "queryParamName2":"queryParamValue2",
         "queryParamName3":"queryParamValue3"
      },
      "header":{
         "headerParamName1":"headerParamValue1",
         "headerParamName2":"headerParamValue2",
         "headerParamName3":"headerParamValue3"
      }
   }
}

The parameters can then be accessed in your Lambda function, i.e.

exports.myHandler = function(event, context) {
   console.log("pathParamName1 = " + event.params.path.pathParamName1);
   context.succeed("");
}

Here’s a Gist with the example.

Cheers,
Ryan

Write a Comment

Comment

  1. That wouldn’t work currently as non-alpha characters aren’t supported in parameter names in API Gateway. I’ve seen many conventions for query string arrays/maps but there’s no accepted standard defined in RFC3986, so API Gateway typically doesn’t support these. I’d recommend following up on the API Gateway forums with your specific use case.

    Cheers,
    Ryan

Webmentions

  • write my essay 4 me January 6, 2016

    writing a compare and contrast essay https://online2casino.com/

  • paid essay writing January 6, 2016

    wri­te an ana­ly­sis essay https://onlinecasinos4me.com/

  • horse ivermectin for dogs January 6, 2016

    horse ivermectin for dogs

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • paid essay writing January 6, 2016

    help writing essays https://essaypoints.com/

  • ivermectin for lice January 6, 2016

    ivermectin for lice

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • how much ivermectin to give a dog with mange January 6, 2016

    how much ivermectin to give a dog with mange

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • write my college essay January 6, 2016

    someone write my essay https://essaytag.com/

  • write a narrative essay January 6, 2016

    write a narrative essay https://essaysnet.com/

  • ivermectin dosage for cats January 6, 2016

    ivermectin dosage for cats

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • ivermectin fenbendazole January 6, 2016

    ivermectin fenbendazole

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • ivermectin for bed bugs January 6, 2016

    ivermectin for bed bugs

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • cdc ivermectin January 6, 2016

    cdc ivermectin

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • write essays for money online January 6, 2016

    writing a comparison essay https://essaywritercentral.com/

  • what to write my college essay about January 6, 2016

    argument essay writing https://essayghostwriter.com/

  • 1 January 6, 2016

    1

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • manufacgturers of duloxetine January 6, 2016

    manufacgturers of duloxetine

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • does lexapro help with anxiety January 6, 2016

    does lexapro help with anxiety

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • atorvastatin 40 mg what is it for January 6, 2016

    atorvastatin 40 mg what is it for

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • how does hydrochlorothiazide work January 6, 2016

    how does hydrochlorothiazide work

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • sexy gay sites 2021 -dating January 6, 2016

    aussie gay dating https://gaydatinglosangeles.com/

  • adult gay dating sites January 6, 2016

    the villages florida,gay dating https://dating-gaym.com/

  • what effects can happen from drinking alcohol with escitalopram oxalate January 6, 2016

    what effects can happen from drinking alcohol with escitalopram oxalate

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • gay dating where January 6, 2016

    gay dating ads in biloxi https://datinggayservices.com/

  • furry gay dating game January 6, 2016

    gay japanese dating site https://gayonlinedating.net/

  • gay dating sites scruff January 6, 2016

    gay dating site for windows https://gayedating.com/

  • raya gay dating site January 6, 2016

    silverman dating gay https://gay-singles-dating.com/

  • black gay men dating January 6, 2016

    teenage gay dating https://gaydatingcanada.com/

  • quetiapine fumarate controlled substance January 6, 2016

    quetiapine fumarate controlled substance

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • sertraline 50mg January 6, 2016

    sertraline 50mg

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • paxil or prozac or seroquel or risperdal or xanax or zoloft or zyprexa January 6, 2016

    paxil or prozac or seroquel or risperdal or xanax or zoloft or zyprexa

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • prevacid or prilosec January 6, 2016

    prevacid or prilosec

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • what is the medicine atorvastatin used for January 6, 2016

    what is the medicine atorvastatin used for

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • norvasc and lisinopril together January 6, 2016

    norvasc and lisinopril together

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • how long does it take for hydrochlorothiazide to lower blood pressure January 6, 2016

    how long does it take for hydrochlorothiazide to lower blood pressure

    Sending all HTTP parameters in API Gateway – RyanG Blog

  • gay dating glendale az January 6, 2016

    gay ginger dating sites https://gaychatus.com/

  • tinder gay dating site January 6, 2016

    gay dating in atlanta https://freegaychatnew.com/

  • gay teen dating chat January 6, 2016

    dating for gay black men https://gaydatingzz.com/

  • gay hsv dating January 6, 2016

    chub gay dating https://gaychatrooms.org/

  • browse gay dating las vegas January 6, 2016

    dating orlando gay https://gaychatgay.com/

  • net carbs keto January 6, 2016

    diet coke keto

  • match dating free January 6, 2016

    free dating site with instant chat

  • free dating site to register January 6, 2016

    charlotte free dating brother

  • dating sites canada free online January 6, 2016

    free dating website ireland

  • voltaren gel dosing January 6, 2016

    voltaren gel dosing

    voltaren gel dosing

  • herbal viagra pills January 6, 2016

    herbal viagra pills

    herbal viagra pills

  • cialis capsule January 6, 2016

    cialis capsule

    cialis capsule

  • sildenafil revatio January 6, 2016

    sildenafil revatio

    sildenafil revatio

  • medshuku cialis pills January 6, 2016

    medshuku cialis pills

    medshuku cialis pills

  • sildenafil for sale January 6, 2016

    sildenafil for sale

    sildenafil for sale

  • 36 hour cialis January 6, 2016

    36 hour cialis

    36 hour cialis

  • sildenafil generic viagra January 6, 2016

    sildenafil generic viagra

    sildenafil generic viagra

  • liquid cialis January 6, 2016

    liquid cialis

    liquid cialis

  • cialis over the counter at walmart January 6, 2016

    cialis over the counter walmart

    cialis over the counter at walmart

  • fildena 150mg January 6, 2016

    fildena 150

    fildena pills

  • lowest price sildenafil January 6, 2016

    lowest price sildenafil

    lowest price sildenafil

  • tadalafil tadalafromcanada January 6, 2016

    tadalafil tadalafromcanada

    tadalafil tadalafromcanada

  • cialis tadalafil 20 mg non-prescription January 6, 2016

    cialis 5mg take everyday no prescription

    canadian cialis without a doctor prescription

  • ivermectin for covid 19 January 6, 2016

    stromectol generic of ivermectin

    ivermectin 3mg online

  • cheap sildenafil citrate 100mg pills January 6, 2016

    best price for sildenafil 20 mg

    sildenafil apotex 100mg

  • buy cialis tadalafil uk January 6, 2016

    buy cialis tadalafil uk

    Health

  • cialis 20mg for sale January 6, 2016

    cialis 20mg for sale

    SPA

  • cialis otc usa January 6, 2016

    cialis otc usa

    cialis otc usa

  • generic viagra January 6, 2016

    generic viagra

    generic viagra

  • sildenafil mexico January 6, 2016

    sildenafil mexico

    sildenafil mexico

  • viagra overdose chastity caption January 6, 2016

    viagra overdose chastity caption

    viagra overdose chastity caption

  • otc cialis alternative January 6, 2016

    otc cialis alternative

    otc cialis alternative

  • cheap cialis super active January 6, 2016

    cheap cialis super active

    cheap cialis super active

  • levitra vs cialis australia January 6, 2016

    levitra vs cialis australia

    levitra vs cialis australia

  • cialis 50mg price January 6, 2016

    cialis 50mg price

    cialis 50mg price

  • acheter femalle cialis January 6, 2016

    acheter femalle cialis

    acheter femalle cialis

  • super hard viagra January 6, 2016

    super hard viagra

    super hard viagra

  • online viagra reviews south africa January 6, 2016

    online viagra reviews south africa

    online viagra reviews south africa

  • porn jodi west viagra January 6, 2016

    porn jodi west viagra

    porn jodi west viagra

  • viagra blowjob January 6, 2016

    viagra blowjob

    viagra blowjob

  • daily cialis January 6, 2016

    daily cialis

    daily cialis

  • helps son with viagra boner January 6, 2016

    helps son with viagra boner

    helps son with viagra boner

  • is viagra medicare covered January 6, 2016

    is viagra medicare covered

    is viagra medicare covered

  • use of cialis and viagra January 6, 2016

    use of cialis and viagra

    use of cialis and viagra

  • cialis timing January 6, 2016

    cialis timing

    cialis timing

  • how to take cialis before sex January 6, 2016

    how to take cialis before sex

    how to take cialis before sex

  • male erection on viagra January 6, 2016

    male erection on viagra

    male erection on viagra

  • porn star cialis January 6, 2016

    porn star cialis

    porn star cialis

  • buy viagra online January 6, 2016

    buy viagra online

    buy viagra online

  • levitra online January 6, 2016

    levitra online

    levitra online

  • cheap cialis generic January 6, 2016

    cheap cialis generic

    cheap cialis generic

  • vardenafil 20mg January 6, 2016

    vardenafil 20mg

    vardenafil 20mg

  • tadalafil 5 mg January 6, 2016

    tadalafil 5 mg

    tadalafil 5 mg

  • viagra falls January 6, 2016

    viagra falls

    viagra falls

  • jodi west viagra January 6, 2016

    jodi west viagra

    jodi west viagra

  • cheap viagra generic January 6, 2016

    cheap viagra generic

    cheap viagra generic

  • viagra stock January 6, 2016

    viagra stock

    viagra stock

  • sildenafil 100 mg January 6, 2016

    sildenafil 100 mg

    sildenafil 100 mg

  • teva viagra cost January 6, 2016

    teva viagra cost

    teva viagra cost

  • warnings for cialis January 6, 2016

    warnings for cialis

    warnings for cialis

  • fucking on viagra January 6, 2016

    fucking on viagra

    fucking on viagra

  • viagra on steroids January 6, 2016

    viagra on steroids

    viagra on steroids

  • sildenafil citrate 25mg fildena January 6, 2016

    sildenafil citrate 25mg fildena

    sildenafil citrate 25mg fildena

  • cymbalta overdose January 6, 2016

    cymbalta overdose

    cymbalta overdose

  • cephalexin and strep throat January 6, 2016

    cephalexin and strep throat

    cephalexin and strep throat

  • mylan celecoxib capsules 200mg January 6, 2016

    mylan celecoxib capsules 200mg

    mylan celecoxib capsules 200mg

  • chlamydia azithromycin dose January 6, 2016

    chlamydia azithromycin dose

    chlamydia azithromycin dose

  • amoxicillin dosage dogs January 6, 2016

    amoxicillin dosage dogs

    amoxicillin dosage dogs

  • duloxetine hcl dr January 6, 2016

    duloxetine hcl dr

    duloxetine hcl dr

  • cephalexin starting dose January 6, 2016

    cephalexin starting dose

    cephalexin starting dose

  • celecoxib capsules 200mg lupin January 6, 2016

    celecoxib capsules 200mg lupin

    celecoxib capsules 200mg lupin

  • azithromycin capsules January 6, 2016

    azithromycin capsules

    azithromycin capsules

  • amoxicillin 875 mg sinus infection January 6, 2016

    amoxicillin 875 mg sinus infection

    amoxicillin 875 mg sinus infection

  • alka seltzer viagra January 6, 2016

    alka seltzer viagra

    alka seltzer viagra

  • cialis alternative January 6, 2016

    cialis alternative

    cialis alternative

  • viagra commercial lady blue dress January 6, 2016

    viagra commercial lady blue dress

    viagra commercial lady blue dress

  • cialis usage instructions January 6, 2016

    cialis usage instructions

    cialis usage instructions

  • cialis in action January 6, 2016

    cialis in action

    cialis in action

  • sildenafil viagra January 6, 2016

    sildenafil viagra

    sildenafil viagra

  • cialis 10mg January 6, 2016

    cialis 10mg

    cialis 10mg

  • viagra sales January 6, 2016

    viagra sales

    viagra sales

  • viagra online cheap January 6, 2016

    viagra online cheap

    viagra online cheap

  • cialis information January 6, 2016

    cialis information

    cialis information

  • what are citalopram January 6, 2016

    what are citalopram

    what are citalopram

  • celebrex arrhythmia January 6, 2016

    celebrex arrhythmia

    celebrex arrhythmia

  • using coreg and cialis January 6, 2016

    using coreg and cialis

    using coreg and cialis

  • forum buspar January 6, 2016

    forum buspar

    forum buspar

  • what is buspar 10 mg January 6, 2016

    what is buspar 10 mg

    what is buspar 10 mg

  • bupropion hcl er sr January 6, 2016

    bupropion hcl er sr

    bupropion hcl er sr

  • intrathecal baclofen pump for spasticity January 6, 2016

    intrathecal baclofen pump for spasticity

    intrathecal baclofen pump for spasticity

  • icd 10 code for removal of baclofen pump January 6, 2016

    icd 10 code for removal of baclofen pump

    icd 10 code for removal of baclofen pump

  • azithromycin and bronchitis January 6, 2016

    azithromycin and bronchitis

    azithromycin and bronchitis

  • atorvastatin labs January 6, 2016

    atorvastatin labs

    atorvastatin labs

  • abilify lawsuit January 6, 2016

    abilify lawsuit

    abilify lawsuit

  • what is amoxicillin used for January 6, 2016

    what is amoxicillin used for

    what is amoxicillin used for

  • amlodipine interactions January 6, 2016

    amlodipine interactions

    amlodipine interactions

  • amitriptyline buspar porr actions January 6, 2016

    amitriptyline buspar porr actions

    amitriptyline buspar porr actions

  • amiodarone hydrochloride tablets January 6, 2016

    amiodarone hydrochloride tablets

    amiodarone hydrochloride tablets

  • allopurinol risks January 6, 2016

    allopurinol risks

    allopurinol risks

  • recreational abilify January 6, 2016

    recreational abilify

    recreational abilify

  • tizanidine pseudoephedrine January 6, 2016

    tizanidine pseudoephedrine

    tizanidine pseudoephedrine

  • oxybutynin pill picture January 6, 2016

    oxybutynin pill picture

    oxybutynin pill picture

  • ciprofloxacin side effects January 6, 2016

    ciprofloxacin side effects

    ciprofloxacin side effects

  • can you take cephalexin for strep throat January 6, 2016

    can you take cephalexin for strep throat

    can you take cephalexin for strep throat

  • coupons for viagra January 6, 2016

    coupons for viagra

    coupons for viagra

  • cialis tadalafil January 6, 2016

    cialis tadalafil

    cialis tadalafil

  • is viagra safe January 6, 2016

    is viagra safe

    is viagra safe

  • which is stronger cefdinir or augmentin January 6, 2016

    which is stronger cefdinir or augmentin

    which is stronger cefdinir or augmentin

  • viagra generico January 6, 2016

    viagra generico

    viagra generico

  • levitra January 6, 2016

    levitra

    levitra

  • viagra sample pack January 6, 2016

    viagra sample pack

    viagra sample pack

  • incest viagra January 6, 2016

    incest viagra

    incest viagra

  • brother takes viagra January 6, 2016

    brother takes viagra

    brother takes viagra

  • atorvastatin 30 mg January 6, 2016

    atorvastatin 30 mg

    atorvastatin 30 mg

  • reddit viagra January 6, 2016

    reddit viagra

    reddit viagra

  • what is cialis January 6, 2016

    what is cialis

    what is cialis

  • viagra in action January 6, 2016

    viagra in action

    viagra in action

  • generic viagra online January 6, 2016

    generic viagra online

    generic viagra online

  • revatio vs viagra January 6, 2016

    revatio vs viagra

    revatio vs viagra

  • liquid viagra January 6, 2016

    liquid viagra

    liquid viagra

  • buy levitra January 6, 2016

    buy levitra

    buy levitra

  • otc viagra January 6, 2016

    otc viagra

    otc viagra

  • taking viagra January 6, 2016

    taking viagra

    taking viagra

  • viagra alternative January 6, 2016

    viagra alternative

    viagra alternative

  • cialis 5 mg January 6, 2016

    cialis 5 mg

    cialis 5 mg

  • canada viagra January 6, 2016

    canada viagra

    canada viagra

  • viagra dosage January 6, 2016

    viagra dosage

    viagra dosage

  • levitra 10mg January 6, 2016

    levitra 10mg

    levitra 10mg

  • tadalafil 20 mg canadian drug stores January 6, 2016

    tadalafil 20mg

    cialis tadalafil reviews add.asp – cialis pills online reply #4 on – cialis 10mg price announcements

  • generic viagra January 6, 2016

    viagra for sale

    viagra bivirkninger – viagra commercials settings – viagra risks

  • viagra 100mg January 6, 2016

    viagra for sale

    viagra for women does it work jump to – trackback skriv en kommentar viagra – viagra dose medications contact info

  • walmart cialis January 6, 2016

    cialis at walmart

    brand cialis – cialis commercial last post – cialis dosage forum newbie

  • levitra coupon January 6, 2016

    levitra vs viagra

    natural remedies for ed – dosage for levitra – levitra 5 mg