← FAQ & Tips

Automating with Tasker

Use Tasker on Android to check in from a home screen widget, check in automatically by location or Wi-Fi, and log quick notes.

On iPhone? See the Shortcuts 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. "Android Tasker") 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. "Check in here" task

A task that grabs your current location and sends it to When and What. Run it from a home screen widget or a Quick Settings tile.

1
In Tasker, open the Tasks tab, tap + and name the task "Check in here".
2
Add Location › Get Location v2. This sets %gl_latitude and %gl_longitude.
3
Add Net › HTTP Request and fill it in like this:
Method:   POST
URL:      https://whenandwhat.app/api/locations/checkins/pending
Headers:  Authorization:Bearer YOUR_TOKEN
          Accept:application/json
          Content-Type:application/json
Body:     {"latitude": %gl_latitude, "longitude": %gl_longitude}
4
Optionally add Alert › Flash with the text "Checked in 📍".
5
Long-press your home screen, add a Tasker › Task Shortcut widget and pick the task.

Tip: If a check-in doesn't appear, run the task from inside Tasker and check %http_response_code — 201 means success, 401 means the token is wrong, and 422 means the body is missing a field.

Screenshot coming soon
The “Check in here” task

2. Check in automatically by place or Wi-Fi

Attach the task to a profile so it runs on its own whenever you arrive at the gym, the office or anywhere else you go regularly.

1
Open the Profiles tab and tap +.
2
Choose Location and drop a pin with a sensible radius — or choose State › Net › Wifi Connected and enter the network name, which is more reliable indoors and easier on the battery.
3
When asked for an Enter task, pick Check in here.
4
To label the check-in, make a copy of the task for that place and add a name to the body:
{"latitude": %gl_latitude, "longitude": %gl_longitude, "name": "Gym"}

Tip: Make sure Tasker is excluded from battery optimisation (Settings › Apps › Tasker › Battery › Unrestricted), otherwise Android may stop profiles from firing in the background.

Screenshot coming soon
A location profile linked to the task

Something not working?

Send us your task setup and the response code you're seeing and we'll take a look.

Contact us