Request
Your API key: b2co_your_api_key
Custom short code for the link. If not provided, a random code will be
generated. Must be unique within your project and contain only alphanumeric
characters, hyphens, and underscores (3-50 characters).
Link Codes are Unique : Each link code must be unique within your project.
Use the Check Code Availability endpoint to
verify if a code is available before creating a link.
Optional display name for the link to help with organization and
identification.
Link configuration object containing destination URL and platform-specific
settings.
The destination URL where users will be redirected when they click the dynamic
link.
ID of a saved iOS mobile app to use for this link. When provided, the link will use the saved app’s configuration instead of manual iOS settings.
ID of a saved Android mobile app to use for this link. When provided, the link will use the saved app’s configuration instead of manual Android settings.
Android-specific configuration for deep linking and app store fallbacks.
Android app package name (e.g., com.yourapp.android).
payload.android.store_fallback
Play Store URL to redirect Android users without the app.
payload.android.min_version
Minimum app version required to handle the deep link.
Whether to save this Android configuration as a reusable mobile app.
Name for the saved mobile app (required if saveApp is true).
iOS-specific configuration for deep linking and App Store fallbacks.
iOS app bundle identifier (e.g., com.yourapp.ios).
payload.ios.app_store_fallback
App Store URL to redirect iOS users without the app.
App Store ID for the iOS app.
Minimum app version required to handle the deep link.
Whether to save this iOS configuration as a reusable mobile app.
Name for the saved mobile app (required if saveApp is true).
Social media preview configuration for rich link sharing.
Title displayed in social media previews.
payload.social.description
Description displayed in social media previews.
Image URL displayed in social media previews.
UTM campaign parameters for analytics tracking.
payload.campaign.utm_source
Campaign source parameter.
payload.campaign.utm_medium
Campaign medium parameter.
payload.campaign.utm_campaign
Campaign name parameter.
payload.campaign.utm_term
Campaign term parameter (for paid search keywords).
payload.campaign.utm_content
Campaign content parameter (for A/B testing and content-targeted ads).
Fallback URL for desktop users.
Optional expiration date in ISO 8601 format. Link will become inactive after
this date.
Response
Indicates if the request was successful
Unique identifier for the link
The unique short code for the link
The complete short URL that can be shared
The original destination URL
Current status of the link (ACTIVE, PAUSED, etc.)
ISO 8601 timestamp when the link was created
ISO 8601 timestamp when the link expires (if set)
Number of times the link has been clicked
curl -X POST "https://api.bit2connect.com/1.0/links" \
-H "X-API-KEY: b2co_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"code": "summer-sale",
"name": "Summer Sale Campaign",
"payload": {
"link": "https://yourapp.com/products/summer-sale",
"android": {
"package": "com.yourapp.android",
"store_fallback": "https://play.google.com/store/apps/details?id=com.yourapp.android"
},
"ios": {
"bundleId": "com.yourapp.ios",
"app_store_fallback": "https://apps.apple.com/app/yourapp/id123456789"
},
"social": {
"title": "Summer Sale - Up to 50% Off!",
"description": "Don' \' 't miss our biggest sale of the year. Shop now!",
"image": "https://yourapp.com/images/summer-sale.jpg"
},
"campaign": {
"utm_source": "api",
"utm_medium": "dynamic_link",
"utm_campaign": "summer_sale_2024"
}
},
"expiresAt": "2024-12-31T23:59:59Z"
}'
Success Response
Error Response
{
"success" : true ,
"data" : {
"id" : "clp123abc456" ,
"code" : "summer-sale" ,
"shortUrl" : "https://b2co.link/summer-sale" ,
"originalUrl" : "https://yourapp.com/products/summer-sale" ,
"name" : "Summer Sale Campaign" ,
"status" : "ACTIVE" ,
"qrCode" : "https://b2co.link/summer-sale/qr" ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"expiresAt" : "2024-12-31T23:59:59Z" ,
"clickCount" : 0
}
}
Error Codes
Invalid request payload or parameters
The specified code is already in use
API key is missing or invalid
Too many requests, please try again later
Active subscription required to create links