← FAQ & Tips

Automating with iOS Shortcuts

Build shortcuts that check you in with one tap, check you in automatically when you arrive somewhere, and log quick notes from your home screen.

Looking for Android? See the Tasker guide.

Before you start

Every example talks to the When and What API, so you'll need an API token first.

1
Log in at whenandwhat.app, open your profile menu and choose API Tokens.
2
Give the token a name (e.g. "iPhone Shortcuts") and click Create.
3
Copy the token straight away — it's only shown once. Treat it like a password: anyone with it can add or view entries to your account. You can revoke it from the same page at any time.
Creating an API token in When and What
Creating an API token in When and What

1. One-tap "Check in here"

Sends your current location to When and What. Add it to your home screen, Control Centre, Action button, Apple Watch, etc. for the quickest possible check-in.

1
Open Shortcuts, tap + and name the shortcut "Check in here".
2
Add Get Current Location.
3
Add Get Contents of URL and set the URL to https://whenandwhat.app/api/locations/checkins/pending.
4
Expand it and set Method to POST. Add two headers: Authorization = Bearer YOUR_TOKEN and Accept = application/json.
5
Set Request Body to JSON and add three Text fields, inserting the Current Location variable and tapping it to pick the detail:
latitude   →  Current Location › Latitude
longitude  →  Current Location › Longitude
6
Optionally add Show Notification with the text "Checked in 📍" so you know it worked.

Tip: To add a note each time, put an Ask for Input action before the request and add a note field set to Provided Input.

The finished “Check in here” shortcut
The finished “Check in here” shortcut

2. Check in automatically when you arrive

Create a shortcut to checkin to the given location. Here's an example to copy and paste in your access token: iOS Shortcut

Pair the shortcut above with a personal automation so places you visit often — the gym, the office, a favourite café — are logged without you touching your phone.

You'll first need the ID for the location you're wanting to checkin
1
Find the location you're wanting to automate on you recent checkins or search for a location.
2
After clicking on the location grab the location ID from the URL

If the URL is https://whenandwhat.app/locations/437, your location ID is 437

Next build the shortcut for this location

1
In Shortcuts, open the Automation tab and tap +.
2
Choose Arrive, pick the location and adjust the radius.
3
Select Run Immediately so it doesn't ask for confirmation, and turn off Notify When Run if you prefer it silent.
4
Enter the location ID in a dictionary variable with an optional note
5
Tap Next and choose your Check in here shortcut.

Tip: You can also trigger the same shortcut from an NFC tag (stick one by your front door or desk) or when your phone joins a particular Wi-Fi network.

An “Arrive” personal automation
An “Arrive” personal automation

Something not working?

Send us the shortcut details and the error you're seeing and we'll take a look.

Contact us