Postman Collection
Overview
The comprehensive Relink API Postman collection provides a complete testing environment for all API endpoints with GraphQL-like reactive body approach. This collection includes authentication, all CRUD operations, partial updates, analytics, and comprehensive error testing scenarios.
Key Features
- GraphQL-like Reactive Body: Single endpoint handles all smartlink types with reactive validation
- Type-Based Validation: Required fields automatically validated based on smartlink type
- Google Safe Browsing: All URLs are automatically checked for safety
- Comprehensive Coverage: Supports all smartlink types (App, URL, Landing, QRTag, DigiCard, TxtBin)
- Standardized Responses: Consistent response format across all endpoints
- Comprehensive Error Testing: Validation, authentication, authorization scenarios
Collection Structure
1. Authentication & Validation
- Validate API Key: Test API key validity and authentication
2. Smartlink Operations
- Get All Smartlinks: Retrieve all user smartlinks
- Get Smartlink by ID: Retrieve specific smartlink
- Create App Smartlink (Minimal & Full Configuration)
- Create URL Shortener
- Create Landing Page
- Create QR Tag (Basic & Restaurant Menu Example)
- Create Digital Card (Professional)
- Create Text Bin (Code Snippet)
3. PATCH - Update Smartlinks (Partial)
- Update Only App Store Link
- Update Only Open Graph
- Update Only Landing Buttons
- Update Smartlink Name and URL
- Update QR Tag Buttons
- Update Digital Card Contact Info
- Update Text Bin Content
4. DELETE Smartlinks
- Delete Smartlink (Soft delete)
5. Analytics
- Get Smartlink Analytics
- Get Analytics Summary
6. Error Testing & Validation
- Validation Error - Invalid URL Format
- Validation Error - Invalid Smartlink URL
- Validation Error - Reserved URL
- Authentication Error - Invalid API Key
- Authentication Error - Missing API Key
- Subscription Limit Error
- Resource Not Found Error
- Missing Required Fields Error
- Invalid Smartlink Type Error
- Conflicting smartlinkUrl Error
- Invalid ID in PATCH Error
Download & Installation
Download the Collection
Direct Download: Relink_API_Collection.postman_collection.json
Import to Postman
- Open Postman desktop app or web version
- Click Import in the top-left corner
- Select the downloaded JSON file or drag & drop it
- Click Import to add the collection to your workspace
Collection Information
{
"info": {
"name": "Relink API Collection",
"description": "Comprehensive API collection for Relink Customer API endpoints. This collection provides a GraphQL-like reactive body approach where the request body adapts to the smartlink type being created or updated.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
}
}Environment Setup
Required Variables
The collection uses the following environment variables:
| Variable | Description | Example Value |
|---|---|---|
BASE_URL | API base URL | https://relink.is |
API_KEY | Your API key | rlk_your_api_key_here |
SMARTLINK_ID | Smartlink ID for testing | clp123abc456def |
Setting Up Environment
- Create a new environment in Postman
- Add the variables listed above
- Set your actual values:
BASE_URL:https://relink.isAPI_KEY: Your actual API key from the dashboardSMARTLINK_ID: An existing smartlink ID (optional for testing)
Collection Features
Automatic Testing
The collection includes comprehensive test scripts that automatically validate:
- Response Format: Ensures standardized response structure
- Status Codes: Validates appropriate HTTP status codes
- Error Handling: Tests proper error response structure
- Analytics Data: Validates analytics response structure
- Content-Type: Ensures JSON responses
- Response Time: Checks acceptable response times
Test Script Example
// Comprehensive test script for Relink API response validation
pm.test('Response has standardized format', function () {
const response = pm.response.json();
pm.expect(response).to.have.property('success');
pm.expect(response).to.have.property('timestamp');
if (response.success) {
pm.expect(response).to.have.property('message');
pm.expect(response).to.have.property('data');
} else {
pm.expect(response).to.have.property('error');
pm.expect(response.error).to.have.property('code');
pm.expect(response.error).to.have.property('message');
}
});
pm.test('Status code is valid', function () {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 400, 401, 403, 404, 409, 500]);
});Example Requests
Authentication Test
GET {{BASE_URL}}/api/v1/validate
Authorization: Bearer {{API_KEY}}Expected Response:
{
"success": true,
"message": "API key is valid",
"data": null,
"timestamp": "2024-01-15T10:30:00.000Z"
}Create App Smartlink (Minimal)
POST {{BASE_URL}}/api/v1/smartlink
Authorization: Bearer {{API_KEY}}
Content-Type: application/json
{
"configuration": {
"smartlinkName": "Test App",
"smartlinkType": "App"
}
}Create App Smartlink (Full Configuration)
POST {{BASE_URL}}/api/v1/smartlink
Authorization: Bearer {{API_KEY}}
Content-Type: application/json
{
"configuration": {
"smartlinkName": "Full App",
"smartlinkUrl": "fullapp",
"smartlinkType": "App",
"appStoreLink": "https://apps.apple.com/app/fullapp",
"googlePlayLink": "https://play.google.com/store/apps/details?id=fullapp",
"fallBackLink": "https://fullapp.com"
},
"openGraph": {
"title": "Full App",
"description": "A comprehensive test app",
"imageUrl": "https://fullapp.com/og.jpg"
}
}Partial Update (PATCH)
PATCH {{BASE_URL}}/api/v1/smartlink
Authorization: Bearer {{API_KEY}}
Content-Type: application/json
{
"id": "{{SMARTLINK_ID}}",
"configuration": {
"appStoreLink": "https://apps.apple.com/app/myapp"
}
}Get Analytics
GET {{BASE_URL}}/api/v1/smartlink/analytics?id={{SMARTLINK_ID}}
Authorization: Bearer {{API_KEY}}Error Testing
The collection includes comprehensive error testing scenarios:
Validation Errors
Invalid URL Format:
{
"configuration": {
"smartlinkName": "Test App",
"smartlinkType": "App"
},
"openGraph": {
"title": "Test",
"imageUrl": "invalid-url"
}
}Expected Error Response:
{
"success": false,
"error": {
"code": "VALIDATION_FAILED",
"message": "Request validation failed",
"details": [
{
"path": "openGraph.imageUrl",
"message": "Invalid URL format"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z"
}Authentication Errors
Invalid API Key:
GET {{BASE_URL}}/api/v1/smartlink
Authorization: Bearer invalid_api_key_123Expected Error Response:
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key format"
},
"timestamp": "2024-01-15T10:30:00.000Z"
}Usage Examples
Testing All Smartlink Types
The collection provides examples for all six smartlink types:
- App: Mobile app store redirections
- Url: URL shortener with password protection
- Landing: Custom landing pages with buttons
- QRTag: QR code pages with action presets
- DigiCard: Digital business cards
- TxtBin: Text sharing with formatting
Restaurant QR Menu Example
{
"configuration": {
"smartlinkName": "Restaurant QR Menu",
"smartlinkUrl": "menuqr",
"smartlinkType": "QRTag"
},
"qrTag": {
"title": "Our Menu",
"description": "Scan to view our delicious menu",
"logoLink": "https://restaurant.com/logo.png",
"themeColor": "#ff6b35"
},
"qrTagButtons": [
{
"title": "View Menu",
"link": "https://restaurant.com/menu",
"preset": "restaurant"
},
{
"title": "Order Online",
"link": "https://restaurant.com/order",
"preset": "delivery"
},
{
"title": "Call Us",
"link": "tel:+1234567890",
"preset": "phone"
},
{
"title": "Reserve Table",
"link": "https://restaurant.com/reservations",
"preset": "calendar"
}
],
"openGraph": {
"title": "Restaurant Menu",
"description": "Browse our menu and order online",
"imageUrl": "https://restaurant.com/menu-image.jpg"
}
}Tips for Using the Collection
Best Practices
- Set up environment variables before running requests
- Start with authentication test to verify your API key
- Use the test scripts to validate responses automatically
- Test error scenarios to understand API behavior
- Save successful responses for reference and debugging
Workflow Recommendations
- Validate API Key → Test authentication
- Create Smartlinks → Test different types and configurations
- Get All Smartlinks → Verify creation and get IDs
- Update Smartlinks → Test partial updates with PATCH
- Get Analytics → Test analytics endpoints
- Error Testing → Validate error handling
Troubleshooting
Common Issues:
- 401 Unauthorized: Check your API key in environment variables
- 403 Forbidden: Verify your subscription plan supports API access
- Validation Errors: Review the request body structure for the specific smartlink type
- Environment Variables: Ensure all required variables are set correctly
Collection Maintenance
The collection is regularly updated to reflect the latest API changes:
- New endpoints are added as they become available
- Request examples are updated with new features
- Error scenarios are expanded for comprehensive testing
- Test scripts are enhanced for better validation
For the latest version, always download from the documentation or check the /public/ directory in the repository.