How do you pass a query parameter to an Airkit web flow?

Hello :wave: !

I’m looking to pass a query parameter to a web flow from a launch url. I’d like my url to be:

https://app.airkit.com/trigger?id=12345

And be able to grab the id and pass to my web flow. Has anyone done this in v18.0?

Great question! So for this scenario, you’re going to have to use an App API to do this. Check out the video below that i recorded that walks through the steps in v18.0.

Creating the App API with Query Params

  1. Add an App API to your application and create your route

  2. Add your query parameter on your endpoint

  3. Add the Start Journey Data operation and pass payload.queryParams to the start parameters

  1. Configure your response:
  • Response Headers: Location: journey.canvas_link
  • Response Status: 302
  • Response Body: journey

  1. Check to see if you can retrieve the id on a webflow by using session.start.id.

Try it out:

You can try this experience out here by clicking on the link and placing whatever you’d like in the query parameter:

https://app.airkit.com/redirect-with-parameters?id=insertIdHere

5 Likes

Quick update here, when you are using an App API and wanting to do a redirect, you should use 302 instead of 301. In the video, I use 301 but recently came across that 301s are cached in the browser.

Thanks @kyung for flagging!

Also another note, session.start.queryParams is an accessible namespace is 18.0 and you can actually just access that directly even when using a standard web link as a launch trigger.