Hello Filip,
Hope you are doing well. I would recommend that you refer to the gpio_input_interrupt SDK example. You can download the SDK from this page: SDK Builder.
After downloading the SDK, you need to drag and drop the SDK into the "Installed SDK's view" in MCUXpresso.
To import and example, you must click "Import SDK example(s)…", Select the frdmkl27z, and click next:

Then you need to select the example: driver_examples>gpio>gpio_input_iunterrupt:

Hope this helps.
Best Regards,
Ricardo