Skip to Content
DocumentationPostman Collection

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
  • 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)
  • 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
  • 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

  1. Open Postman desktop app or web version
  2. Click Import in the top-left corner
  3. Select the downloaded JSON file or drag & drop it
  4. 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:

VariableDescriptionExample Value
BASE_URLAPI base URLhttps://relink.is
API_KEYYour API keyrlk_your_api_key_here
SMARTLINK_IDSmartlink ID for testingclp123abc456def

Setting Up Environment

  1. Create a new environment in Postman
  2. Add the variables listed above
  3. Set your actual values:
    • BASE_URL: https://relink.is
    • API_KEY: Your actual API key from the dashboard
    • SMARTLINK_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" }
POST {{BASE_URL}}/api/v1/smartlink Authorization: Bearer {{API_KEY}} Content-Type: application/json { "configuration": { "smartlinkName": "Test App", "smartlinkType": "App" } }
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_123

Expected Error Response:

{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "Invalid API key format" }, "timestamp": "2024-01-15T10:30:00.000Z" }

Usage Examples

The collection provides examples for all six smartlink types:

  1. App: Mobile app store redirections
  2. Url: URL shortener with password protection
  3. Landing: Custom landing pages with buttons
  4. QRTag: QR code pages with action presets
  5. DigiCard: Digital business cards
  6. 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

  1. Set up environment variables before running requests
  2. Start with authentication test to verify your API key
  3. Use the test scripts to validate responses automatically
  4. Test error scenarios to understand API behavior
  5. Save successful responses for reference and debugging

Workflow Recommendations

  1. Validate API Key → Test authentication
  2. Create Smartlinks → Test different types and configurations
  3. Get All Smartlinks → Verify creation and get IDs
  4. Update Smartlinks → Test partial updates with PATCH
  5. Get Analytics → Test analytics endpoints
  6. 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.