Skip to content

Magic Link API Examples — Python, Java, C#, Go, PowerShell

Complete, ready-to-run example applications for the Magic Link API are available on GitHub:

Each example is a complete, single-file web application — enter a phone number, Mideye sends a push notification or SMS magic link, and the user taps Accept or Reject.

LanguageDependenciesRuntime
PythonFlask, RequestsPython 3.8+
JavaNone (stdlib only)Java 17+
C# / .NETASP.NET Core Minimal API.NET 8+
GoNone (stdlib only)Go 1.21+

You don’t need to clone the repository to test the API. Use cURL or PowerShell to send a request directly.

Terminal window
curl -s -H "api-key: YOUR_API_KEY" \
"https://mideye.example.com/api/sfwa/auth?msisdn=%2B46701234567"
Terminal window
$headers = @{ "api-key" = "YOUR_API_KEY" }
Invoke-RestMethod -Uri "https://mideye.example.com/api/sfwa/auth?msisdn=%2B46701234567" -Headers $headers

The call blocks until the user responds on their phone or the timeout expires. The three standard outcomes:

{"code":"TOUCH_ACCEPTED"}
{"code":"TOUCH_REJECTED"}
{"code":"USER_NOT_RESPONDED"}

If your server uses a self-signed certificate, add -k to cURL or -SkipCertificateCheck to PowerShell (testing only).


All four examples on GitHub follow the same pattern:

  1. Show a login form with a phone number input
  2. Call the Magic Link API with the phone number and API key
  3. Block while Mideye delivers push notification or SMS to the user
  4. Show the result — green for accepted, red for rejected/timeout/error
  5. Offer retry on failure

The API call is a single HTTP GET — no SDKs, no complex auth flows, no client-side JavaScript.