Bitly API: Create, Update, and Retrieve Links

This workflow automates Bitly link management using the Bitly API, supporting link creation, retrieval, and updates. Key nodes include Webhook Trigger (starts via POST), Input Validation (ensures valid action), Action Router (directs to create_link/get_link/update_link), Create Link Validation (checks longUrl), Link ID Validation (verifies linkId), Sanitize Link Data (sets defaults for longUrl/title/domain/group), Sanitize Update Data (prepares update fields), Create/Get/Update Bitly Link (performs operations), Success Response nodes (return results), and error nodes (General/Create/Link ID/Bitly API Error) for handling failures.\n\nSetup Requirements and Configuration: Install n8n from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow prompts or create a cloud account. Obtain a Bitly API token from dev.bitly.com: log in, navigate to 'API,' generate a Generic Access Token, and copy it. In n8n, import the JSON workflow. Configure Create/Get/Update Bitly Link nodes with the token under ‘Credentials’ > ‘Bitly API.’ Set Webhook Trigger path to ‘bitly-automation,’ configure for POST requests, and add header authentication with a secure key (e.g., ‘Authorization: Bearer your-key’). Ensure server resources support API calls. Verify token permissions for link creation and management.\n\nTesting and Deployment Steps: Test with Postman using a POST request to the Webhook URL. Example JSON: {'action': 'create_link', 'longUrl': 'https://example.com', 'title': 'Test Link'} or {'action': 'get_link', 'linkId': 'bitly.is/12345'} with an authentication header. Success responses return 200 with link data (id/link/long_url/title) or update details. Error nodes return 400 for invalid inputs (e.g., missing/invalid longUrl/linkId) or 500 for API failures. Check logs for errors like ‘Invalid token’ or ‘Link not found,’ and verify the token or input format. Activate workflow in n8n. Validate output: ensure link ID/link match for create/get/update. Debug persistent errors using n8n logs for token issues, rate limits, or network problems. Confirm longUrl uses a valid HTTP/HTTPS format.

$6.99

Workflow steps: 18

Integrated apps: webhook, if, switch

Bitly API: Create, Update, and Retrieve Links preview