Quick Start
Get your first Tolinku API call working in under 5 minutes.
Prerequisites
Section titled “Prerequisites”- A Tolinku account (sign up free)
- An Appspace with at least one route configured
- An API key (create one in API Keys in the sidebar)
1. Get your API key
Section titled “1. Get your API key”Go to API Keys in your Appspace dashboard and create a key:
- Publishable key (
tolk_pub_): Use in client-side code (browser, mobile app) - Secret key (
tolk_sec_): Use in server-side code only
For this quick start, create a secret key so you can access all endpoints.
2. Make your first request
Section titled “2. Make your first request”Fetch your app’s analytics overview:
curl -H "X-API-Key: tolk_sec_your_secret_key" \ https://your-app.tolinku.com/v1/api/analytics/overviewconst res = await fetch('https://your-app.tolinku.com/v1/api/analytics/overview', { headers: { 'X-API-Key': 'tolk_sec_your_secret_key' }});const data = await res.json();console.log(data);import requests
res = requests.get( 'https://your-app.tolinku.com/v1/api/analytics/overview', headers={'X-API-Key': 'tolk_sec_your_secret_key'})print(res.json())Response:
{ "total_clicks": 10041, "total_installs": 1401, "conversion_rate": 14.0, "days": 30}3. Track a custom event
Section titled “3. Track a custom event”Send a custom event from your app or server:
curl -X POST https://your-app.tolinku.com/v1/api/analytics/track \ -H "X-API-Key: tolk_pub_your_publishable_key" \ -H "Content-Type: application/json" \ -d '{"event_type": "custom.signup_complete", "properties": {"user_id": "user_123"}}'Response:
{ "ok": true }4. Install an SDK
Section titled “4. Install an SDK”For client-side integration, install the SDK for your platform:
npm install @tolinku/web-sdkimport { Tolinku } from '@tolinku/web-sdk';
const tolinku = new Tolinku({ apiKey: 'tolk_pub_your_key' });tolinku.track('custom.page_view');Add via Xcode: File > Add Package Dependencies > https://github.com/tolinku/ios-sdk
import TolinkuSDK
let tolinku = try Tolinku.configure(apiKey: "tolk_pub_your_key")tolinku.track("custom.app_open")implementation("com.tolinku:sdk:0.5.0")import com.tolinku.sdk.Tolinku
Tolinku.configure(apiKey = "tolk_pub_your_key", context = this)Tolinku.track("custom.app_open")5. Claim the deferred link on first launch
Section titled “5. Claim the deferred link on first launch”If someone taps one of your links, installs the app, and opens it, the app has to ask which link brought them in. That is one call, and the same call on every platform:
const link = await tolinku.deferred.claimDeferredLink({ appspaceId: '64f0a1b2c3d4e5f60718',});if (link) { // Route to link.deep_link_path}if let link = try await Tolinku.shared?.deferred.claimDeferredLink( appspaceId: "64f0a1b2c3d4e5f60718") { // Route to link.deepLinkPath}val link = Tolinku.deferred.claimDeferredLink( appspaceId = "64f0a1b2c3d4e5f60718", context = applicationContext,)link?.deepLinkPath?.let { /* route to it */ }Call it once, on the first launch after install. Skipping it is the most common reason a working setup reports no installs: the links resolve, the clicks are counted, and nothing ever connects an install back to the click that caused it.
See deferred deep linking for how the matching works and why it must happen on first launch.
Next steps
Section titled “Next steps”- API Reference: Full endpoint documentation
- SDK Guides: Detailed SDK setup for each platform
- Universal Links: Set up iOS deep linking
- App Links: Set up Android deep linking
- Ecommerce Analytics: Track purchases, revenue, and conversion funnels