Magic Link API Examples — Python, Java, C#, Go, PowerShell
Complete, ready-to-run example applications for the Magic Link API are available on GitHub:
mideye/mideye-magic-link-examples Single-file web apps in Python, Java, C#, and Go — passwordless authentication in minutes.
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.
| Language | Dependencies | Runtime |
|---|---|---|
| Python | Flask, Requests | Python 3.8+ |
| Java | None (stdlib only) | Java 17+ |
| C# / .NET | ASP.NET Core Minimal API | .NET 8+ |
| Go | None (stdlib only) | Go 1.21+ |
Quick test from the command line
Section titled “Quick test from the command line”You don’t need to clone the repository to test the API. Use cURL or PowerShell to send a request directly.
cURL (macOS / Linux)
Section titled “cURL (macOS / Linux)”curl -s -H "api-key: YOUR_API_KEY" \ "https://mideye.example.com/api/sfwa/auth?msisdn=%2B46701234567"PowerShell (Windows)
Section titled “PowerShell (Windows)”$headers = @{ "api-key" = "YOUR_API_KEY" }Invoke-RestMethod -Uri "https://mideye.example.com/api/sfwa/auth?msisdn=%2B46701234567" -Headers $headersResponses
Section titled “Responses”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).
What the example apps do
Section titled “What the example apps do”All four examples on GitHub follow the same pattern:
- Show a login form with a phone number input
- Call the Magic Link API with the phone number and API key
- Block while Mideye delivers push notification or SMS to the user
- Show the result — green for accepted, red for rejected/timeout/error
- Offer retry on failure
The API call is a single HTTP GET — no SDKs, no complex auth flows, no client-side JavaScript.