인증
모든 API 호출은 X-API-Key 헤더로 인증합니다. 대시보드에서 앱을 등록하면 API Key가 발급됩니다.
요청 헤더
X-API-Key: <your_api_key>Dashboard 사용자는 JWT 기반 세션 인증을 사용합니다.
Authorization: Bearer <JWT>Base URL
모든 API 요청의 기본 URL입니다.
https://vialink.app링크 생성
새로운 딥링크를 생성합니다.
요청 파라미터
요청 예시
POST /api/links
Content-Type: application/json
X-API-Key: <your_api_key>
{
"tenantId": "cxxx...",
"deeplinkPath": "/product/12345",
"deeplinkData": { "product_id": "12345" },
"campaign": "summer_sale",
"channel": "email",
"feature": "product_share",
"ogTitle": "여름 세일 특가",
"ogDescription": "지금 확인하세요!",
"ogImageUrl": "https://cdn.example.com/promo.jpg",
"iosUrl": "https://apps.apple.com/app/id123456",
"androidUrl": "https://play.google.com/store/apps/...",
"webUrl": "https://www.example.com/product/12345",
"expiresAt": "2026-12-31T23:59:59Z"
}응답 (201 Created)
{
"id": 1,
"shortCode": "aB3xK",
"shortUrl": "https://vialink.app/{your-slug}/aB3xK",
"deeplinkPath": "/product/12345",
"createdAt": "2026-04-06T12:00:00Z"
}링크 조회
특정 링크의 전체 정보를 조회합니다.
경로 파라미터
응답 (200 OK)
{
"id": 1,
"shortCode": "aB3xK",
"shortUrl": "https://vialink.app/{your-slug}/aB3xK",
"tenantId": "cxxx...",
"deeplinkPath": "/product/12345",
"deeplinkData": { "product_id": "12345" },
"campaign": "summer_sale",
"channel": "email",
"feature": "product_share",
"ogTitle": "여름 세일 특가",
"ogDescription": "지금 확인하세요!",
"ogImageUrl": "https://cdn.example.com/promo.jpg",
"iosUrl": "https://apps.apple.com/app/id123456",
"androidUrl": "https://play.google.com/store/apps/...",
"webUrl": "https://www.example.com/product/12345",
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2026-04-06T12:00:00Z",
"updatedAt": "2026-04-06T12:00:00Z"
}링크 수정
기존 링크의 정보를 수정합니다. 변경할 필드만 전달합니다.
요청 파라미터
요청 예시
PUT /api/links/1
Content-Type: application/json
X-API-Key: <your_api_key>
{
"ogTitle": "업데이트된 제목",
"webUrl": "https://www.example.com/new-page"
}응답 (200 OK)
수정된 전체 링크 객체가 반환됩니다.
링크 삭제
링크를 삭제합니다 (소프트 삭제). 삭제된 링크의 Short URL은 더 이상 작동하지 않습니다.
경로 파라미터
응답 (200 OK)
{
"success": true
}링크 목록
생성된 링크 목록을 조회합니다.
쿼리 파라미터
응답 (200 OK)
{
"links": [
{
"id": 1,
"shortCode": "aB3xK",
"shortUrl": "https://vialink.app/{your-slug}/aB3xK",
"deeplinkPath": "/product/12345",
"createdAt": "2026-04-06T12:00:00Z"
}
],
"total": 50
}설치
Gradle에 의존성을 추가합니다.
// build.gradle.kts (app)
dependencies {
implementation("com.vialink:sdk:1.0.0")
}초기화
Application.onCreate()에서 SDK를 초기화합니다.
// Application.kt
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
ViaLinkSDK.init(this, "YOUR_API_KEY")
}
}딥링크 처리
딥링크 콜백을 등록하고, Activity에서 App Link Intent를 처리합니다.
// 딥링크 콜백 등록
ViaLinkSDK.onDeepLink { data ->
Log.d("ViaLink", "경로: ${data.path}")
Log.d("ViaLink", "파라미터: ${data.params}")
}
// 디퍼드 딥링크 콜백 (첫 설치 후 매칭)
ViaLinkSDK.onDeferredDeepLink { data ->
Log.d("ViaLink", "디퍼드: ${data.path}")
}
// Activity에서 App Link Intent 처리
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ViaLinkSDK.handleIntent(intent)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
ViaLinkSDK.handleIntent(intent)
}
}이벤트 추적
커스텀 이벤트를 추적합니다. SDK가 30초마다 배치로 전송합니다.
// 구매 완료
ViaLinkSDK.track("purchase", mapOf(
"product_id" to "12345",
"revenue" to 29900,
"currency" to "KRW"
))
// 회원가입
ViaLinkSDK.track("signup")
// 장바구니 추가
ViaLinkSDK.track("add_to_cart", mapOf("product_id" to "12345"))링크 생성
앱 내에서 딥링크를 생성하여 공유할 수 있습니다.
lifecycleScope.launch {
val result = ViaLinkSDK.createLink(
path = "/product/12345",
data = mapOf("promo_code" to "FRIEND_SHARE"),
campaign = "referral"
)
result.onSuccess { shortUrl ->
// shortUrl: "https://vialink.app/{your-slug}/xYz12"
val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, shortUrl)
type = "text/plain"
}
startActivity(Intent.createChooser(sendIntent, "공유하기"))
}
}App Links 설정
AndroidManifest.xml에 App Links Intent Filter를 추가합니다.
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="vialink.app"
android:pathPrefix="/{your-slug}/" />
</intent-filter>
</activity>설치
Xcode에서 Swift Package를 추가합니다.
Xcode > File > Add Package Dependencies
URL: https://github.com/aresjoydev/vialink-ios-sdk초기화
AppDelegate 또는 SwiftUI App의 init에서 SDK를 초기화합니다.
import ViaLinkCore
// AppDelegate
func application(_ application: UIApplication,
didFinishLaunchingWithOptions ...) -> Bool {
ViaLinkSDK.shared.configure(apiKey: "YOUR_API_KEY")
return true
}
// 또는 SwiftUI App
@main
struct MyApp: App {
init() {
ViaLinkSDK.shared.configure(apiKey: "YOUR_API_KEY")
}
var body: some Scene {
WindowGroup {
ContentView()
.onOpenURL { url in
ViaLinkSDK.shared.handleURL(url)
}
}
}
}딥링크 처리
딥링크 콜백을 등록하고, SceneDelegate에서 Universal Link를 처리합니다.
// 딥링크 콜백 등록
ViaLinkSDK.shared.onDeepLink { data in
print("경로: \(data.path)")
print("파라미터: \(data.params)")
}
// 디퍼드 딥링크 콜백
ViaLinkSDK.shared.onDeferredDeepLink { data in
print("디퍼드: \(data.path)")
}
// SceneDelegate에서 Universal Link 처리
func scene(_ scene: UIScene,
continue userActivity: NSUserActivity) {
ViaLinkSDK.shared.handleUniversalLink(userActivity)
}이벤트 추적
커스텀 이벤트를 추적합니다.
// 구매 완료
ViaLinkSDK.shared.track("purchase", data: [
"product_id": "12345",
"revenue": "29900",
"currency": "KRW"
])
// 회원가입
ViaLinkSDK.shared.track("signup")링크 생성
앱 내에서 딥링크를 생성합니다.
let shortUrl = try await ViaLinkSDK.shared.createLink(
path: "/product/12345",
data: ["promo_code": "FRIEND_SHARE"],
campaign: "referral"
)
// shortUrl: "https://vialink.app/{your-slug}/xYz12"
let activityVC = UIActivityViewController(
activityItems: [shortUrl],
applicationActivities: nil
)
present(activityVC, animated: true)Universal Link 설정
Xcode에서 Associated Domains를 설정합니다.
1. Xcode > Target > Signing & Capabilities
2. + Capability > Associated Domains
3. 도메인 추가: applinks:vialink.app설치
npm 또는 CDN으로 설치합니다.
npm install vialink-web-sdk초기화
SDK를 초기화합니다. 페이지 이탈 시에도 이벤트가 전송됩니다.
import { ViaLinkWebSDK } from 'vialink-web-sdk';
const sdk = ViaLinkWebSDK.init({
apiKey: 'YOUR_API_KEY'
});딥링크 파라미터 추출
현재 URL에서 딥링크 파라미터를 추출합니다.
// 현재 URL에서 딥링크 데이터 추출
const data = sdk.getDeepLinkData();
if (data) {
console.log('경로:', data.path);
console.log('파라미터:', data.params);
console.log('shortCode:', data.shortCode);
}
// 정적 메서드로 임의 URL 파싱
const parsed = ViaLinkWebSDK.parseDeepLinkFromURL(
'https://vialink.app/{your-slug}/xYz12?ref=share'
);이벤트 추적
커스텀 이벤트를 추적합니다. 30초 배치 전송 + 페이지 이탈 시 sendBeacon으로 전송합니다.
// 구매 완료
sdk.track('purchase', {
product_id: '12345',
revenue: 29900,
currency: 'KRW'
});
// 즉시 전송
await sdk.flush();링크 생성
웹에서 딥링크를 생성합니다.
const shortUrl = await sdk.createLink(
'/product/12345',
{ promo_code: 'FRIEND_SHARE' },
'referral'
);
console.log(shortUrl); // "https://vialink.app/{your-slug}/xYz12"설치
npm 또는 yarn으로 설치합니다.
npm install vialink-react-native-sdk
# 또는
yarn add vialink-react-native-sdk초기화
App.tsx 최상위에서 SDK를 초기화합니다.
import { ViaLinkSDK } from 'vialink-react-native-sdk';
// App.tsx
function App() {
useEffect(() => {
ViaLinkSDK.shared.configure('YOUR_API_KEY');
return () => {
ViaLinkSDK.shared.destroy();
};
}, []);
return <Navigation />;
}딥링크 처리
딥링크 콜백을 등록합니다. Linking API 이벤트를 자동 처리합니다.
// 딥링크 콜백 등록
ViaLinkSDK.shared.onDeepLink((data) => {
console.log('경로:', data.path);
console.log('파라미터:', data.params);
navigation.navigate(data.path, data.params);
});
// 디퍼드 딥링크 콜백 (첫 설치 후 매칭)
ViaLinkSDK.shared.onDeferredDeepLink((data) => {
console.log('디퍼드:', data.path);
navigation.navigate(data.path, data.params);
});
// 외부 URL 수동 처리 (필요 시)
ViaLinkSDK.shared.handleURL('https://vialink.app/{your-slug}/xYz12');이벤트 추적
커스텀 이벤트를 추적합니다.
// 구매 완료
ViaLinkSDK.shared.track('purchase', {
product_id: '12345',
revenue: 29900,
currency: 'KRW'
});
// 회원가입
ViaLinkSDK.shared.track('signup');링크 생성
앱 내에서 딥링크를 생성하여 공유합니다.
const shortUrl = await ViaLinkSDK.shared.createLink(
'/product/12345',
{ promo_code: 'FRIEND_SHARE' },
'referral'
);
await Share.share({ message: shortUrl });플랫폼 설정
iOS와 Android에 각각 딥링크 설정이 필요합니다.
// app.json (Expo)
{
"expo": {
"ios": {
"associatedDomains": ["applinks:vialink.app"]
},
"android": {
"intentFilters": [{
"action": "VIEW",
"autoVerify": true,
"data": [{
"scheme": "https",
"host": "vialink.app",
"pathPrefix": "/{your-slug}/"
}],
"category": ["BROWSABLE", "DEFAULT"]
}]
}
}
}설치
UPM으로 패키지를 추가합니다.
Window > Package Manager > + > Add package from git URL:
https://github.com/aresjoydev/vialink-unity-sdk.git초기화
첫 씬에 ViaLinkSDK 프리팹을 배치하고 초기화합니다.
using ViaLink;
public class GameManager : MonoBehaviour
{
void Start()
{
ViaLinkSDK.Instance.Initialize("YOUR_API_KEY");
}
}딥링크 처리
이벤트를 구독하여 딥링크를 처리합니다.
// 딥링크 콜백
ViaLinkSDK.Instance.OnDeepLink += (data) =>
{
Debug.Log($"경로: {data.Path}");
Debug.Log($"파라미터: {data.Params}");
SceneManager.LoadScene(data.Path);
};
// 디퍼드 딥링크 콜백 (첫 설치 후 매칭)
ViaLinkSDK.Instance.OnDeferredDeepLink += (data) =>
{
Debug.Log($"디퍼드 딥링크: {data.Path}");
};이벤트 추적
커스텀 이벤트를 추적합니다.
// 인앱 구매
ViaLinkSDK.Instance.TrackEvent("purchase",
new Dictionary<string, object>
{
{ "product_id", "gem_pack_100" },
{ "revenue", 4900 },
{ "currency", "KRW" }
});
// 레벨 클리어
ViaLinkSDK.Instance.TrackEvent("level_clear",
new Dictionary<string, object>
{
{ "level", 10 }
});링크 생성
게임 내에서 초대 링크를 생성합니다.
ViaLinkSDK.Instance.CreateLink(
path: "/invite",
data: new Dictionary<string, object>
{
{ "inviter_id", PlayerId },
{ "reward", "gem_50" }
},
campaign: "friend_invite",
onSuccess: (shortUrl) =>
{
// shortUrl: "https://vialink.app/{your-slug}/xYz12"
GUIUtility.systemCopyBuffer = shortUrl;
ShowToast("초대 링크가 복사되었습니다!");
},
onError: (error) =>
{
Debug.LogError($"링크 생성 실패: {error}");
}
);설치
pubspec.yaml에 의존성을 추가합니다.
flutter pub add vialink_flutter_plugin초기화
앱 시작 시 SDK를 초기화합니다.
import 'package:vialink_flutter_plugin/vialink_flutter_plugin.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ViaLinkSDK.instance.configure(apiKey: 'YOUR_API_KEY');
runApp(const MyApp());
}딥링크 처리
SDK가 딥링크를 자동 수신합니다. 콜백만 등록하면 됩니다.
// 딥링크 콜백 (App Links/Universal Links로 앱이 열릴 때 자동 호출)
ViaLinkSDK.instance.onDeepLink((data) {
print('경로: ${data.path}');
print('파라미터: ${data.params}');
Navigator.pushNamed(context, data.path,
arguments: data.params);
});
// 디퍼드 딥링크 콜백 (앱 첫 설치 후 실행 시 자동 호출)
ViaLinkSDK.instance.onDeferredDeepLink((data) {
print('디퍼드: ${data.path}');
Navigator.pushNamed(context, data.path,
arguments: data.params);
});이벤트 추적
커스텀 이벤트를 추적합니다.
// 구매 완료
ViaLinkSDK.instance.track('purchase', data: {
'product_id': '12345',
'revenue': 29900,
'currency': 'KRW',
});
// 회원가입
ViaLinkSDK.instance.track('signup');링크 생성
앱 내에서 딥링크를 생성합니다.
final shortUrl = await ViaLinkSDK.instance.createLink(
path: '/product/12345',
data: {'promo_code': 'FRIEND_SHARE'},
campaign: 'referral',
);
// shortUrl: "https://vialink.app/{your-slug}/xYz12"
await Share.share(shortUrl);플랫폼 설정
iOS와 Android에 각각 딥링크 설정이 필요합니다.
# iOS: ios/Runner/Runner.entitlements
# Associated Domains 추가:
# applinks:vialink.app
# Android: android/app/src/main/AndroidManifest.xml
# <intent-filter android:autoVerify="true">
# <action android:name="android.intent.action.VIEW" />
# <category android:name="android.intent.category.DEFAULT" />
# <category android:name="android.intent.category.BROWSABLE" />
# <data
# android:scheme="https"
# android:host="vialink.app"
# android:pathPrefix="/{your-slug}/" />
# </intent-filter>