{"_id":"57cd6946873de50e00724a18","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"category":"577d1b8b74aea422007230c8","githubsync":"","next":{"description":"","pages":[]},"order":0,"parentDoc":null,"slug":"api-custom-url-shortener","type":"basic","user":"56b22f582d96461700599230","excerpt":"","hidden":false,"isReference":false,"link_external":false,"title":"API for custom short URLs - Code snippet","version":"577d1b8b74aea422007230c7","link_url":"","project":"577d1b8b74aea422007230c4","__v":2,"body":"Copy-and-paste in your application/script to create a custom short URL:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n  url: \\\"https://api.rebrandly.com/v1/links\\\",\\n  type: \\\"post\\\",\\n  data: JSON.stringify({\\n    \\t\\t\\\"destination\\\" : \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\"\\n    \\t, \\\"domain\\\": { \\\"fullName\\\": \\\"rebrand.ly\\\" }\\n    //, \\\"slashtag\\\": \\\"A_NEW_SLASHTAG\\\"\\n    //, \\\"title\\\": \\\"Rebrandly YouTube channel\\\"\\n  }),\\n  headers: {\\n    \\\"Content-Type\\\": \\\"application/json\\\",\\n    \\\"apikey\\\": \\\"YOUR_API_KEY\\\"\\n  },\\n  dataType: \\\"json\\\",\\n  success: function (link) {\\n\\t\\tconsole.log(\\\"Long URL was \\\"+link.destination+\\\", short URL is \\\"+link.shortUrl);\\n\\t}\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    },\n    {\n      \"code\": \"var request = require(\\\"request\\\");\\n[...]\\nrequest({\\n    uri: \\\"https://api.rebrandly.com/v1/links\\\",\\n    method: \\\"POST\\\",\\n    body: JSON.stringify({\\n      \\t\\tdestination: \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\"\\n\\t\\t\\t\\t, domain: { fullName: \\\"rebrand.ly\\\" }\\n      //, slashtag: \\\"A_NEW_SLASHTAG\\\"\\n      //, title: \\\"Rebrandly YouTube channel\\\"\\n    }),\\n    headers: {\\n      \\\"Content-Type\\\": \\\"application/json\\\",\\n      \\\"apikey\\\": \\\"YOUR_API_KEY\\\"\\n    }\\n\\t}, function(err, response, body) {\\n  \\tvar link = JSON.parse(body);\\n  \\tconsole.log(\\\"Long URL was \\\"+link.destination+\\\", short URL is \\\"+link.shortUrl);\\n\\t}\",\n      \"language\": \"javascript\",\n      \"name\": \"NodeJS\"\n    },\n    {\n      \"code\": \"<?php\\n  [...]\\n  $domain_data[\\\"fullName\\\"] = \\\"rebrand.ly\\\";\\n\\t$post_data[\\\"destination\\\"] = \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\";\\n\\t$post_data[\\\"domain\\\"] = $domain_data;\\n\\t//$post_data[\\\"slashtag\\\"] = \\\"A_NEW_SLASHTAG\\\";\\n\\t//$post_data[\\\"title\\\"] = \\\"Rebrandly YouTube channel\\\";\\n  $ch = curl_init(\\\"https://api.rebrandly.com/v1/links\\\");\\n  curl_setopt($ch, CURLOPT_HTTPHEADER, array(\\n      \\\"apikey: YOUR_API_KEY\\\",\\n      \\\"Content-Type: application/json\\\"\\n  ));\\n  curl_setopt($ch, CURLOPT_POST, 1);\\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));\\n  $result = curl_exec($ch);\\n  curl_close($ch);\\n  $response = json_decode($result, true);\\n  print \\\"Short URL is: \\\" . $response[\\\"shortUrl\\\"];\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"import requests\\nimport json\\nr = requests.post(\\\"https://api.rebrandly.com/v1/links\\\", \\n\\tdata = json.dumps({\\n\\t\\t    \\\"destination\\\": \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\"\\n\\t\\t  , \\\"domain\\\": { \\\"fullName\\\": \\\"rebrand.ly\\\" }\\n\\t\\t# , \\\"slashtag\\\": \\\"A_NEW_SLASHTAG\\\"\\n\\t\\t# , \\\"title\\\": \\\"Rebrandly YouTube channel\\\"\\n\\t}),\\n\\theaders={\\n    \\\"Content-type\\\": \\\"application/json\\\",\\n    \\\"apikey\\\": \\\"YOUR_API_KEY\\\"\\n  })\\n\\nif (r.status_code == requests.codes.ok):\\n\\tlink = r.json()\\n\\tprint(\\\"Long URL was %s, short URL is %s\\\" % (link[\\\"destination\\\"], link[\\\"shortUrl\\\"]))\",\n      \"language\": \"python\",\n      \"name\": \"Python\"\n    },\n    {\n      \"code\": \"POST https://api.rebrandly.com/v1/links\\nContent-Type: application/json\\napikey: YOUR_API_KEY\\n\\n{\\\"destination\\\": \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\", \\\"domain\\\": { \\\"fullName\\\": \\\"rebrand.ly\\\"}}\",\n      \"language\": \"http\"\n    },\n    {\n      \"code\": \"curl https://api.rebrandly.com/v1/links \\\\\\n  -H 'Content-Type: application/json' \\\\\\n  -H 'apikey: YOUR_API_KEY'\\n  -d '{\\\"destination\\\": \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\",\\\"domain\\\":{\\\"fullName\\\":\\\"rebrand.ly\\\"}}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","createdAt":"2016-09-05T12:47:02.660Z","sync_unique":"","updates":["5801bc3b5a601b190081b9cb"],"childrenPages":[]}

API for custom short URLs - Code snippet


Copy-and-paste in your application/script to create a custom short URL: [block:code] { "codes": [ { "code": "$.ajax({\n url: \"https://api.rebrandly.com/v1/links\",\n type: \"post\",\n data: JSON.stringify({\n \t\t\"destination\" : \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n \t, \"domain\": { \"fullName\": \"rebrand.ly\" }\n //, \"slashtag\": \"A_NEW_SLASHTAG\"\n //, \"title\": \"Rebrandly YouTube channel\"\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n },\n dataType: \"json\",\n success: function (link) {\n\t\tconsole.log(\"Long URL was \"+link.destination+\", short URL is \"+link.shortUrl);\n\t}\n});", "language": "javascript", "name": "jQuery" }, { "code": "var request = require(\"request\");\n[...]\nrequest({\n uri: \"https://api.rebrandly.com/v1/links\",\n method: \"POST\",\n body: JSON.stringify({\n \t\tdestination: \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n\t\t\t\t, domain: { fullName: \"rebrand.ly\" }\n //, slashtag: \"A_NEW_SLASHTAG\"\n //, title: \"Rebrandly YouTube channel\"\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n }\n\t}, function(err, response, body) {\n \tvar link = JSON.parse(body);\n \tconsole.log(\"Long URL was \"+link.destination+\", short URL is \"+link.shortUrl);\n\t}", "language": "javascript", "name": "NodeJS" }, { "code": "<?php\n [...]\n $domain_data[\"fullName\"] = \"rebrand.ly\";\n\t$post_data[\"destination\"] = \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\";\n\t$post_data[\"domain\"] = $domain_data;\n\t//$post_data[\"slashtag\"] = \"A_NEW_SLASHTAG\";\n\t//$post_data[\"title\"] = \"Rebrandly YouTube channel\";\n $ch = curl_init(\"https://api.rebrandly.com/v1/links\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"apikey: YOUR_API_KEY\",\n \"Content-Type: application/json\"\n ));\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));\n $result = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($result, true);\n print \"Short URL is: \" . $response[\"shortUrl\"];\n?>", "language": "php" }, { "code": "import requests\nimport json\nr = requests.post(\"https://api.rebrandly.com/v1/links\", \n\tdata = json.dumps({\n\t\t \"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n\t\t , \"domain\": { \"fullName\": \"rebrand.ly\" }\n\t\t# , \"slashtag\": \"A_NEW_SLASHTAG\"\n\t\t# , \"title\": \"Rebrandly YouTube channel\"\n\t}),\n\theaders={\n \"Content-type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n })\n\nif (r.status_code == requests.codes.ok):\n\tlink = r.json()\n\tprint(\"Long URL was %s, short URL is %s\" % (link[\"destination\"], link[\"shortUrl\"]))", "language": "python", "name": "Python" }, { "code": "POST https://api.rebrandly.com/v1/links\nContent-Type: application/json\napikey: YOUR_API_KEY\n\n{\"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\", \"domain\": { \"fullName\": \"rebrand.ly\"}}", "language": "http" }, { "code": "curl https://api.rebrandly.com/v1/links \\\n -H 'Content-Type: application/json' \\\n -H 'apikey: YOUR_API_KEY'\n -d '{\"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\",\"domain\":{\"fullName\":\"rebrand.ly\"}}'", "language": "curl" } ] } [/block]
Copy-and-paste in your application/script to create a custom short URL: [block:code] { "codes": [ { "code": "$.ajax({\n url: \"https://api.rebrandly.com/v1/links\",\n type: \"post\",\n data: JSON.stringify({\n \t\t\"destination\" : \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n \t, \"domain\": { \"fullName\": \"rebrand.ly\" }\n //, \"slashtag\": \"A_NEW_SLASHTAG\"\n //, \"title\": \"Rebrandly YouTube channel\"\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n },\n dataType: \"json\",\n success: function (link) {\n\t\tconsole.log(\"Long URL was \"+link.destination+\", short URL is \"+link.shortUrl);\n\t}\n});", "language": "javascript", "name": "jQuery" }, { "code": "var request = require(\"request\");\n[...]\nrequest({\n uri: \"https://api.rebrandly.com/v1/links\",\n method: \"POST\",\n body: JSON.stringify({\n \t\tdestination: \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n\t\t\t\t, domain: { fullName: \"rebrand.ly\" }\n //, slashtag: \"A_NEW_SLASHTAG\"\n //, title: \"Rebrandly YouTube channel\"\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n }\n\t}, function(err, response, body) {\n \tvar link = JSON.parse(body);\n \tconsole.log(\"Long URL was \"+link.destination+\", short URL is \"+link.shortUrl);\n\t}", "language": "javascript", "name": "NodeJS" }, { "code": "<?php\n [...]\n $domain_data[\"fullName\"] = \"rebrand.ly\";\n\t$post_data[\"destination\"] = \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\";\n\t$post_data[\"domain\"] = $domain_data;\n\t//$post_data[\"slashtag\"] = \"A_NEW_SLASHTAG\";\n\t//$post_data[\"title\"] = \"Rebrandly YouTube channel\";\n $ch = curl_init(\"https://api.rebrandly.com/v1/links\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"apikey: YOUR_API_KEY\",\n \"Content-Type: application/json\"\n ));\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));\n $result = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($result, true);\n print \"Short URL is: \" . $response[\"shortUrl\"];\n?>", "language": "php" }, { "code": "import requests\nimport json\nr = requests.post(\"https://api.rebrandly.com/v1/links\", \n\tdata = json.dumps({\n\t\t \"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\"\n\t\t , \"domain\": { \"fullName\": \"rebrand.ly\" }\n\t\t# , \"slashtag\": \"A_NEW_SLASHTAG\"\n\t\t# , \"title\": \"Rebrandly YouTube channel\"\n\t}),\n\theaders={\n \"Content-type\": \"application/json\",\n \"apikey\": \"YOUR_API_KEY\"\n })\n\nif (r.status_code == requests.codes.ok):\n\tlink = r.json()\n\tprint(\"Long URL was %s, short URL is %s\" % (link[\"destination\"], link[\"shortUrl\"]))", "language": "python", "name": "Python" }, { "code": "POST https://api.rebrandly.com/v1/links\nContent-Type: application/json\napikey: YOUR_API_KEY\n\n{\"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\", \"domain\": { \"fullName\": \"rebrand.ly\"}}", "language": "http" }, { "code": "curl https://api.rebrandly.com/v1/links \\\n -H 'Content-Type: application/json' \\\n -H 'apikey: YOUR_API_KEY'\n -d '{\"destination\": \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\",\"domain\":{\"fullName\":\"rebrand.ly\"}}'", "language": "curl" } ] } [/block]
{"_id":"57973b66559b402b0044e5ee","hidden":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"excerpt":"","githubsync":"","type":"basic","user":"577d1b6d87acf617003c421d","createdAt":"2016-07-26T10:28:54.276Z","isReference":false,"slug":"get-started","parentDoc":null,"project":"577d1b8b74aea422007230c4","sync_unique":"","title":"Get started","body":"We recommend the following approach to develop an application with our API.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Get an API Key\"\n}\n[/block]\nCreate a new API key from <a href=\"https://www.rebrandly.com/api-settings\" target=\"_blank\">your Rebrandly dashboard</a>.\nMore info about authentication [here](doc:authentication-overview).\n*If you haven't done it yet, [get your FREE Rebrandly account](https://www.rebrandly.com) now.*\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Configure your API client\"\n}\n[/block]\nWithin your application/script, you can access Rebrandly Web API via HTTP protocol.\nSearch for a component able to perform basic HTTP operations, and define `GET`, `POST` and `DELETE` operations in such a way they include following headers:\n- `Content-Type: application/json`\n- `apikey: YOUR_API_KEY`\n\nIf you want to use API to interact with your account in the context of a Rebrandly Team, you need to include an additional HTTP header with your team id (See [/v1/account/teams](doc:v1teams)):\n- `team: YOUR_TEAM_ID`\nAlternatively, you can specify your team id via query parameter (syntax: `team[id]=YOUR_TEAM_ID` or via body parameter (`team` property with a [Resource reference](doc:resource-objects) to the team).\n\nHere, on the right, you can find a very simple js example about how a generic application can integrate with the Rebrandly Web API.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Manage user identity\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"One GET to rule them all\",\n  \"body\": \"This will be your web client proof of concept for HTTP `GET` operations.\"\n}\n[/block]\nLet's implement a basic operation to get user account details.\nModel for accounts is documented in [Accounts](doc:account-model), while the API call to get account details is documented in the [Getting account details](doc:getting-account-details) section.\n\nWe recommend you always get account's details as the first step in your application flow, to understand which features the account's owner has access to, and which limits are in place for that API key or OAuth token.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Rebrand your first link\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"One POST to rule them all\",\n  \"body\": \"This will be your web client proof of concept for HTTP `POST`operations.\"\n}\n[/block]\nLet's implement a basic operation to create a new branded short link.\nModel for links is documented in [Branded short links](doc:link-entity), while the API call to create a new link is documented in the [Creating a new link](doc:create-a-new-link) section.\nA beginner's guide is available as well: [Rebrand your first link](doc:create-your-first-link).\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. Enhance your application\"\n}\n[/block]\nWhen `GET` and `POST` flows are working properly in your Rebrandly web client, you can enrich it with further API operations.\n\nFor each API operation you want to perform in your application:\n- Include in your application model all object definitions involved (in [Models](doc:model-overview) section)\n- Include in your application error model, all of the error object definitions involved (in [Errors](doc:understanding-responses) section).\n- Include in your application web client, the API operation (`GET`, `POST` or `DELETE`), as well with a preliminary check for compatibility between the account and the feature you are going to use.\n- Map API responses to correspondent objects definition\n- Test the operation\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example web client\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Change YOUR_API_KEY with your Rebrandly API key\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var request = require(\\\"request\\\");\\n\\nfunction apiRequest(endpoint, httpmethod, body){\\n\\trequest({\\n  \\turi: \\\"https://api.rebrandly.com/v1/\\\" + endpoint,\\n    method: httpmethod,\\n    body: body ? JSON.stringify(body) : null,\\n    headers: {\\n      'Content-Type': 'application/json',\\n    \\t'apikey': 'YOUR_API_KEY'\\n    }\\n    }, function(err, response, body){\\n    if (err) failure(JSON.parse(err));\\n    else success(JSON.parse(body));\\n  })\\n}\\n\\nfunction getRequest(endpoint, success, failure){\\n\\treturn apiRequest(endpoint, \\\"GET\\\", null, success, failure)\\n}\\n\\nfunction postRequest(endpoint, body, success, failure){\\n\\treturn apiRequest(endpoint, \\\"POST\\\", body, success, failure)\\n}\\n\\nfunction getAccount(success, failure){\\n    return getRequest(\\\"account\\\", success, failure);\\n}\\n\\nfunction createNewLink(link, success, failure){\\n\\treturn postRequest(\\\"links\\\", link, success, failure);\\n}\\n\\nexports.getAccount = getAccount;\\nexports.createNewLink = createNewLink;\",\n      \"language\": \"javascript\",\n      \"name\": \"rebrandly.js\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example application\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var rebrandlyClient = require(\\\"./rebrandly.js\\\")\\n\\nvar linkDef = {\\n  \\t\\\"title\\\": \\\"My first link\\\",\\n    \\\"slashtag\\\": \\\"test\\\"+ Math.floor(Math.random()*999999),\\n  \\t//for the sake of example, slashtag should always be different\\n    \\\"destination\\\": \\\"http://www.google.com\\\"\\n  };\\n\\nfunction onError(err){\\n    console.log(JSON.stringify(err))\\n}\\n\\nrebrandlyClient.getAccount(function(account) {\\n    rebrandlyClient.createNewLink(linkDef, function(link){\\n        console.log(\\\"Congratulations \\\", account.fullName, \\\"! You just created your first link.\\\")\\n        console.log(\\\"Link ID is: \\\", link.id)\\n        console.log(\\\"Short URL is: http://\\\", link.shortUrl)\\n        console.log(\\\"Destination URL is: \\\", link.destination)       \\n  }, onError);\\n}, onError)\\n\\n\",\n      \"language\": \"javascript\",\n      \"name\": \"app.js\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Console output will be:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Congratulations John! You just created your first link.\\nLink ID is: m5jk4cc5bjop45d6bbe97b06ac2d1ghj\\nShort URL is: http:// rebrand.ly/test531972\\nDestination URL is: http://www.google.com\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"577d1b8b74aea422007230c8","link_external":false,"version":"577d1b8b74aea422007230c7","__v":2,"updates":["5797b1c29eaa220e006128e6"],"childrenPages":[]}

Get started


We recommend the following approach to develop an application with our API. [block:api-header] { "type": "basic", "title": "1. Get an API Key" } [/block] Create a new API key from <a href="https://www.rebrandly.com/api-settings" target="_blank">your Rebrandly dashboard</a>. More info about authentication [here](doc:authentication-overview). *If you haven't done it yet, [get your FREE Rebrandly account](https://www.rebrandly.com) now.* [block:api-header] { "type": "basic", "title": "2. Configure your API client" } [/block] Within your application/script, you can access Rebrandly Web API via HTTP protocol. Search for a component able to perform basic HTTP operations, and define `GET`, `POST` and `DELETE` operations in such a way they include following headers: - `Content-Type: application/json` - `apikey: YOUR_API_KEY` If you want to use API to interact with your account in the context of a Rebrandly Team, you need to include an additional HTTP header with your team id (See [/v1/account/teams](doc:v1teams)): - `team: YOUR_TEAM_ID` Alternatively, you can specify your team id via query parameter (syntax: `team[id]=YOUR_TEAM_ID` or via body parameter (`team` property with a [Resource reference](doc:resource-objects) to the team). Here, on the right, you can find a very simple js example about how a generic application can integrate with the Rebrandly Web API. [block:api-header] { "type": "basic", "title": "3. Manage user identity" } [/block] [block:callout] { "type": "info", "title": "One GET to rule them all", "body": "This will be your web client proof of concept for HTTP `GET` operations." } [/block] Let's implement a basic operation to get user account details. Model for accounts is documented in [Accounts](doc:account-model), while the API call to get account details is documented in the [Getting account details](doc:getting-account-details) section. We recommend you always get account's details as the first step in your application flow, to understand which features the account's owner has access to, and which limits are in place for that API key or OAuth token. [block:api-header] { "type": "basic", "title": "4. Rebrand your first link" } [/block] [block:callout] { "type": "info", "title": "One POST to rule them all", "body": "This will be your web client proof of concept for HTTP `POST`operations." } [/block] Let's implement a basic operation to create a new branded short link. Model for links is documented in [Branded short links](doc:link-entity), while the API call to create a new link is documented in the [Creating a new link](doc:create-a-new-link) section. A beginner's guide is available as well: [Rebrand your first link](doc:create-your-first-link). [block:api-header] { "type": "basic", "title": "5. Enhance your application" } [/block] When `GET` and `POST` flows are working properly in your Rebrandly web client, you can enrich it with further API operations. For each API operation you want to perform in your application: - Include in your application model all object definitions involved (in [Models](doc:model-overview) section) - Include in your application error model, all of the error object definitions involved (in [Errors](doc:understanding-responses) section). - Include in your application web client, the API operation (`GET`, `POST` or `DELETE`), as well with a preliminary check for compatibility between the account and the feature you are going to use. - Map API responses to correspondent objects definition - Test the operation [block:api-header] { "type": "basic", "title": "Example web client", "sidebar": true } [/block] [block:textarea] { "text": "Change YOUR_API_KEY with your Rebrandly API key", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "var request = require(\"request\");\n\nfunction apiRequest(endpoint, httpmethod, body){\n\trequest({\n \turi: \"https://api.rebrandly.com/v1/\" + endpoint,\n method: httpmethod,\n body: body ? JSON.stringify(body) : null,\n headers: {\n 'Content-Type': 'application/json',\n \t'apikey': 'YOUR_API_KEY'\n }\n }, function(err, response, body){\n if (err) failure(JSON.parse(err));\n else success(JSON.parse(body));\n })\n}\n\nfunction getRequest(endpoint, success, failure){\n\treturn apiRequest(endpoint, \"GET\", null, success, failure)\n}\n\nfunction postRequest(endpoint, body, success, failure){\n\treturn apiRequest(endpoint, \"POST\", body, success, failure)\n}\n\nfunction getAccount(success, failure){\n return getRequest(\"account\", success, failure);\n}\n\nfunction createNewLink(link, success, failure){\n\treturn postRequest(\"links\", link, success, failure);\n}\n\nexports.getAccount = getAccount;\nexports.createNewLink = createNewLink;", "language": "javascript", "name": "rebrandly.js" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Example application", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "var rebrandlyClient = require(\"./rebrandly.js\")\n\nvar linkDef = {\n \t\"title\": \"My first link\",\n \"slashtag\": \"test\"+ Math.floor(Math.random()*999999),\n \t//for the sake of example, slashtag should always be different\n \"destination\": \"http://www.google.com\"\n };\n\nfunction onError(err){\n console.log(JSON.stringify(err))\n}\n\nrebrandlyClient.getAccount(function(account) {\n rebrandlyClient.createNewLink(linkDef, function(link){\n console.log(\"Congratulations \", account.fullName, \"! You just created your first link.\")\n console.log(\"Link ID is: \", link.id)\n console.log(\"Short URL is: http://\", link.shortUrl)\n console.log(\"Destination URL is: \", link.destination) \n }, onError);\n}, onError)\n\n", "language": "javascript", "name": "app.js" } ], "sidebar": true } [/block] [block:textarea] { "text": "Console output will be:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "Congratulations John! You just created your first link.\nLink ID is: m5jk4cc5bjop45d6bbe97b06ac2d1ghj\nShort URL is: http:// rebrand.ly/test531972\nDestination URL is: http://www.google.com", "language": "text" } ], "sidebar": true } [/block]
We recommend the following approach to develop an application with our API. [block:api-header] { "type": "basic", "title": "1. Get an API Key" } [/block] Create a new API key from <a href="https://www.rebrandly.com/api-settings" target="_blank">your Rebrandly dashboard</a>. More info about authentication [here](doc:authentication-overview). *If you haven't done it yet, [get your FREE Rebrandly account](https://www.rebrandly.com) now.* [block:api-header] { "type": "basic", "title": "2. Configure your API client" } [/block] Within your application/script, you can access Rebrandly Web API via HTTP protocol. Search for a component able to perform basic HTTP operations, and define `GET`, `POST` and `DELETE` operations in such a way they include following headers: - `Content-Type: application/json` - `apikey: YOUR_API_KEY` If you want to use API to interact with your account in the context of a Rebrandly Team, you need to include an additional HTTP header with your team id (See [/v1/account/teams](doc:v1teams)): - `team: YOUR_TEAM_ID` Alternatively, you can specify your team id via query parameter (syntax: `team[id]=YOUR_TEAM_ID` or via body parameter (`team` property with a [Resource reference](doc:resource-objects) to the team). Here, on the right, you can find a very simple js example about how a generic application can integrate with the Rebrandly Web API. [block:api-header] { "type": "basic", "title": "3. Manage user identity" } [/block] [block:callout] { "type": "info", "title": "One GET to rule them all", "body": "This will be your web client proof of concept for HTTP `GET` operations." } [/block] Let's implement a basic operation to get user account details. Model for accounts is documented in [Accounts](doc:account-model), while the API call to get account details is documented in the [Getting account details](doc:getting-account-details) section. We recommend you always get account's details as the first step in your application flow, to understand which features the account's owner has access to, and which limits are in place for that API key or OAuth token. [block:api-header] { "type": "basic", "title": "4. Rebrand your first link" } [/block] [block:callout] { "type": "info", "title": "One POST to rule them all", "body": "This will be your web client proof of concept for HTTP `POST`operations." } [/block] Let's implement a basic operation to create a new branded short link. Model for links is documented in [Branded short links](doc:link-entity), while the API call to create a new link is documented in the [Creating a new link](doc:create-a-new-link) section. A beginner's guide is available as well: [Rebrand your first link](doc:create-your-first-link). [block:api-header] { "type": "basic", "title": "5. Enhance your application" } [/block] When `GET` and `POST` flows are working properly in your Rebrandly web client, you can enrich it with further API operations. For each API operation you want to perform in your application: - Include in your application model all object definitions involved (in [Models](doc:model-overview) section) - Include in your application error model, all of the error object definitions involved (in [Errors](doc:understanding-responses) section). - Include in your application web client, the API operation (`GET`, `POST` or `DELETE`), as well with a preliminary check for compatibility between the account and the feature you are going to use. - Map API responses to correspondent objects definition - Test the operation [block:api-header] { "type": "basic", "title": "Example web client", "sidebar": true } [/block] [block:textarea] { "text": "Change YOUR_API_KEY with your Rebrandly API key", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "var request = require(\"request\");\n\nfunction apiRequest(endpoint, httpmethod, body){\n\trequest({\n \turi: \"https://api.rebrandly.com/v1/\" + endpoint,\n method: httpmethod,\n body: body ? JSON.stringify(body) : null,\n headers: {\n 'Content-Type': 'application/json',\n \t'apikey': 'YOUR_API_KEY'\n }\n }, function(err, response, body){\n if (err) failure(JSON.parse(err));\n else success(JSON.parse(body));\n })\n}\n\nfunction getRequest(endpoint, success, failure){\n\treturn apiRequest(endpoint, \"GET\", null, success, failure)\n}\n\nfunction postRequest(endpoint, body, success, failure){\n\treturn apiRequest(endpoint, \"POST\", body, success, failure)\n}\n\nfunction getAccount(success, failure){\n return getRequest(\"account\", success, failure);\n}\n\nfunction createNewLink(link, success, failure){\n\treturn postRequest(\"links\", link, success, failure);\n}\n\nexports.getAccount = getAccount;\nexports.createNewLink = createNewLink;", "language": "javascript", "name": "rebrandly.js" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Example application", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "var rebrandlyClient = require(\"./rebrandly.js\")\n\nvar linkDef = {\n \t\"title\": \"My first link\",\n \"slashtag\": \"test\"+ Math.floor(Math.random()*999999),\n \t//for the sake of example, slashtag should always be different\n \"destination\": \"http://www.google.com\"\n };\n\nfunction onError(err){\n console.log(JSON.stringify(err))\n}\n\nrebrandlyClient.getAccount(function(account) {\n rebrandlyClient.createNewLink(linkDef, function(link){\n console.log(\"Congratulations \", account.fullName, \"! You just created your first link.\")\n console.log(\"Link ID is: \", link.id)\n console.log(\"Short URL is: http://\", link.shortUrl)\n console.log(\"Destination URL is: \", link.destination) \n }, onError);\n}, onError)\n\n", "language": "javascript", "name": "app.js" } ], "sidebar": true } [/block] [block:textarea] { "text": "Console output will be:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "Congratulations John! You just created your first link.\nLink ID is: m5jk4cc5bjop45d6bbe97b06ac2d1ghj\nShort URL is: http:// rebrand.ly/test531972\nDestination URL is: http://www.google.com", "language": "text" } ], "sidebar": true } [/block]
{"_id":"577d28c487acf617003c4257","excerpt":"What you can do with the Rebrandly API","githubsync":"","parentDoc":null,"project":"577d1b8b74aea422007230c4","title":"API features","category":"577d1b8b74aea422007230c8","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What the API supports\"\n}\n[/block]\n- Manage your account info\n- Manage your branded shorts links\n  - within your account\n  - within a specific Rebrandly Team\n- Manage your branded domains\n- Manage your tags\n- Manage your retargeting scripts\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What the API doesn't support\"\n}\n[/block]\n- Search for domain names\n- Purchase a new branded domain\n- Manage your billing/invoicing info\n- Manage your teams and teammates","link_external":false,"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":""},"hidden":false,"slug":"api-features","createdAt":"2016-07-06T15:50:28.127Z","isReference":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"sync_unique":"","type":"basic","__v":21,"updates":["5792b79c23106419009c4314"],"childrenPages":[]}

API features

What you can do with the Rebrandly API

[block:api-header] { "type": "basic", "title": "What the API supports" } [/block] - Manage your account info - Manage your branded shorts links - within your account - within a specific Rebrandly Team - Manage your branded domains - Manage your tags - Manage your retargeting scripts [block:api-header] { "type": "basic", "title": "What the API doesn't support" } [/block] - Search for domain names - Purchase a new branded domain - Manage your billing/invoicing info - Manage your teams and teammates
[block:api-header] { "type": "basic", "title": "What the API supports" } [/block] - Manage your account info - Manage your branded shorts links - within your account - within a specific Rebrandly Team - Manage your branded domains - Manage your tags - Manage your retargeting scripts [block:api-header] { "type": "basic", "title": "What the API doesn't support" } [/block] - Search for domain names - Purchase a new branded domain - Manage your billing/invoicing info - Manage your teams and teammates
{"_id":"58f6088e914540250034e97f","sync_unique":"","title":"API limits","__v":0,"body":"The number of links, domains and teammates you are allowed to create depends on the plan you subscribed.\n\nYou can check your limits at any time by logging into your account and accessing [our pricing page](https://www.rebrandly.com/pricing). To programmatically access your limits and features availability, see [Account info](doc:account-model).\n\nMind that in your Rebrandly account you can have up to:\n- 50 teams, if your plan includes teams\n- 50 tags, if your plan includes tags\n- 50 retargeting scripts, if your plan include retargeting feature\n- 10 API keys\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"How do we count resources\",\n  \"body\": \"Counters are updated transactionally with your API operations.\\n- Trashed links are counted as active links: you need to permanently delete the link to reduce links usage in your account.\\n- Pending teammates are counted as active teammates.\\n- Deleted domains are not included in the domains counting, as well as deleted tags and deleted scripts.\"\n}\n[/block]\nIf you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my account limits) sharing your use case.\n\nYou are allowed to perform up to 10 API calls per second.","category":"577d1b8b74aea422007230c8","link_external":false,"order":3,"version":"577d1b8b74aea422007230c7","link_url":"","project":"577d1b8b74aea422007230c4","slug":"api-limits","updates":[],"createdAt":"2017-04-18T12:37:34.561Z","hidden":false,"isReference":false,"next":{"pages":[],"description":""},"parentDoc":null,"type":"basic","api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"excerpt":"","githubsync":"","user":"577d1b6d87acf617003c421d","childrenPages":[]}

API limits


The number of links, domains and teammates you are allowed to create depends on the plan you subscribed. You can check your limits at any time by logging into your account and accessing [our pricing page](https://www.rebrandly.com/pricing). To programmatically access your limits and features availability, see [Account info](doc:account-model). Mind that in your Rebrandly account you can have up to: - 50 teams, if your plan includes teams - 50 tags, if your plan includes tags - 50 retargeting scripts, if your plan include retargeting feature - 10 API keys [block:callout] { "type": "warning", "title": "How do we count resources", "body": "Counters are updated transactionally with your API operations.\n- Trashed links are counted as active links: you need to permanently delete the link to reduce links usage in your account.\n- Pending teammates are counted as active teammates.\n- Deleted domains are not included in the domains counting, as well as deleted tags and deleted scripts." } [/block] If you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my account limits) sharing your use case. You are allowed to perform up to 10 API calls per second.
The number of links, domains and teammates you are allowed to create depends on the plan you subscribed. You can check your limits at any time by logging into your account and accessing [our pricing page](https://www.rebrandly.com/pricing). To programmatically access your limits and features availability, see [Account info](doc:account-model). Mind that in your Rebrandly account you can have up to: - 50 teams, if your plan includes teams - 50 tags, if your plan includes tags - 50 retargeting scripts, if your plan include retargeting feature - 10 API keys [block:callout] { "type": "warning", "title": "How do we count resources", "body": "Counters are updated transactionally with your API operations.\n- Trashed links are counted as active links: you need to permanently delete the link to reduce links usage in your account.\n- Pending teammates are counted as active teammates.\n- Deleted domains are not included in the domains counting, as well as deleted tags and deleted scripts." } [/block] If you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my account limits) sharing your use case. You are allowed to perform up to 10 API calls per second.
{"_id":"57a217455220910e002a1759","link_url":"","order":4,"sync_unique":"","title":"Live APPS","type":"basic","__v":3,"body":"Rebrandly Web API is currently consumed by the following applications:\n- [Rebrandly.com](https://www.rebrandly.com): the Rebrandly main website\n- [Rebrandly Chrome extension](https://www.rebrandly.com/apps/chrome-extension): a Google Chrome extension to easily rebrand links\n- [Rebrandly Firefox extension](https://www.rebrandly.com/apps/firefox-extension):  a Mozilla Firefox extension to easily rebrand links\n- [Rebrandly Safari extension](https://www.rebrandly.com/apps/safari-extension): an Apple Safari extension to easily rebrand links\n- [Bitly importer](https://www.rebrandly.com/apps/bitly-importer): a tool to rebrand all your bitly links\n- [ClickMeter connector](https://www.rebrandly.com/apps/clickmeter-connector): a feature to connect your Rebrandly and ClickMeter accounts together, to get ClickMeter statistics\n- [Bitly connector](https://www.rebrandly.com/apps/bitly-connector): a feature to connect your Rebrandly and Bitly accounts together, to get Bitly statistics\n- [Goo.gl connector](https://www.rebrandly.com/apps/googl-connector): a feature to connect your Rebrandly and Google accounts together, to get Goo.gl statistics\n- [Rebrandly iOS app](https://www.rebrandly.com/apps/iphone): an iOS mobile application to manage your branded link\n- [Rebrandly Android app](https://www.rebrandly.com/apps/android): an Android mobile application to manage your branded link\n- [Google Sheet](https://support.rebrandly.com/hc/en-us/articles/115005896748-Google-Drive-bulk-links-creation-with-Google-Sheet): create branded short links from a Google Sheet\n- [Name.com](https://name.com): a registrar allowing you to easily integrate your domains with Rebrandly\n- [Iwantmyname.com](https://iwantmyname.com): a registrar allowing you to easily integrate your domains with Rebrandly\n- [Short Menu app](https://www.rebrandly.com/apps/short-menu): a mobile application to short links\n- [SocialPilot](https://support.rebrandly.com/hc/en-us/articles/115000278528-How-to-connect-Rebrandly-to-SocialPilot): a social media scheduling and marketing tool for agencies and social media professionals.\n- [SocialBee](https://www.rebrandly.com/apps/socialbee): a social media content, growth and engagement automation service.\n- [ViralTag](https://www.rebrandly.com/apps/viraltag): an easy to use Social Media Marketing tool built for sharing visual content.\n- [Easy Social Share Button](https://www.rebrandly.com/apps/essb): a social sharing plugin for WordPress.\n- [Tweetbot](https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-Shortening-for-Tweetbot-iOS-and-MAC-): a twitter client for Mac.\n- [Rebrandly Bookmarklet](https://www.rebrandly.com/apps/bookmarklet): a browser addon to short links from web pages\n- [Zapier - Google Sheets](https://www.rebrandly.com/apps/zapier): to import and export your Rebrandly links using Google Sheets\n- [Zapier - Gmail](https://www.rebrandly.com/apps/zapier): to connect your Gmail account with Rebrandly and get notifications on events (e.g. reached 100 clicks on a link, created a new link and so on)\n- [Zapier - RSS](https://www.rebrandly.com/apps/zapier): to create Rebrandly links based on RSS feeds\n- [Zapier - Buffer](https://zapier.com/zapbook/zaps/15529/buffer-your-rebrandly-links/): push your new Rebrandly Links to your Buffer queue\n- [Postpickr](https://www.postpickr.com/): a social media assistant which let you use your Rebrandly domains for your online posts\n\n\n\n\nA full list of applications is available in [Rebrandly Apps page](https://www.rebrandly.com/apps).\nAlso look at <a href=\"https://blog.rebrandly.com/reasons-build-integration-rebrandly-api/\" target=\"_blank\">5 Reasons to Build an Integration with the Rebrandly API</a> \nor <a href=\"http://www.programmableweb.com/news/api-godai-5-elements-amazing-api/analysis/2016/11/10\" target=\"_blank\">The philosophy of Rebrandly's API</a> (by ProgrammableWeb).\n\n\nWe love to hear about Rebrandly use cases.\nPlease [let us know](mailto:dev@rebrandly.com) what you're developing using our API!","createdAt":"2016-08-03T16:09:41.097Z","githubsync":"","isReference":false,"project":"577d1b8b74aea422007230c4","updates":["582ae5997a96051b0070b0e5","58ef82c2de2a332300c9d675"],"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"category":"577d1b8b74aea422007230c8","excerpt":"","hidden":false,"next":{"description":"","pages":[]},"parentDoc":null,"version":"577d1b8b74aea422007230c7","link_external":false,"slug":"live-apps","user":"56b22f582d96461700599230","childrenPages":[]}

Live APPS


Rebrandly Web API is currently consumed by the following applications: - [Rebrandly.com](https://www.rebrandly.com): the Rebrandly main website - [Rebrandly Chrome extension](https://www.rebrandly.com/apps/chrome-extension): a Google Chrome extension to easily rebrand links - [Rebrandly Firefox extension](https://www.rebrandly.com/apps/firefox-extension): a Mozilla Firefox extension to easily rebrand links - [Rebrandly Safari extension](https://www.rebrandly.com/apps/safari-extension): an Apple Safari extension to easily rebrand links - [Bitly importer](https://www.rebrandly.com/apps/bitly-importer): a tool to rebrand all your bitly links - [ClickMeter connector](https://www.rebrandly.com/apps/clickmeter-connector): a feature to connect your Rebrandly and ClickMeter accounts together, to get ClickMeter statistics - [Bitly connector](https://www.rebrandly.com/apps/bitly-connector): a feature to connect your Rebrandly and Bitly accounts together, to get Bitly statistics - [Goo.gl connector](https://www.rebrandly.com/apps/googl-connector): a feature to connect your Rebrandly and Google accounts together, to get Goo.gl statistics - [Rebrandly iOS app](https://www.rebrandly.com/apps/iphone): an iOS mobile application to manage your branded link - [Rebrandly Android app](https://www.rebrandly.com/apps/android): an Android mobile application to manage your branded link - [Google Sheet](https://support.rebrandly.com/hc/en-us/articles/115005896748-Google-Drive-bulk-links-creation-with-Google-Sheet): create branded short links from a Google Sheet - [Name.com](https://name.com): a registrar allowing you to easily integrate your domains with Rebrandly - [Iwantmyname.com](https://iwantmyname.com): a registrar allowing you to easily integrate your domains with Rebrandly - [Short Menu app](https://www.rebrandly.com/apps/short-menu): a mobile application to short links - [SocialPilot](https://support.rebrandly.com/hc/en-us/articles/115000278528-How-to-connect-Rebrandly-to-SocialPilot): a social media scheduling and marketing tool for agencies and social media professionals. - [SocialBee](https://www.rebrandly.com/apps/socialbee): a social media content, growth and engagement automation service. - [ViralTag](https://www.rebrandly.com/apps/viraltag): an easy to use Social Media Marketing tool built for sharing visual content. - [Easy Social Share Button](https://www.rebrandly.com/apps/essb): a social sharing plugin for WordPress. - [Tweetbot](https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-Shortening-for-Tweetbot-iOS-and-MAC-): a twitter client for Mac. - [Rebrandly Bookmarklet](https://www.rebrandly.com/apps/bookmarklet): a browser addon to short links from web pages - [Zapier - Google Sheets](https://www.rebrandly.com/apps/zapier): to import and export your Rebrandly links using Google Sheets - [Zapier - Gmail](https://www.rebrandly.com/apps/zapier): to connect your Gmail account with Rebrandly and get notifications on events (e.g. reached 100 clicks on a link, created a new link and so on) - [Zapier - RSS](https://www.rebrandly.com/apps/zapier): to create Rebrandly links based on RSS feeds - [Zapier - Buffer](https://zapier.com/zapbook/zaps/15529/buffer-your-rebrandly-links/): push your new Rebrandly Links to your Buffer queue - [Postpickr](https://www.postpickr.com/): a social media assistant which let you use your Rebrandly domains for your online posts A full list of applications is available in [Rebrandly Apps page](https://www.rebrandly.com/apps). Also look at <a href="https://blog.rebrandly.com/reasons-build-integration-rebrandly-api/" target="_blank">5 Reasons to Build an Integration with the Rebrandly API</a> or <a href="http://www.programmableweb.com/news/api-godai-5-elements-amazing-api/analysis/2016/11/10" target="_blank">The philosophy of Rebrandly's API</a> (by ProgrammableWeb). We love to hear about Rebrandly use cases. Please [let us know](mailto:dev@rebrandly.com) what you're developing using our API!
Rebrandly Web API is currently consumed by the following applications: - [Rebrandly.com](https://www.rebrandly.com): the Rebrandly main website - [Rebrandly Chrome extension](https://www.rebrandly.com/apps/chrome-extension): a Google Chrome extension to easily rebrand links - [Rebrandly Firefox extension](https://www.rebrandly.com/apps/firefox-extension): a Mozilla Firefox extension to easily rebrand links - [Rebrandly Safari extension](https://www.rebrandly.com/apps/safari-extension): an Apple Safari extension to easily rebrand links - [Bitly importer](https://www.rebrandly.com/apps/bitly-importer): a tool to rebrand all your bitly links - [ClickMeter connector](https://www.rebrandly.com/apps/clickmeter-connector): a feature to connect your Rebrandly and ClickMeter accounts together, to get ClickMeter statistics - [Bitly connector](https://www.rebrandly.com/apps/bitly-connector): a feature to connect your Rebrandly and Bitly accounts together, to get Bitly statistics - [Goo.gl connector](https://www.rebrandly.com/apps/googl-connector): a feature to connect your Rebrandly and Google accounts together, to get Goo.gl statistics - [Rebrandly iOS app](https://www.rebrandly.com/apps/iphone): an iOS mobile application to manage your branded link - [Rebrandly Android app](https://www.rebrandly.com/apps/android): an Android mobile application to manage your branded link - [Google Sheet](https://support.rebrandly.com/hc/en-us/articles/115005896748-Google-Drive-bulk-links-creation-with-Google-Sheet): create branded short links from a Google Sheet - [Name.com](https://name.com): a registrar allowing you to easily integrate your domains with Rebrandly - [Iwantmyname.com](https://iwantmyname.com): a registrar allowing you to easily integrate your domains with Rebrandly - [Short Menu app](https://www.rebrandly.com/apps/short-menu): a mobile application to short links - [SocialPilot](https://support.rebrandly.com/hc/en-us/articles/115000278528-How-to-connect-Rebrandly-to-SocialPilot): a social media scheduling and marketing tool for agencies and social media professionals. - [SocialBee](https://www.rebrandly.com/apps/socialbee): a social media content, growth and engagement automation service. - [ViralTag](https://www.rebrandly.com/apps/viraltag): an easy to use Social Media Marketing tool built for sharing visual content. - [Easy Social Share Button](https://www.rebrandly.com/apps/essb): a social sharing plugin for WordPress. - [Tweetbot](https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-Shortening-for-Tweetbot-iOS-and-MAC-): a twitter client for Mac. - [Rebrandly Bookmarklet](https://www.rebrandly.com/apps/bookmarklet): a browser addon to short links from web pages - [Zapier - Google Sheets](https://www.rebrandly.com/apps/zapier): to import and export your Rebrandly links using Google Sheets - [Zapier - Gmail](https://www.rebrandly.com/apps/zapier): to connect your Gmail account with Rebrandly and get notifications on events (e.g. reached 100 clicks on a link, created a new link and so on) - [Zapier - RSS](https://www.rebrandly.com/apps/zapier): to create Rebrandly links based on RSS feeds - [Zapier - Buffer](https://zapier.com/zapbook/zaps/15529/buffer-your-rebrandly-links/): push your new Rebrandly Links to your Buffer queue - [Postpickr](https://www.postpickr.com/): a social media assistant which let you use your Rebrandly domains for your online posts A full list of applications is available in [Rebrandly Apps page](https://www.rebrandly.com/apps). Also look at <a href="https://blog.rebrandly.com/reasons-build-integration-rebrandly-api/" target="_blank">5 Reasons to Build an Integration with the Rebrandly API</a> or <a href="http://www.programmableweb.com/news/api-godai-5-elements-amazing-api/analysis/2016/11/10" target="_blank">The philosophy of Rebrandly's API</a> (by ProgrammableWeb). We love to hear about Rebrandly use cases. Please [let us know](mailto:dev@rebrandly.com) what you're developing using our API!
{"_id":"57cd8a2a1e75f217006dce2e","excerpt":"","hidden":false,"type":"basic","api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T15:07:22.323Z","slug":"api-explorer","version":"577d1b8b74aea422007230c7","__v":0,"body":"All Rebrandly Web API endpoints are listed below.\nWith our API Explorer, you can try each of them specifying [your API Key](doc:api-key-authentication) once.","link_url":"","order":0,"githubsync":"","link_external":false,"sync_unique":"","user":"56b22f582d96461700599230","updates":[],"isReference":false,"parentDoc":null,"project":"577d1b8b74aea422007230c4","title":"API Explorer","childrenPages":[]}

API Explorer


All Rebrandly Web API endpoints are listed below. With our API Explorer, you can try each of them specifying [your API Key](doc:api-key-authentication) once.
All Rebrandly Web API endpoints are listed below. With our API Explorer, you can try each of them specifying [your API Key](doc:api-key-authentication) once.
{"_id":"57cd86934b5a7f1900899383","slug":"account-details-endpoint","sync_unique":"","body":"More details at [Getting account details](doc:getting-account-details).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:52:03.995Z","excerpt":"Get account details","parentDoc":null,"project":"577d1b8b74aea422007230c4","api":{"url":"/v1/account","auth":"required","examples":{"codes":[]},"method":"get","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n  \"fullName\": \"Stanford University\",\n  \"username\": \"fake@stanford.edu\",\n  \"email\": \"fake@stanford.edu\",\n  \"avatarUrl\": \"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\"\n}","name":""}]},"settings":""},"hidden":false,"version":"577d1b8b74aea422007230c7","githubsync":"","link_url":"","type":"get","updates":[],"user":"56b22f582d96461700599230","__v":0,"isReference":false,"link_external":false,"order":1,"title":"/v1/account","childrenPages":[]}

get/v1/account

Get account details

More details at [Getting account details](doc:getting-account-details).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Getting account details](doc:getting-account-details).
{"_id":"57cd7ce2873de50e00724a3b","body":"More details in [Listing your links](doc:list-links).","next":{"description":"","pages":[]},"parentDoc":null,"isReference":false,"link_url":"","title":"/v1/links","type":"get","api":{"params":[{"type":"string","name":"domain.id","_id":"57cd7fb567e1be1700c28570","ref":"","in":"query","required":false,"desc":"Filter branded short links which refer to a specific branded domain id","default":""},{"required":false,"desc":"Filter branded short links according to their status among `active` and `trashed`.","default":"","type":"string","name":"status","_id":"57cd7f9e67e1be1700c2856f","ref":"","in":"query"},{"type":"boolean","name":"favourite","_id":"57cd7f7c33cbfb2200e6cd4e","ref":"","in":"query","required":false,"desc":"Filter branded short links depending on favourite (loved) property","default":""},{"desc":"Sorting criteria to apply to your branded short links collection among `createdAt`, `updatedAt`, `title` and `slashtag`.","default":"createdAt","type":"string","name":"orderBy","_id":"57cd7f134b5a7f1900899379","ref":"","in":"query","required":false},{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your branded short links collection","default":"desc","type":"string","name":"orderDir"},{"name":"offset","_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many branded short links to skip","default":"0","type":"int"},{"type":"int","name":"limit","_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many branded short links to load, starting from offset on","default":"100"},{"required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team","_id":"5926b02fc4ee340f001275dc","ref":"","in":"header"}],"results":{"codes":[{"code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly?\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  }\n},\n ...\n]","name":"","status":200,"language":"json"},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","url":"/v1/links","auth":"required","examples":{"codes":[]},"method":"get"},"githubsync":"","hidden":false,"link_external":false,"order":2,"updates":[],"sync_unique":"","user":"56b22f582d96461700599230","__v":11,"category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:10:42.560Z","excerpt":"Get a list of links","project":"577d1b8b74aea422007230c4","slug":"links-list-endpoint","version":"577d1b8b74aea422007230c7","childrenPages":[]}

get/v1/links

Get a list of links

Query Params

domain.id:
string
Filter branded short links which refer to a specific branded domain id
status:
string
Filter branded short links according to their status among `active` and `trashed`.
favourite:
boolean
Filter branded short links depending on favourite (loved) property
orderBy:
stringcreatedAt
Sorting criteria to apply to your branded short links collection among `createdAt`, `updatedAt`, `title` and `slashtag`.
orderDir:
stringdesc
Sorting direction to apply to your branded short links collection
offset:
integer0
How many branded short links to skip
limit:
integer100
How many branded short links to load, starting from offset on

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details in [Listing your links](doc:list-links).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Listing your links](doc:list-links).
{"_id":"57cd8278873de50e00724a41","__v":3,"link_external":false,"parentDoc":null,"project":"577d1b8b74aea422007230c4","sync_unique":"","user":"56b22f582d96461700599230","body":"More details in [Getting link details](doc:get-link-details).","hidden":false,"link_url":"","order":3,"title":"/v1/links/:id","type":"get","updates":[],"isReference":false,"next":{"pages":[],"description":""},"slug":"links-detail-endpoint","version":"577d1b8b74aea422007230c7","api":{"settings":"","url":"/v1/links/:id","auth":"required","examples":{"codes":[]},"method":"get","params":[{"desc":"Unique identifier of the branded short link you want to get details for","default":"","type":"string","name":"id","_id":"57cd82955f5adc0e0075c5d8","ref":"","in":"path","required":true},{"type":"string","_id":"5926b052c4ee340f001275dd","default":"","desc":"Which team id to filter links by. No team specified will select main account.","in":"header","name":"team","ref":"","required":false}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  },\n  \"status\": \"active\",\n  \"favourite\": false,\n  \"forwardParameters\": true\n}","name":""},{"code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":"","status":404,"language":"json"}]}},"category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:34:32.004Z","excerpt":"Get details about a specific link","githubsync":"","childrenPages":[]}

get/v1/links/:id

Get details about a specific link

Path Params

id:
required
string
Unique identifier of the branded short link you want to get details for

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details in [Getting link details](doc:get-link-details).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Getting link details](doc:get-link-details).
{"_id":"57cd85701e75f217006dce2b","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:47:12.753Z","hidden":false,"parentDoc":null,"updates":[],"version":"577d1b8b74aea422007230c7","api":{"url":"/v1/links/count","auth":"required","examples":{"codes":[]},"method":"get","params":[{"type":"boolean","name":"favourite","_id":"57ce8ad9065d9a0e00d47c8a","ref":"","in":"query","required":false,"desc":"Filter branded short links depnding on the favourite (loved) property","default":""},{"desc":"Filter branded short links depending on their status among `active` and `trashed`","default":"","type":"string","name":"status","_id":"57ce8ad9065d9a0e00d47c89","ref":"","in":"query","required":false},{"name":"domain.id","_id":"57ce8af75f5adc0e0075c683","ref":"","in":"query","required":false,"desc":"Filter branded short links which refer to a specific branded domain id","default":"","type":"string"},{"required":false,"type":"string","_id":"5926b06721e2930f001c189d","default":"","desc":"Which team id to filter links by. No team specified will select main account.","in":"header","name":"team","ref":""}],"results":{"codes":[{"code":"{\n    \"count\": 42\n}","language":"json","status":200,"name":""}]},"settings":""},"body":"More details at [Counting your links](doc:counting-your-links).","order":4,"project":"577d1b8b74aea422007230c4","excerpt":"Get how many links with given filtering conditions","githubsync":"","link_external":false,"link_url":"","title":"/v1/links/count","type":"get","user":"56b22f582d96461700599230","__v":3,"isReference":false,"next":{"description":"","pages":[]},"slug":"counting-links-endpoint","sync_unique":"","childrenPages":[]}

get/v1/links/count

Get how many links with given filtering conditions

Query Params

favourite:
boolean
Filter branded short links depnding on the favourite (loved) property
status:
string
Filter branded short links depending on their status among `active` and `trashed`
domain.id:
string
Filter branded short links which refer to a specific branded domain id

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details at [Counting your links](doc:counting-your-links).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Counting your links](doc:counting-your-links).
{"_id":"57ea648566130b1700056ec5","category":"57cd7c3267e1be1700c2856d","next":{"description":"","pages":[]},"parentDoc":null,"type":"get","api":{"auth":"required","examples":{"codes":[{"name":"Paste in your browser","language":"text","code":"https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&destination=http://google.com&domain[fullName]=rebrand.ly"}]},"method":"get","params":[{"_id":"57ea650474088b17002237db","ref":"","in":"query","required":true,"desc":"The destination URL you want your branded short link to point to","default":"","type":"string","name":"destination"},{"_id":"57ea650474088b17002237da","ref":"","in":"query","required":false,"desc":"The keyword portion of your branded short link","default":"","type":"string","name":"slashtag"},{"_id":"57ea650474088b17002237d9","ref":"","in":"query","required":false,"desc":"A title you assign to the branded short link in order to remember what's behind it","default":"","type":"string","name":"title"},{"_id":"57ea65e174088b17002237dc","ref":"","in":"query","required":false,"desc":"The unique id of the branded domain. If not specified, rebrand.ly is used","default":"","type":"string","name":"domain[id]"},{"_id":"57ea662bb9f45420005724d0","ref":"","in":"query","required":false,"desc":"The unique name of the branded domain, to be used in place of domain[id] in special cases. Precedence will be given to domain[id] value.","default":"","type":"string","name":"domain[fullName]"},{"_id":"5926b0926c729e0f005959e7","ref":"","in":"header","required":false,"desc":"Which team id to be used to create new links. No team specified will select main account.","default":"","type":"string","name":"team"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  }\n}\n"},{"status":403,"language":"json","code":"{\n  \"property\": \"slashtag\",\n  \"message\": \"Already exists\",\n  \"code\": \"AlreadyExists\"\n}\n","name":""},{"code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","language":"json","status":404}]},"settings":"","url":"/v1/links/new"},"hidden":false,"link_external":false,"order":5,"project":"577d1b8b74aea422007230c4","sync_unique":"","title":"/v1/links/new","excerpt":"Create a new link","githubsync":"","version":"577d1b8b74aea422007230c7","link_url":"","slug":"create-link-url","updates":["592c1d2d9bc0980f00276247"],"body":"","isReference":false,"user":"56b22f582d96461700599230","__v":9,"createdAt":"2016-09-27T12:22:29.674Z","childrenPages":[]}

get/v1/links/new

Create a new link

Query Params

destination:
required
string
The destination URL you want your branded short link to point to
slashtag:
string
The keyword portion of your branded short link
title:
string
A title you assign to the branded short link in order to remember what's behind it
domain[id]:
string
The unique id of the branded domain. If not specified, rebrand.ly is used
domain[fullName]:
string
The unique name of the branded domain, to be used in place of domain[id] in special cases. Precedence will be given to domain[id] value.

Headers

team:
string
Which team id to be used to create new links. No team specified will select main account.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"57cd88c667e1be1700c28579","sync_unique":"","createdAt":"2016-09-05T15:01:26.470Z","parentDoc":null,"slug":"create-link-endpoint","hidden":false,"order":6,"type":"post","updates":[],"__v":8,"api":{"method":"post","params":[{"_id":"57cd88c667e1be1700c2857e","ref":"","in":"body","required":true,"desc":"The destination URL you want your branded short link to point to","default":"","type":"string","name":"destination"},{"_id":"57cd88c667e1be1700c2857d","ref":"","in":"body","required":false,"desc":"The keyword portion of your branded short link","default":"","type":"string","name":"slashtag"},{"_id":"57cd88c667e1be1700c2857c","ref":"","in":"body","required":false,"desc":"A title you assign to the branded short link in order to remember what's behind it","default":"","type":"string","name":"title"},{"_id":"57cd890433cbfb2200e6cd5b","ref":"","in":"body","required":false,"desc":"A reference to the branded domain resource for this branded short link. If not set, http://rebrand.ly is used","default":"","type":"object","name":"domain"},{"_id":"5926b0c26c729e0f005959e8","ref":"","in":"header","required":false,"desc":"Which team id to be used to create links. No team specified will select main account.","default":"","type":"string","name":"team"}],"results":{"codes":[{"name":"","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  }\n}","language":"json","status":200},{"status":403,"language":"json","code":"{\n  \"property\": \"slashtag\",\n  \"message\": \"Already exists\",\n  \"code\": \"AlreadyExists\"\n}"},{"status":404,"code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","language":"json"}]},"settings":"","url":"/v1/links","auth":"required","examples":{"codes":[]}},"category":"57cd7c3267e1be1700c2856d","next":{"pages":[],"description":""},"project":"577d1b8b74aea422007230c4","user":"56b22f582d96461700599230","isReference":false,"link_external":false,"link_url":"","githubsync":"","title":"/v1/links","version":"577d1b8b74aea422007230c7","body":"","excerpt":"Create a new link","childrenPages":[]}

post/v1/links

Create a new link

Body Params

destination:
required
string
The destination URL you want your branded short link to point to
slashtag:
string
The keyword portion of your branded short link
title:
string
A title you assign to the branded short link in order to remember what's behind it
domain:
object
A reference to the branded domain resource for this branded short link. If not set, http://rebrand.ly is used

Headers

team:
string
Which team id to be used to create links. No team specified will select main account.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"57cd8c0d873de50e00724a55","user":"56b22f582d96461700599230","body":"More details at [Updating a link](doc:update-a-link).","hidden":false,"link_url":"","project":"577d1b8b74aea422007230c4","updates":[],"isReference":false,"link_external":false,"parentDoc":null,"sync_unique":"","order":7,"slug":"update-link-endpoint","type":"post","api":{"url":"/v1/links/:id","auth":"required","examples":{"codes":[]},"method":"post","params":[{"_id":"57cd8c2d4b5a7f1900899387","ref":"","in":"path","required":true,"desc":"Unique identifier of the branded short link you want to update","default":"","type":"string","name":"id"},{"_id":"57cd8c8a873de50e00724a57","ref":"","in":"body","required":true,"desc":"New title you want to assign to a branded short link","default":"","type":"string","name":"title"},{"_id":"57cd8c944b5a7f1900899388","ref":"","in":"body","required":true,"desc":"New destination URL you want to assign to a branded short link","default":"","type":"string","name":"destination"},{"_id":"5926b0ddc385770f00113415","ref":"","in":"header","required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team"}],"results":{"codes":[{"code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly?\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  }\n}","name":"","status":200,"language":"json"},{"status":403,"language":"json","code":"{\n  \"property\": \"slashtag\",\n  \"message\": \"Already exists\",\n  \"code\": \"AlreadyExists\"\n}","name":""},{"status":404,"language":"json","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":""},"category":"57cd7c3267e1be1700c2856d","excerpt":"Update a specific link","next":{"pages":[],"description":""},"__v":13,"createdAt":"2016-09-05T15:15:25.180Z","githubsync":"","title":"/v1/links/:id","version":"577d1b8b74aea422007230c7","childrenPages":[]}

post/v1/links/:id

Update a specific link

Path Params

id:
required
string
Unique identifier of the branded short link you want to update

Body Params

title:
required
string
New title you want to assign to a branded short link
destination:
required
string
New destination URL you want to assign to a branded short link

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details at [Updating a link](doc:update-a-link).

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Updating a link](doc:update-a-link).
{"_id":"59c10c0490de33001076c174","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"57cd7c3267e1be1700c2856d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T12:22:28.886Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","status":200,"name":"","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"title\": \"What is Rebrandly?\",\n  \"slashtag\": \"video\",\n  \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n  \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n  \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  }\n}"},{"status":404,"language":"text","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"method":"delete","examples":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"57cd8db567e1be1700c28583","ref":"","in":"path","required":true,"desc":"Unique identifier of the link you want to delete","default":"","type":"string","name":"id"},{"_id":"5926b0f121e2930f001c18a4","ref":"","in":"header","required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team"},{"_id":"59c10c0490de33001076c175","ref":"","in":"query","required":false,"desc":"Whether you want only to trash this link (true) or permanently delete it (false)","default":"false","type":"boolean","name":"trashed"}],"url":"/v1/links/:id"},"isReference":false,"order":8,"body":"More details at [Deleting a link](doc:delete-a-link).","excerpt":"Delete or trash a specific link","slug":"delete-link-endpoint","type":"delete","title":"/v1/links/:id","__v":1,"parentDoc":null,"childrenPages":[]}

delete/v1/links/:id

Delete or trash a specific link

Path Params

id:
required
string
Unique identifier of the link you want to delete

Query Params

trashed:
booleanfalse
Whether you want only to trash this link (true) or permanently delete it (false)

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details at [Deleting a link](doc:delete-a-link).

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Deleting a link](doc:delete-a-link).
{"_id":"57cd83b7873de50e00724a42","api":{"settings":"","url":"/v1/domains","auth":"required","examples":{"codes":[]},"method":"get","params":[{"desc":"Filter branded domains depending on whether they can be used to brand short links or not","default":"","type":"boolean","name":"active","_id":"57cd84411e75f217006dce1f","ref":"","in":"query","required":false},{"_id":"57cd84511e75f217006dce20","ref":"","in":"query","required":false,"desc":"Filter branded domains depending on their type (owned by user, `user`, or service domains like rebrand.ly, `service`)","default":"","type":"string","name":"type"},{"_id":"57cd83e567e1be1700c28572","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your branded domains collection among `createdAt`, `updatedAt` and `fullName`.","default":"createdAt","type":"string","name":"orderBy"},{"name":"orderDir","_id":"57cd84111e75f217006dce1d","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your branded short links collection among `desc` and `asc`.","default":"desc","type":"string"},{"type":"int","name":"offset","_id":"57cd842967e1be1700c28573","ref":"","in":"query","required":false,"desc":"How many branded domains to skip","default":"0"},{"desc":"How many branded domains to load, starting from offset on","default":"100","type":"int","name":"limit","_id":"57cd84345f5adc0e0075c5dd","ref":"","in":"query","required":false},{"_id":"5926b102c385770f00113416","ref":"","in":"header","required":false,"desc":"Which team id to filter domains by. No team specified will select main account.","default":"","type":"string","name":"team"}],"results":{"codes":[{"code":"[\n  {\n    \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n    \"fullName\": \"brand.cool\",\n    \"topLevelDomain\": \"cool\",\n    \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n    \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n    \"type\": \"user\",\n    \"active\": false\n  },\n  ...\n]","language":"json","status":200,"name":""}]}},"excerpt":"Get a list of domains","hidden":false,"link_external":false,"project":"577d1b8b74aea422007230c4","updates":[],"category":"57cd7c3267e1be1700c2856d","order":9,"parentDoc":null,"type":"get","user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","__v":8,"isReference":false,"next":{"description":"","pages":[]},"sync_unique":"","body":"More details at [Listing your domains](doc:listing-your-domains-collection).","createdAt":"2016-09-05T14:39:51.819Z","githubsync":"","link_url":"","slug":"domains-list-endpoint","title":"/v1/domains","childrenPages":[]}

get/v1/domains

Get a list of domains

Query Params

active:
boolean
Filter branded domains depending on whether they can be used to brand short links or not
type:
string
Filter branded domains depending on their type (owned by user, `user`, or service domains like rebrand.ly, `service`)
orderBy:
stringcreatedAt
Sorting criteria to apply to your branded domains collection among `createdAt`, `updatedAt` and `fullName`.
orderDir:
stringdesc
Sorting direction to apply to your branded short links collection among `desc` and `asc`.
offset:
integer0
How many branded domains to skip
limit:
integer100
How many branded domains to load, starting from offset on

Headers

team:
string
Which team id to filter domains by. No team specified will select main account.
More details at [Listing your domains](doc:listing-your-domains-collection).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Listing your domains](doc:listing-your-domains-collection).
{"_id":"57cd85425f5adc0e0075c5e1","hidden":false,"link_external":false,"parentDoc":null,"title":"/v1/domains/:id","updates":[],"__v":1,"githubsync":"","next":{"pages":[],"description":""},"order":10,"sync_unique":"","version":"577d1b8b74aea422007230c7","api":{"settings":"","url":"/v1/domains/:id","auth":"required","examples":{"codes":[]},"method":"get","params":[{"required":true,"desc":"Unique identifier of the branded domain you want to get details about","default":"","type":"string","name":"id","_id":"57cd85425f5adc0e0075c5e2","ref":"","in":"path"},{"ref":"","in":"header","required":false,"desc":"Which team id to filter domains by. No team specified will select main account.","default":"","type":"string","name":"team","_id":"5926b10c21e2930f001c18c5"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n  \"fullName\": \"brand.cool\",\n  \"topLevelDomain\": \"cool\",\n  \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n  \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n  \"type\": \"user\",\n  \"active\": false\n}"},{"status":404,"language":"json","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":""}]}},"category":"57cd7c3267e1be1700c2856d","excerpt":"Get details about a specific domain","link_url":"","project":"577d1b8b74aea422007230c4","slug":"domain-details-endpoint","user":"56b22f582d96461700599230","body":"More details at [Getting domain details](doc:getting-single-domain-details).","createdAt":"2016-09-05T14:46:26.073Z","isReference":false,"type":"get","childrenPages":[]}

get/v1/domains/:id

Get details about a specific domain

Path Params

id:
required
string
Unique identifier of the branded domain you want to get details about

Headers

team:
string
Which team id to filter domains by. No team specified will select main account.
More details at [Getting domain details](doc:getting-single-domain-details).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Getting domain details](doc:getting-single-domain-details).
{"_id":"57cd86495f5adc0e0075c5e5","body":"More details at [Counting your domains](doc:counting-your-domains).","excerpt":"Get how many domains with given filtering conditions","isReference":false,"next":{"description":"","pages":[]},"sync_unique":"","title":"/v1/domains/count","__v":2,"hidden":false,"link_url":"","version":"577d1b8b74aea422007230c7","githubsync":"","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"required":false,"desc":"Filter branded domains depending on whether they can be used to branded short links or not","default":"","type":"boolean","name":"active","_id":"57ce8b2a07d7ea0e00e43884","ref":"","in":"query"},{"ref":"","in":"query","required":false,"desc":"Filter branded domains depending on their type (own by `user` or `service` domains like rebrand.ly)","default":"","type":"string","name":"type","_id":"57ce8b2a07d7ea0e00e43883"},{"in":"header","required":false,"desc":"Which team id to filter domains by. No team specified will select main account.","default":"","type":"string","name":"team","_id":"5926b118c4ee340f001275de","ref":""}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"count\": 42\n}","name":""}]},"settings":"","url":"/v1/domains/count"},"category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:50:49.333Z","link_external":false,"order":11,"parentDoc":null,"project":"577d1b8b74aea422007230c4","user":"56b22f582d96461700599230","type":"get","updates":[],"slug":"count-domains-endpoint","childrenPages":[]}

get/v1/domains/count

Get how many domains with given filtering conditions

Query Params

active:
boolean
Filter branded domains depending on whether they can be used to branded short links or not
type:
string
Filter branded domains depending on their type (own by `user` or `service` domains like rebrand.ly)

Headers

team:
string
Which team id to filter domains by. No team specified will select main account.
More details at [Counting your domains](doc:counting-your-domains).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Counting your domains](doc:counting-your-domains).
{"_id":"59c38cf212b8c2001c22bd07","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:57:06.286Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"","excerpt":"","slug":"advanced-api-explorer","type":"basic","title":"Advanced API Explorer","__v":0,"parentDoc":null,"childrenPages":[]}

Advanced API Explorer


{"_id":"5925b480ce73282700d28287","createdAt":"2017-05-24T16:27:44.290Z","hidden":false,"title":"/v1/account/teams","__v":3,"api":{"examples":{"codes":[]},"method":"get","params":[{"_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many branded short links to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many branded short links to load, starting from offset on","default":"100","type":"int","name":"limit"}],"results":{"codes":[{"status":200,"language":"json","code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Marketing\",\n  \"avatarUrl\": \"http://avatar-url-here.com\",\n  \"links\": 153,\n  \"teammates\": 5,\n  \"domains\": 2,\n  \"owner\": false,\n  \"createdAt\": \"2017-05-23T10:54:12.000Z\",\n  \"updatedAt\": \"2017-05-23T10:05:22.000Z\"\n },\n ...\n]","name":""},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","url":"/v1/account/teams","auth":"required"},"excerpt":"Get all teams you are part of","githubsync":"","isReference":false,"updates":[],"version":"577d1b8b74aea422007230c7","next":{"pages":[],"description":""},"order":1,"project":"577d1b8b74aea422007230c4","user":"577d1b6d87acf617003c421d","body":"","category":"59c38cd5b2b45c0010b7b7f4","link_external":false,"link_url":"","parentDoc":null,"slug":"list-teams-endpoint","sync_unique":"","type":"get","childrenPages":[]}

get/v1/account/teams

Get all teams you are part of

Query Params

offset:
integer0
How many branded short links to skip
limit:
integer100
How many branded short links to load, starting from offset on

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"59c1094ed9801400265454ac","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T12:10:54.856Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","examples":{"codes":[]},"settings":"","results":{"codes":[{"code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n },\n ...\n]","name":"","status":200,"language":"json"},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"auth":"required","params":[{"_id":"57cd7f134b5a7f1900899379","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your tags collection. The only available option is by `name` property.","default":"name","type":"string","name":"orderBy"},{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your tags collection","default":"desc","type":"string","name":"orderDir"},{"_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many tags to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many tags to load, starting from offset on","default":"100","type":"int","name":"limit"},{"_id":"5926b02fc4ee340f001275dc","ref":"","in":"header","required":false,"desc":"Which team id to filter tags by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/tags"},"isReference":false,"order":2,"body":"More details in [Listing your tags](doc:listing-your-tags).","excerpt":"Get a list of tags","slug":"tags-list-endpoint","type":"get","title":"/v1/tags","__v":1,"parentDoc":null,"childrenPages":[]}

get/v1/tags

Get a list of tags

Query Params

orderBy:
stringname
Sorting criteria to apply to your tags collection. The only available option is by `name` property.
orderDir:
stringdesc
Sorting direction to apply to your tags collection
offset:
integer0
How many tags to skip
limit:
integer100
How many tags to load, starting from offset on

Headers

team:
string
Which team id to filter tags by. No team specified will select main account.
More details in [Listing your tags](doc:listing-your-tags).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Listing your tags](doc:listing-your-tags).
{"_id":"59c10a2555166d00301e5ce6","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T12:14:29.175Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n}","name":""},{"code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":"","status":404,"language":"json"}]},"method":"get","examples":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"57cd82955f5adc0e0075c5d8","ref":"","in":"path","required":true,"desc":"Unique identifier of the tag you want to get details for","default":"","type":"string","name":"id"},{"_id":"5926b052c4ee340f001275dd","ref":"","in":"header","required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/tags/:id"},"isReference":false,"order":3,"body":"More details in [Getting tag details](doc:getting-tag-details).","excerpt":"Get details about a specific tag","slug":"tag-details-endpoint","type":"get","title":"/v1/tags/:id","__v":1,"parentDoc":null,"childrenPages":[]}

get/v1/tags/:id

Get details about a specific tag

Path Params

id:
required
string
Unique identifier of the tag you want to get details for

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details in [Getting tag details](doc:getting-tag-details).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Getting tag details](doc:getting-tag-details).
{"_id":"59c10ab590de33001076c0a1","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T12:16:53.573Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"settings":"","results":{"codes":[{"name":"","code":"{\n\t\"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n}","language":"json","status":200}]},"method":"post","auth":"required","params":[{"_id":"57cd88c667e1be1700c2857e","ref":"","in":"body","required":true,"desc":"The name you want to associated to the tag","default":"","type":"string","name":"name"},{"_id":"57cd88c667e1be1700c2857d","ref":"","in":"body","required":true,"desc":"The hexadecimal code for a color you want to assign to the tag","default":"","type":"string","name":"color"},{"_id":"5926b0c26c729e0f005959e8","ref":"","in":"header","required":false,"desc":"Which team id to be used to create tags. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/tags"},"isReference":false,"order":4,"body":"","excerpt":"Create a new tag","slug":"create-tag-endpoint","type":"post","title":"/v1/tags","__v":2,"parentDoc":null,"childrenPages":[]}

post/v1/tags

Create a new tag

Body Params

name:
required
string
The name you want to associated to the tag
color:
required
string
The hexadecimal code for a color you want to assign to the tag

Headers

team:
string
Which team id to be used to create tags. No team specified will select main account.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"59c3892d2262d50032e94c95","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:41:01.727Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"name":"","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n}","language":"json","status":200}]},"settings":"","examples":{"codes":[]},"auth":"required","params":[{"_id":"57cd88c667e1be1700c2857e","ref":"","in":"body","required":true,"desc":"The new name you want to associated to the tag","default":"","type":"string","name":"name"},{"_id":"57cd88c667e1be1700c2857d","ref":"","in":"body","required":true,"desc":"The hexadecimal code for a new color you want to assign to the tag","default":"","type":"string","name":"color"},{"_id":"5926b0c26c729e0f005959e8","ref":"","in":"header","required":false,"desc":"The team unique identifier of the team where the tag has been created. If the tag is in the main account, no team header must be specified.","default":"","type":"string","name":"team"},{"_id":"59c3892d2262d50032e94c96","ref":"","in":"path","required":true,"desc":"Unique identifier of the Tag resource you want to update","default":"","type":"string","name":"id"}],"url":"/v1/tags/:id"},"isReference":false,"order":5,"body":"","excerpt":"Update a tag","slug":"update-tag-endpoint","type":"post","title":"/v1/tags/:id","__v":1,"parentDoc":null,"childrenPages":[]}

post/v1/tags/:id

Update a tag

Path Params

id:
required
string
Unique identifier of the Tag resource you want to update

Body Params

name:
required
string
The new name you want to associated to the tag
color:
required
string
The hexadecimal code for a new color you want to assign to the tag

Headers

team:
string
The team unique identifier of the team where the tag has been created. If the tag is in the main account, no team header must be specified.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"59c10ae6d9801400265454eb","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T12:17:42.381Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"code":"{\n    \"count\": 42\n}","language":"json","status":200,"name":""}]},"method":"get","examples":{"codes":[]},"auth":"required","params":[{"_id":"5926b06721e2930f001c189d","ref":"","in":"header","required":false,"desc":"Which team id to filter tags by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/tags/count"},"isReference":false,"order":6,"body":"More details at [Counting your tags](doc:counting-your-tags).","excerpt":"Get how many tags with given filtering conditions","slug":"count-tags-endpoint","type":"get","title":"/v1/tags/count","__v":1,"parentDoc":null,"childrenPages":[]}

get/v1/tags/count

Get how many tags with given filtering conditions

Headers

team:
string
Which team id to filter tags by. No team specified will select main account.
More details at [Counting your tags](doc:counting-your-tags).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Counting your tags](doc:counting-your-tags).
{"_id":"59c38513b2b45c0010b7b67d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:23:31.894Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n },\n ...\n]","name":"","status":200,"language":"json"},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","examples":{"codes":[]},"method":"get","auth":"required","params":[{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your tags collection","default":"","type":"string","name":"orderDir"},{"_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many tags to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many tags to load, starting from offset on","default":"100","type":"int","name":"limit"},{"_id":"5926b02fc4ee340f001275dc","ref":"","in":"header","required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team"},{"_id":"59c3859d185f99001034e276","ref":"","in":"path","required":false,"desc":"Unique identifier of the Link resource","default":"","type":"string","name":"id"},{"_id":"59c3859d185f99001034e275","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your tags collection. The only available option is by `name` property.","default":"","type":"string","name":"orderBy"}],"url":"/v1/links/:id/tags"},"isReference":false,"order":7,"body":"More details in [Listing your tags](doc:listing-your-tags).","excerpt":"Get all tags attached to a specific link","slug":"list-tags-of-link","type":"get","title":"/v1/links/:id/tags","__v":5,"parentDoc":null,"childrenPages":[]}

get/v1/links/:id/tags

Get all tags attached to a specific link

Path Params

id:
string
Unique identifier of the Link resource

Query Params

orderDir:
string
Sorting direction to apply to your tags collection
offset:
integer0
How many tags to skip
limit:
integer100
How many tags to load, starting from offset on
orderBy:
string
Sorting criteria to apply to your tags collection. The only available option is by `name` property.

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details in [Listing your tags](doc:listing-your-tags).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Listing your tags](doc:listing-your-tags).
{"_id":"57cd8db567e1be1700c28582","api":{"settings":"","url":"/v1/tags/:id","auth":"required","examples":{"codes":[]},"method":"delete","params":[{"_id":"57cd8db567e1be1700c28583","ref":"","in":"path","required":true,"desc":"Unique identifier of the tag you want to delete","default":"","type":"string","name":"id"},{"_id":"5926b0f121e2930f001c18a4","ref":"","in":"header","required":false,"desc":"Which team id to filter tags by. No team specified will select main account.","default":"","type":"string","name":"team"}],"results":{"codes":[{"language":"json","status":200,"name":"","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"promo\",\n  \"color\": \"FF0044\"\n}"},{"status":404,"language":"text","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]}},"excerpt":"Delete a specific tag","hidden":false,"next":{"description":"","pages":[]},"project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","body":"More details at [Deleting a tag](doc:deleting-a-tag).","link_external":false,"parentDoc":null,"title":"/v1/tags/:id","type":"delete","user":"56b22f582d96461700599230","__v":6,"githubsync":"","isReference":false,"order":8,"slug":"delete-tag-endpoint","sync_unique":"","category":"59c38cd5b2b45c0010b7b7f4","createdAt":"2016-09-05T15:22:29.991Z","link_url":"","updates":[],"childrenPages":[]}

delete/v1/tags/:id

Delete a specific tag

Path Params

id:
required
string
Unique identifier of the tag you want to delete

Headers

team:
string
Which team id to filter tags by. No team specified will select main account.
More details at [Deleting a tag](doc:deleting-a-tag).

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Deleting a tag](doc:deleting-a-tag).
{"_id":"59c3869d185f99001034e289","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:30:05.153Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n },\n ...\n]","name":"","status":200,"language":"json"},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","examples":{"codes":[]},"method":"get","auth":"required","params":[{"_id":"57cd7f134b5a7f1900899379","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your scripts collection. The only available option is by `name` property.","default":"name","type":"string","name":"orderBy"},{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your scripts collection","default":"desc","type":"string","name":"orderDir"},{"_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many scripts to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many scripts to load, starting from offset on","default":"100","type":"int","name":"limit"},{"_id":"5926b02fc4ee340f001275dc","ref":"","in":"header","required":false,"desc":"Which team id to filter scripts by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/scripts"},"isReference":false,"order":9,"body":"More details in [Listing your scripts](doc:listing-your-scripts)","excerpt":"Get a list of scripts","slug":"scripts-list-endpoint","type":"get","title":"/v1/scripts","__v":3,"parentDoc":null,"childrenPages":[]}

get/v1/scripts

Get a list of scripts

Query Params

orderBy:
stringname
Sorting criteria to apply to your scripts collection. The only available option is by `name` property.
orderDir:
stringdesc
Sorting direction to apply to your scripts collection
offset:
integer0
How many scripts to skip
limit:
integer100
How many scripts to load, starting from offset on

Headers

team:
string
Which team id to filter scripts by. No team specified will select main account.
More details in [Listing your scripts](doc:listing-your-scripts)

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Listing your scripts](doc:listing-your-scripts)
{"_id":"59c3895ec65b90001a662398","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:41:50.493Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n}","name":""}]},"method":"post","auth":"required","params":[{"_id":"57cd88c667e1be1700c2857e","ref":"","in":"body","required":true,"desc":"The new name you want to associate to the script","default":"","type":"string","name":"name"},{"_id":"57cd88c667e1be1700c2857d","ref":"","in":"body","required":true,"desc":"The new javascript snippet (including <script> and </script>) for the script","default":"","type":"string","name":"value"},{"_id":"5926b0c26c729e0f005959e8","ref":"","in":"header","required":false,"desc":"The team unique identifier of the team where the script has been created. If the script is in the main account, no team header must be specified.","default":"","type":"string","name":"team"},{"_id":"59c3892d2262d50032e94c96","ref":"","in":"path","required":true,"desc":"Unique identifier of the Script resource you want to update","default":"","type":"string","name":"id"}],"url":"/v1/scripts/:id"},"isReference":false,"order":10,"body":"","excerpt":"Update a script","slug":"update-script-endpoint","type":"post","title":"/v1/scripts/:id","__v":3,"parentDoc":null,"childrenPages":[]}

post/v1/scripts/:id

Update a script

Path Params

id:
required
string
Unique identifier of the Script resource you want to update

Body Params

name:
required
string
The new name you want to associate to the script
value:
required
string
The new javascript snippet (including <script> and </script>) for the script

Headers

team:
string
The team unique identifier of the team where the script has been created. If the script is in the main account, no team header must be specified.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"59c386f8185f99001034e2d6","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:31:36.973Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[]},"method":"get","results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n}","name":""},{"code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":"","status":404,"language":"json"}]},"auth":"required","params":[{"_id":"57cd82955f5adc0e0075c5d8","ref":"","in":"path","required":true,"desc":"Unique identifier of the script you want to get details for","default":"","type":"string","name":"id"},{"_id":"5926b052c4ee340f001275dd","ref":"","in":"header","required":false,"desc":"Which team id to filter scripts by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/scripts/:id"},"isReference":false,"order":11,"body":"More details in [Getting script details](doc:getting-script-details)","excerpt":"Get details about a specific script","slug":"script-details-endpoint","type":"get","title":"/v1/scripts/:id","__v":2,"parentDoc":null,"childrenPages":[]}

get/v1/scripts/:id

Get details about a specific script

Path Params

id:
required
string
Unique identifier of the script you want to get details for

Headers

team:
string
Which team id to filter scripts by. No team specified will select main account.
More details in [Getting script details](doc:getting-script-details)

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Getting script details](doc:getting-script-details)
{"_id":"59c3873c185f99001034e2e9","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:32:44.887Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"name":"","code":"{\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n}","language":"json","status":200}]},"settings":"","examples":{"codes":[]},"auth":"required","params":[{"_id":"57cd88c667e1be1700c2857e","ref":"","in":"body","required":true,"desc":"The name you want to associated to the script","default":"","type":"string","name":"name"},{"_id":"57cd88c667e1be1700c2857d","ref":"","in":"body","required":true,"desc":"A javascript snippet (including <script> and </script> HTML tags)","default":"","type":"string","name":"value"},{"_id":"5926b0c26c729e0f005959e8","ref":"","in":"header","required":false,"desc":"Which team id to be used to create scripts. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/scripts"},"isReference":false,"order":12,"body":"","excerpt":"Create a new script","slug":"create-script-endpoint","type":"post","title":"/v1/scripts","__v":1,"parentDoc":null,"childrenPages":[]}

post/v1/scripts

Create a new script

Body Params

name:
required
string
The name you want to associated to the script
value:
required
string
A javascript snippet (including <script> and </script> HTML tags)

Headers

team:
string
Which team id to be used to create scripts. No team specified will select main account.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



{"_id":"59c38756c65b90001a662383","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:33:10.316Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"{\n    \"count\": 42\n}","language":"json","status":200,"name":""}]},"settings":"","auth":"required","params":[{"_id":"5926b06721e2930f001c189d","ref":"","in":"header","required":false,"desc":"Which team id to filter scripts by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/scripts/count"},"isReference":false,"order":13,"body":"More details at [Counting your scripts](doc:counting-your-scripts)","excerpt":"Get how many scripts with given filtering conditions","slug":"count-scripts-endpoint","type":"get","title":"/v1/scripts/count","__v":2,"parentDoc":null,"childrenPages":[]}

get/v1/scripts/count

Get how many scripts with given filtering conditions

Headers

team:
string
Which team id to filter scripts by. No team specified will select main account.
More details at [Counting your scripts](doc:counting-your-scripts)

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Counting your scripts](doc:counting-your-scripts)
{"_id":"59c387742262d50032e94c85","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:33:40.152Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","status":200,"name":"","code":"{\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n}"},{"status":404,"language":"text","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"method":"delete","examples":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"57cd8db567e1be1700c28583","ref":"","in":"path","required":true,"desc":"Unique identifier of the script you want to delete","default":"","type":"string","name":"id"},{"_id":"5926b0f121e2930f001c18a4","ref":"","in":"header","required":false,"desc":"Which team id to filter scripts by. No team specified will select main account.","default":"","type":"string","name":"team"}],"url":"/v1/scripts/:id"},"isReference":false,"order":14,"body":"More details at [Deleting a script](doc:deleting-a-script)","excerpt":"Delete a specific script","slug":"delete-script-endpoint","type":"delete","title":"/v1/scripts/:id","__v":2,"parentDoc":null,"childrenPages":[]}

delete/v1/scripts/:id

Delete a specific script

Path Params

id:
required
string
Unique identifier of the script you want to delete

Headers

team:
string
Which team id to filter scripts by. No team specified will select main account.
More details at [Deleting a script](doc:deleting-a-script)

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details at [Deleting a script](doc:deleting-a-script)
{"_id":"59c385fab2b45c0010b7b68e","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c38cd5b2b45c0010b7b7f4","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:27:22.018Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","examples":{"codes":[]},"settings":"","results":{"codes":[{"language":"json","status":200,"name":"","code":"[\n {\n  \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n  \"name\": \"Test alert\",\n  \"value\": \"<script>alert('test');</script>\"\n },\n ...\n]"},{"code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","language":"json","status":404}]},"auth":"required","params":[{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your scripts collection","default":"","type":"string","name":"orderDir"},{"_id":"57cd7f5b67e1be1700c2856e","ref":"","in":"query","required":false,"desc":"How many scripts to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd7f68873de50e00724a3d","ref":"","in":"query","required":false,"desc":"How many scripts to load, starting from offset on","default":"100","type":"int","name":"limit"},{"_id":"5926b02fc4ee340f001275dc","ref":"","in":"header","required":false,"desc":"Which team id to filter links by. No team specified will select main account.","default":"","type":"string","name":"team"},{"_id":"59c3859d185f99001034e276","ref":"","in":"path","required":false,"desc":"Unique identifier of the Link resource","default":"","type":"string","name":"id"},{"_id":"59c3859d185f99001034e275","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your scripts collection. The only available option is by `name` property.","default":"","type":"string","name":"orderBy"}],"url":"/v1/links/:id/scripts"},"isReference":false,"order":15,"body":"More details in [Listing your scripts](doc:listing-your-scripts)","excerpt":"Get all scripts attached to a specific link","slug":"list-scripts-of-link","type":"get","title":"/v1/links/:id/scripts","__v":6,"parentDoc":null,"childrenPages":[]}

get/v1/links/:id/scripts

Get all scripts attached to a specific link

Path Params

id:
string
Unique identifier of the Link resource

Query Params

orderDir:
string
Sorting direction to apply to your scripts collection
offset:
integer0
How many scripts to skip
limit:
integer100
How many scripts to load, starting from offset on
orderBy:
string
Sorting criteria to apply to your scripts collection. The only available option is by `name` property.

Headers

team:
string
Which team id to filter links by. No team specified will select main account.
More details in [Listing your scripts](doc:listing-your-scripts)

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



More details in [Listing your scripts](doc:listing-your-scripts)
{"_id":"5791f3704973f50e00f07687","title":"Model overview","api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"category":"5791e88c4973f50e00f07683","excerpt":"","link_url":"","type":"basic","createdAt":"2016-07-22T10:20:32.173Z","isReference":false,"link_external":false,"order":0,"slug":"model-overview","sync_unique":"","updates":["5793ebf87d1e4a0e00346080"],"__v":2,"body":"The API is organized around the following resources:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Model\",\n    \"h-1\": \"Base endpoint\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"Link\",\n    \"0-1\": \"/links\",\n    \"0-2\": \"Manage your branded short links collection.\",\n    \"1-0\": \"Domain\",\n    \"1-1\": \"/domains\",\n    \"1-2\": \"Manage your branded domains collection.\",\n    \"2-0\": \"Account\",\n    \"2-1\": \"/account\",\n    \"2-2\": \"Get info about your own account.\",\n    \"3-0\": \"Tag\",\n    \"3-1\": \"/tags\",\n    \"3-2\": \"Manage a collection of tags you can attach to your links.\",\n    \"4-0\": \"Script\",\n    \"4-1\": \"/scripts\",\n    \"4-2\": \"Manage a collection of retargeting scripts you can attach to your links.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\nAll endpoints return JSON responses.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Types\"\n}\n[/block]\nTypes in objects are defined as follow:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type name\",\n    \"h-1\": \"Type description\",\n    \"1-0\": \"string\",\n    \"1-1\": \"UTF8 string\",\n    \"2-0\": \"integer\",\n    \"2-1\": \"64-bit integer\",\n    \"3-0\": \"boolean\",\n    \"h-2\": \"Example\",\n    \"1-2\": \"\\\"foo\\\"\",\n    \"2-2\": \"42\",\n    \"3-1\": \"Boolean\",\n    \"3-2\": \"true\",\n    \"4-0\": \"timestamp\",\n    \"4-1\": \"String with format:\\n\\\"YYYY-MM-ddTHH:mm:ss.mmmZ\\\"\",\n    \"4-2\": \"\\\"2016-07-03T13:13:12.123Z\\\"\",\n    \"5-0\": \"array of string\",\n    \"5-1\": \"CSV string\",\n    \"5-2\": \"\\\"desc,asc\\\"\",\n    \"6-0\": \"decimal\",\n    \"6-1\": \"Floating point number\",\n    \"6-2\": \"3.4\",\n    \"0-0\": \"object\",\n    \"0-1\": \"Generic Rebrandly API model\",\n    \"0-2\": \"A [Domain](doc:branded-domain-model) object\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"General approaches\"\n}\n[/block]\nThe API also uses common approaches for the following:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Concept\",\n    \"h-1\": \"Solution\",\n    \"0-0\": \"Response data\",\n    \"0-1\": \"All responses are JSON encoded with utf-8.\\nA response can be an object, a list of objects, or a primitive value.\",\n    \"1-0\": \"Authorization layer\",\n    \"1-1\": \"All endpoints are protected with OAuth2 authorization. No API key access is provided.\",\n    \"3-0\": \"Successful operation\",\n    \"3-1\": \"HTTP 200 responses returning JSON objects\",\n    \"4-0\": \"Invalid operation\",\n    \"4-1\": \"HTTP 403 responses with JSON validation info\",\n    \"5-0\": \"Unauthorized operation\",\n    \"5-1\": \"HTTP 401 response\",\n    \"7-0\": \"Server error\",\n    \"7-1\": \"HTTP 50x response with JSON details\",\n    \"2-0\": \"HTTP/HTTPS\",\n    \"2-1\": \"Methods are used in accordance with HTTP (GET POST, PATCH and DELETE are the only methods used) and resources are identified using URIs.\",\n    \"6-0\": \"API rate exceeded\",\n    \"6-1\": \"HTTP 429 response\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]","githubsync":"","hidden":false,"parentDoc":null,"project":"577d1b8b74aea422007230c4","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","next":{"description":"","pages":[]},"childrenPages":[]}

Model overview


The API is organized around the following resources: [block:parameters] { "data": { "h-0": "Model", "h-1": "Base endpoint", "h-2": "Description", "0-0": "Link", "0-1": "/links", "0-2": "Manage your branded short links collection.", "1-0": "Domain", "1-1": "/domains", "1-2": "Manage your branded domains collection.", "2-0": "Account", "2-1": "/account", "2-2": "Get info about your own account.", "3-0": "Tag", "3-1": "/tags", "3-2": "Manage a collection of tags you can attach to your links.", "4-0": "Script", "4-1": "/scripts", "4-2": "Manage a collection of retargeting scripts you can attach to your links." }, "cols": 3, "rows": 5 } [/block] All endpoints return JSON responses. [block:api-header] { "type": "basic", "title": "Types" } [/block] Types in objects are defined as follow: [block:parameters] { "data": { "h-0": "Type name", "h-1": "Type description", "1-0": "string", "1-1": "UTF8 string", "2-0": "integer", "2-1": "64-bit integer", "3-0": "boolean", "h-2": "Example", "1-2": "\"foo\"", "2-2": "42", "3-1": "Boolean", "3-2": "true", "4-0": "timestamp", "4-1": "String with format:\n\"YYYY-MM-ddTHH:mm:ss.mmmZ\"", "4-2": "\"2016-07-03T13:13:12.123Z\"", "5-0": "array of string", "5-1": "CSV string", "5-2": "\"desc,asc\"", "6-0": "decimal", "6-1": "Floating point number", "6-2": "3.4", "0-0": "object", "0-1": "Generic Rebrandly API model", "0-2": "A [Domain](doc:branded-domain-model) object" }, "cols": 3, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "General approaches" } [/block] The API also uses common approaches for the following: [block:parameters] { "data": { "h-0": "Concept", "h-1": "Solution", "0-0": "Response data", "0-1": "All responses are JSON encoded with utf-8.\nA response can be an object, a list of objects, or a primitive value.", "1-0": "Authorization layer", "1-1": "All endpoints are protected with OAuth2 authorization. No API key access is provided.", "3-0": "Successful operation", "3-1": "HTTP 200 responses returning JSON objects", "4-0": "Invalid operation", "4-1": "HTTP 403 responses with JSON validation info", "5-0": "Unauthorized operation", "5-1": "HTTP 401 response", "7-0": "Server error", "7-1": "HTTP 50x response with JSON details", "2-0": "HTTP/HTTPS", "2-1": "Methods are used in accordance with HTTP (GET POST, PATCH and DELETE are the only methods used) and resources are identified using URIs.", "6-0": "API rate exceeded", "6-1": "HTTP 429 response" }, "cols": 2, "rows": 8 } [/block]
The API is organized around the following resources: [block:parameters] { "data": { "h-0": "Model", "h-1": "Base endpoint", "h-2": "Description", "0-0": "Link", "0-1": "/links", "0-2": "Manage your branded short links collection.", "1-0": "Domain", "1-1": "/domains", "1-2": "Manage your branded domains collection.", "2-0": "Account", "2-1": "/account", "2-2": "Get info about your own account.", "3-0": "Tag", "3-1": "/tags", "3-2": "Manage a collection of tags you can attach to your links.", "4-0": "Script", "4-1": "/scripts", "4-2": "Manage a collection of retargeting scripts you can attach to your links." }, "cols": 3, "rows": 5 } [/block] All endpoints return JSON responses. [block:api-header] { "type": "basic", "title": "Types" } [/block] Types in objects are defined as follow: [block:parameters] { "data": { "h-0": "Type name", "h-1": "Type description", "1-0": "string", "1-1": "UTF8 string", "2-0": "integer", "2-1": "64-bit integer", "3-0": "boolean", "h-2": "Example", "1-2": "\"foo\"", "2-2": "42", "3-1": "Boolean", "3-2": "true", "4-0": "timestamp", "4-1": "String with format:\n\"YYYY-MM-ddTHH:mm:ss.mmmZ\"", "4-2": "\"2016-07-03T13:13:12.123Z\"", "5-0": "array of string", "5-1": "CSV string", "5-2": "\"desc,asc\"", "6-0": "decimal", "6-1": "Floating point number", "6-2": "3.4", "0-0": "object", "0-1": "Generic Rebrandly API model", "0-2": "A [Domain](doc:branded-domain-model) object" }, "cols": 3, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "General approaches" } [/block] The API also uses common approaches for the following: [block:parameters] { "data": { "h-0": "Concept", "h-1": "Solution", "0-0": "Response data", "0-1": "All responses are JSON encoded with utf-8.\nA response can be an object, a list of objects, or a primitive value.", "1-0": "Authorization layer", "1-1": "All endpoints are protected with OAuth2 authorization. No API key access is provided.", "3-0": "Successful operation", "3-1": "HTTP 200 responses returning JSON objects", "4-0": "Invalid operation", "4-1": "HTTP 403 responses with JSON validation info", "5-0": "Unauthorized operation", "5-1": "HTTP 401 response", "7-0": "Server error", "7-1": "HTTP 50x response with JSON details", "2-0": "HTTP/HTTPS", "2-1": "Methods are used in accordance with HTTP (GET POST, PATCH and DELETE are the only methods used) and resources are identified using URIs.", "6-0": "API rate exceeded", "6-1": "HTTP 429 response" }, "cols": 2, "rows": 8 } [/block]
{"_id":"5790f8a2affd0429005fedfc","next":{"description":"","pages":[]},"slug":"link-entity","version":"577d1b8b74aea422007230c7","api":{"auth":"required","examples":{"codes":[]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"[block:textarea]\n{\n  \"text\": \"Example Link Object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  {\\n    \\\"id\\\": \\\"ffs24cc5b6ee4a5gh7897b06ac2d16d4\\\",\\n    \\\"title\\\": \\\"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\\\",\\n    \\\"slashtag\\\": \\\"burn10M\\\",\\n    \\\"destination\\\": \\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\",\\n    \\\"shortUrl\\\": \\\"rebrand.ly/burn10M\\\",\\n    \\\"domain\\\": {\\n      \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n      \\\"fullName\\\": \\\"rebrand.ly\\\"\\n    },\\n    \\\"status\\\": \\\"active\\\",\\n    \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"clicks\\\": 42,\\n    \\\"lastClickAt\\\": \\\"2016-07-13T10:55:13.000Z\\\",\\n    \\\"favourite\\\": false\\n  }\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n## Link Object\nMain properties of a Link object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"1-0\": \"title\",\n    \"1-1\": \"string\",\n    \"1-2\": \"A title you assign to the branded short link in order to remember what's behind it\",\n    \"2-0\": \"slashtag\",\n    \"2-1\": \"string\",\n    \"2-2\": \"The keyword section of your branded short link\",\n    \"3-0\": \"destination\",\n    \"3-1\": \"string\",\n    \"3-2\": \"The destination URL you want your branded short link to point to\",\n    \"5-0\": \"domain\",\n    \"5-1\": \"[Domain Reference](doc:entity-references) object\",\n    \"5-2\": \"A reference to the branded domain's resource of a branded short link\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier associated with the branded short link\",\n    \"7-0\": \"createdAt\",\n    \"7-1\": \"timestamp\",\n    \"7-2\": \"The UTC date/time this branded short link was created\",\n    \"8-0\": \"updatedAt\",\n    \"8-1\": \"timestamp\",\n    \"8-2\": \"The last UTC date/time this branded short link was updated.\\nWhen created, it matches createdAt\",\n    \"6-0\": \"status\",\n    \"6-1\": \"string enum\\n- `active`\\n- `trashed`\",\n    \"6-2\": \"Status of the branded short link.\\nSee link statuses below.\",\n    \"4-0\": \"shortUrl\",\n    \"4-1\": \"string\",\n    \"4-2\": \"The full branded short link URL, including domain\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\nOther properties that also appear in a Link object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"2-0\": \"favourite\",\n    \"2-1\": \"boolean\",\n    \"2-2\": \"Whether a link is favourited (loved) or not\",\n    \"0-0\": \"clicks\",\n    \"0-1\": \"integer\",\n    \"0-2\": \"How many clicks there are on this branded short link so far\",\n    \"1-0\": \"lastClickAt\",\n    \"1-1\": \"timestamp\",\n    \"1-2\": \"The UTC date/time this branded short link was last clicked on\",\n    \"3-0\": \"forwardParameters\",\n    \"3-1\": \"boolean\",\n    \"3-2\": \"Whether query parameters in short URL will be forwarded to destination URL.\\nE.g. `short.link/kw?p=1` with `forwardParameters=true` will redirect to `longurl.com/home/path?p=1`, otherwise will redirect to `longurl.com/home/path` (without query parameters)\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n## Link statuses\nA Link is said to be in `trashed` status when it has been temporarily deleted.\nA Link is in `active` status when it's not in `trashed` status and it has never been permanently deleted.\n\n## Additional info\nYou can have up to 5,000 links in your account.\nIf you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my links limit) sharing your use case.\n\nEvery branded short link is created using a [Branded Domain](doc:branded-domain-model).\nAs long as a branded domain exists in your Rebrandly account and is correctly configured, all branded short links created with that domain will be active and working.\n\nEach branded link is associated with a QR code image representing it. To download a PNG version of the QR code, just add `.qr` to an existing branded short link (*e.g, <a href=\"https://rebrand.ly/video.qr\" target=\"_blank\">rebrand.ly/video.qr</a> is the QR code for <a href=\"https://rebrand.ly/video\" target=\"_blank\">rebrand.ly/video</a>*).\n\n## Deprecated properties\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"WARNING\",\n  \"body\": \"We will continue to render deprecated Link properties for backward compatibility in v1\"\n}\n[/block]\nDeprecated properties you can find in a Link object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"<span style=\\\"color:red;\\\">linkId</span>\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier associated with the branded short link\",\n    \"h-3\": \"Reason\",\n    \"0-3\": \"Now using `id` property\",\n    \"1-0\": \"<span style=\\\"color:red;\\\">domainId</span>\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Unique identifier of the branded domain of the link\",\n    \"1-3\": \"Now using a [Domain Reference](doc:resource-references)\",\n    \"2-0\": \"<span style=\\\"color:red;\\\">lastClickDate</span>\",\n    \"2-1\": \"timestamp\",\n    \"2-2\": \"The UTC date/time this branded short link was last clicked on\",\n    \"2-3\": \"Now using `lastClickAt` property\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Branded short links management\"\n}\n[/block]\nHere are some basic operations you can perform regarding Link resources:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Operation\",\n    \"h-1\": \"Details\",\n    \"0-0\": \"Create a new branded short link\",\n    \"0-1\": \"See [Creating a new link](doc:create-a-new-link)\",\n    \"1-0\": \"Get branded short link details\",\n    \"1-1\": \"See [Getting link details](doc:get-link-details)\",\n    \"2-0\": \"Access your branded short links collection\\nSearch for a specific branded short link\",\n    \"2-1\": \"See [Listing your links](doc:list-links)\",\n    \"3-0\": \"Change destination ur for a branded short link\\nSet a branded short link as favourite\",\n    \"3-1\": \"See [Updating a link](doc:update-a-link)\",\n    \"4-0\": \"Trash a branded short link\\nDelete a branded short link\",\n    \"4-1\": \"See [Deleting a link](doc:delete-a-link)\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]","hidden":false,"isReference":false,"__v":2,"excerpt":"Branded short links are the main Rebrandly resource.\nYou can create, update and delete your collection of branded short links.\nLinks can be viewed individually or as a list.","link_external":false,"title":"Branded short links","project":"577d1b8b74aea422007230c4","sync_unique":"","createdAt":"2016-07-21T16:30:26.552Z","githubsync":"","link_url":"","parentDoc":null,"updates":["5793efedf7ffa30e00431770"],"user":"577d1b6d87acf617003c421d","category":"5791e88c4973f50e00f07683","order":1,"type":"basic","childrenPages":[]}

Branded short links

Branded short links are the main Rebrandly resource. You can create, update and delete your collection of branded short links. Links can be viewed individually or as a list.

[block:textarea] { "text": "Example Link Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": " {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n \"status\": \"active\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"clicks\": 42,\n \"lastClickAt\": \"2016-07-13T10:55:13.000Z\",\n \"favourite\": false\n }", "language": "json" } ], "sidebar": true } [/block] ## Link Object Main properties of a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "title", "1-1": "string", "1-2": "A title you assign to the branded short link in order to remember what's behind it", "2-0": "slashtag", "2-1": "string", "2-2": "The keyword section of your branded short link", "3-0": "destination", "3-1": "string", "3-2": "The destination URL you want your branded short link to point to", "5-0": "domain", "5-1": "[Domain Reference](doc:entity-references) object", "5-2": "A reference to the branded domain's resource of a branded short link", "0-0": "id", "0-1": "string", "0-2": "Unique identifier associated with the branded short link", "7-0": "createdAt", "7-1": "timestamp", "7-2": "The UTC date/time this branded short link was created", "8-0": "updatedAt", "8-1": "timestamp", "8-2": "The last UTC date/time this branded short link was updated.\nWhen created, it matches createdAt", "6-0": "status", "6-1": "string enum\n- `active`\n- `trashed`", "6-2": "Status of the branded short link.\nSee link statuses below.", "4-0": "shortUrl", "4-1": "string", "4-2": "The full branded short link URL, including domain" }, "cols": 3, "rows": 9 } [/block] Other properties that also appear in a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "2-0": "favourite", "2-1": "boolean", "2-2": "Whether a link is favourited (loved) or not", "0-0": "clicks", "0-1": "integer", "0-2": "How many clicks there are on this branded short link so far", "1-0": "lastClickAt", "1-1": "timestamp", "1-2": "The UTC date/time this branded short link was last clicked on", "3-0": "forwardParameters", "3-1": "boolean", "3-2": "Whether query parameters in short URL will be forwarded to destination URL.\nE.g. `short.link/kw?p=1` with `forwardParameters=true` will redirect to `longurl.com/home/path?p=1`, otherwise will redirect to `longurl.com/home/path` (without query parameters)" }, "cols": 3, "rows": 4 } [/block] ## Link statuses A Link is said to be in `trashed` status when it has been temporarily deleted. A Link is in `active` status when it's not in `trashed` status and it has never been permanently deleted. ## Additional info You can have up to 5,000 links in your account. If you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my links limit) sharing your use case. Every branded short link is created using a [Branded Domain](doc:branded-domain-model). As long as a branded domain exists in your Rebrandly account and is correctly configured, all branded short links created with that domain will be active and working. Each branded link is associated with a QR code image representing it. To download a PNG version of the QR code, just add `.qr` to an existing branded short link (*e.g, <a href="https://rebrand.ly/video.qr" target="_blank">rebrand.ly/video.qr</a> is the QR code for <a href="https://rebrand.ly/video" target="_blank">rebrand.ly/video</a>*). ## Deprecated properties [block:callout] { "type": "warning", "title": "WARNING", "body": "We will continue to render deprecated Link properties for backward compatibility in v1" } [/block] Deprecated properties you can find in a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "<span style=\"color:red;\">linkId</span>", "0-1": "string", "0-2": "Unique identifier associated with the branded short link", "h-3": "Reason", "0-3": "Now using `id` property", "1-0": "<span style=\"color:red;\">domainId</span>", "1-1": "string", "1-2": "Unique identifier of the branded domain of the link", "1-3": "Now using a [Domain Reference](doc:resource-references)", "2-0": "<span style=\"color:red;\">lastClickDate</span>", "2-1": "timestamp", "2-2": "The UTC date/time this branded short link was last clicked on", "2-3": "Now using `lastClickAt` property" }, "cols": 4, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Branded short links management" } [/block] Here are some basic operations you can perform regarding Link resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Create a new branded short link", "0-1": "See [Creating a new link](doc:create-a-new-link)", "1-0": "Get branded short link details", "1-1": "See [Getting link details](doc:get-link-details)", "2-0": "Access your branded short links collection\nSearch for a specific branded short link", "2-1": "See [Listing your links](doc:list-links)", "3-0": "Change destination ur for a branded short link\nSet a branded short link as favourite", "3-1": "See [Updating a link](doc:update-a-link)", "4-0": "Trash a branded short link\nDelete a branded short link", "4-1": "See [Deleting a link](doc:delete-a-link)" }, "cols": 2, "rows": 5 } [/block]
[block:textarea] { "text": "Example Link Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": " {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n \"status\": \"active\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"clicks\": 42,\n \"lastClickAt\": \"2016-07-13T10:55:13.000Z\",\n \"favourite\": false\n }", "language": "json" } ], "sidebar": true } [/block] ## Link Object Main properties of a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "title", "1-1": "string", "1-2": "A title you assign to the branded short link in order to remember what's behind it", "2-0": "slashtag", "2-1": "string", "2-2": "The keyword section of your branded short link", "3-0": "destination", "3-1": "string", "3-2": "The destination URL you want your branded short link to point to", "5-0": "domain", "5-1": "[Domain Reference](doc:entity-references) object", "5-2": "A reference to the branded domain's resource of a branded short link", "0-0": "id", "0-1": "string", "0-2": "Unique identifier associated with the branded short link", "7-0": "createdAt", "7-1": "timestamp", "7-2": "The UTC date/time this branded short link was created", "8-0": "updatedAt", "8-1": "timestamp", "8-2": "The last UTC date/time this branded short link was updated.\nWhen created, it matches createdAt", "6-0": "status", "6-1": "string enum\n- `active`\n- `trashed`", "6-2": "Status of the branded short link.\nSee link statuses below.", "4-0": "shortUrl", "4-1": "string", "4-2": "The full branded short link URL, including domain" }, "cols": 3, "rows": 9 } [/block] Other properties that also appear in a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "2-0": "favourite", "2-1": "boolean", "2-2": "Whether a link is favourited (loved) or not", "0-0": "clicks", "0-1": "integer", "0-2": "How many clicks there are on this branded short link so far", "1-0": "lastClickAt", "1-1": "timestamp", "1-2": "The UTC date/time this branded short link was last clicked on", "3-0": "forwardParameters", "3-1": "boolean", "3-2": "Whether query parameters in short URL will be forwarded to destination URL.\nE.g. `short.link/kw?p=1` with `forwardParameters=true` will redirect to `longurl.com/home/path?p=1`, otherwise will redirect to `longurl.com/home/path` (without query parameters)" }, "cols": 3, "rows": 4 } [/block] ## Link statuses A Link is said to be in `trashed` status when it has been temporarily deleted. A Link is in `active` status when it's not in `trashed` status and it has never been permanently deleted. ## Additional info You can have up to 5,000 links in your account. If you need more, please [contact us](mailto:support@rebrandly.com?subject=Increase my links limit) sharing your use case. Every branded short link is created using a [Branded Domain](doc:branded-domain-model). As long as a branded domain exists in your Rebrandly account and is correctly configured, all branded short links created with that domain will be active and working. Each branded link is associated with a QR code image representing it. To download a PNG version of the QR code, just add `.qr` to an existing branded short link (*e.g, <a href="https://rebrand.ly/video.qr" target="_blank">rebrand.ly/video.qr</a> is the QR code for <a href="https://rebrand.ly/video" target="_blank">rebrand.ly/video</a>*). ## Deprecated properties [block:callout] { "type": "warning", "title": "WARNING", "body": "We will continue to render deprecated Link properties for backward compatibility in v1" } [/block] Deprecated properties you can find in a Link object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "<span style=\"color:red;\">linkId</span>", "0-1": "string", "0-2": "Unique identifier associated with the branded short link", "h-3": "Reason", "0-3": "Now using `id` property", "1-0": "<span style=\"color:red;\">domainId</span>", "1-1": "string", "1-2": "Unique identifier of the branded domain of the link", "1-3": "Now using a [Domain Reference](doc:resource-references)", "2-0": "<span style=\"color:red;\">lastClickDate</span>", "2-1": "timestamp", "2-2": "The UTC date/time this branded short link was last clicked on", "2-3": "Now using `lastClickAt` property" }, "cols": 4, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Branded short links management" } [/block] Here are some basic operations you can perform regarding Link resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Create a new branded short link", "0-1": "See [Creating a new link](doc:create-a-new-link)", "1-0": "Get branded short link details", "1-1": "See [Getting link details](doc:get-link-details)", "2-0": "Access your branded short links collection\nSearch for a specific branded short link", "2-1": "See [Listing your links](doc:list-links)", "3-0": "Change destination ur for a branded short link\nSet a branded short link as favourite", "3-1": "See [Updating a link](doc:update-a-link)", "4-0": "Trash a branded short link\nDelete a branded short link", "4-1": "See [Deleting a link](doc:delete-a-link)" }, "cols": 2, "rows": 5 } [/block]
{"_id":"5790f9ff8242580e00fc2b61","createdAt":"2016-07-21T16:36:15.460Z","title":"Branded domains","__v":1,"api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required"},"slug":"branded-domain-model","sync_unique":"","updates":["5793f12f10cd740e004f59ca"],"excerpt":"Branded domains allow you to create your custom link shortener. \nYou can list all the domains you own, and choose the one that best fits your branded short links.","isReference":false,"parentDoc":null,"body":"[block:textarea]\n{\n  \"text\": \"Example Domain Object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  {\\n    \\\"id\\\": \\\"4d20ec31db1e48c5aded19e93f137a11\\\",\\n    \\\"fullName\\\": \\\"brand.cool\\\",\\n    \\\"topLevelDomain\\\": \\\"cool\\\",\\n    \\\"createdAt\\\": \\\"2016-07-01T13:12:22.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-03T13:17:50.000Z\\\",\\n    \\\"type\\\": \\\"user\\\",\\n    \\\"active\\\": false\\n  }\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n## DOMAIN OBJECT\nMain properties of a Domain object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier for the branded domain\",\n    \"1-0\": \"fullName\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Full name of the branded domain\",\n    \"2-0\": \"topLevelDomain\",\n    \"2-1\": \"string\",\n    \"2-2\": \"The top level domain part of the branded domain name\",\n    \"3-0\": \"createdAt\",\n    \"3-1\": \"timestamp\",\n    \"3-2\": \"UTC creation date/time of the branded domain\",\n    \"4-0\": \"updatedAt\",\n    \"4-2\": \"UTC last update date/time of the branded domain\",\n    \"4-1\": \"timestamp\",\n    \"5-0\": \"type\",\n    \"5-1\": \"string enum\\n- `service`\\n- `user`\",\n    \"5-2\": \"Branded domain type\",\n    \"6-0\": \"active\",\n    \"6-1\": \"boolean\",\n    \"6-2\": \"Whether the branded domain can be used or not to create branded short links\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n## Deprecated properties\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"WARNING\",\n  \"body\": \"We will continue to render deprecated Domain properties for backward compatibility in v1\"\n}\n[/block]\nDeprecated properties you can find in a Domain object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-3\": \"Now using `createdAt`\",\n    \"h-3\": \"Reason\",\n    \"0-0\": \"<span style=\\\"color:red;\\\">creationDate</span>\",\n    \"0-1\": \"timestamp\",\n    \"0-2\": \"UTC creation date/time of the branded domain\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Branded domains management\"\n}\n[/block]\nHere are some basic operations you perform regarding Domain resources:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Operation\",\n    \"h-1\": \"Details\",\n    \"0-0\": \"Access your branded domains collection\",\n    \"0-1\": \"See [Getting domain details](doc:getting-single-domain-details)\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]","hidden":false,"link_external":false,"link_url":"","order":2,"project":"577d1b8b74aea422007230c4","type":"basic","category":"5791e88c4973f50e00f07683","githubsync":"","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

Branded domains

Branded domains allow you to create your custom link shortener. You can list all the domains you own, and choose the one that best fits your branded short links.

[block:textarea] { "text": "Example Domain Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": " {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n }", "language": "json" } ], "sidebar": true } [/block] ## DOMAIN OBJECT Main properties of a Domain object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier for the branded domain", "1-0": "fullName", "1-1": "string", "1-2": "Full name of the branded domain", "2-0": "topLevelDomain", "2-1": "string", "2-2": "The top level domain part of the branded domain name", "3-0": "createdAt", "3-1": "timestamp", "3-2": "UTC creation date/time of the branded domain", "4-0": "updatedAt", "4-2": "UTC last update date/time of the branded domain", "4-1": "timestamp", "5-0": "type", "5-1": "string enum\n- `service`\n- `user`", "5-2": "Branded domain type", "6-0": "active", "6-1": "boolean", "6-2": "Whether the branded domain can be used or not to create branded short links" }, "cols": 3, "rows": 7 } [/block] ## Deprecated properties [block:callout] { "type": "warning", "title": "WARNING", "body": "We will continue to render deprecated Domain properties for backward compatibility in v1" } [/block] Deprecated properties you can find in a Domain object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-3": "Now using `createdAt`", "h-3": "Reason", "0-0": "<span style=\"color:red;\">creationDate</span>", "0-1": "timestamp", "0-2": "UTC creation date/time of the branded domain" }, "cols": 4, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Branded domains management" } [/block] Here are some basic operations you perform regarding Domain resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Access your branded domains collection", "0-1": "See [Getting domain details](doc:getting-single-domain-details)" }, "cols": 2, "rows": 1 } [/block]
[block:textarea] { "text": "Example Domain Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": " {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n }", "language": "json" } ], "sidebar": true } [/block] ## DOMAIN OBJECT Main properties of a Domain object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier for the branded domain", "1-0": "fullName", "1-1": "string", "1-2": "Full name of the branded domain", "2-0": "topLevelDomain", "2-1": "string", "2-2": "The top level domain part of the branded domain name", "3-0": "createdAt", "3-1": "timestamp", "3-2": "UTC creation date/time of the branded domain", "4-0": "updatedAt", "4-2": "UTC last update date/time of the branded domain", "4-1": "timestamp", "5-0": "type", "5-1": "string enum\n- `service`\n- `user`", "5-2": "Branded domain type", "6-0": "active", "6-1": "boolean", "6-2": "Whether the branded domain can be used or not to create branded short links" }, "cols": 3, "rows": 7 } [/block] ## Deprecated properties [block:callout] { "type": "warning", "title": "WARNING", "body": "We will continue to render deprecated Domain properties for backward compatibility in v1" } [/block] Deprecated properties you can find in a Domain object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-3": "Now using `createdAt`", "h-3": "Reason", "0-0": "<span style=\"color:red;\">creationDate</span>", "0-1": "timestamp", "0-2": "UTC creation date/time of the branded domain" }, "cols": 4, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Branded domains management" } [/block] Here are some basic operations you perform regarding Domain resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Access your branded domains collection", "0-1": "See [Getting domain details](doc:getting-single-domain-details)" }, "cols": 2, "rows": 1 } [/block]
{"_id":"5790fccf8242580e00fc2b65","body":"## Account Object\nMain properties of an Account object are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier of the account\",\n    \"5-0\": \"createdAt\",\n    \"5-1\": \"timestamp\",\n    \"5-2\": \"UTC creation date/time of the account\",\n    \"1-0\": \"username\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Username used in login\",\n    \"2-0\": \"email\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Contact email of the account\",\n    \"3-0\": \"fullName\",\n    \"3-1\": \"string\",\n    \"3-2\": \"Full name of the account owner\",\n    \"4-0\": \"avatarUrl\",\n    \"4-1\": \"string\",\n    \"4-2\": \"URL of the account avatar\",\n    \"6-0\": \"subscription\",\n    \"6-1\": \"Account Subscription object\\nSee below\",\n    \"6-2\": \"Set of feature/limits info related to the account and its plan\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n## Account Subscription object\nAccount object includes a \"subscription\" nested object which resumes account's plan status.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"createdAt\",\n    \"0-1\": \"timestamp\",\n    \"0-2\": \"UTC subscription date/time of the account's current plan\",\n    \"1-0\": \"expiredAt\",\n    \"1-1\": \"timestamp\",\n    \"1-2\": \"UTC expiration date/time of the account's current plan, when plan's category is not free\",\n    \"2-0\": \"limits\",\n    \"2-1\": \"Dictionary of Account Limits objects\\nSee below\",\n    \"2-2\": \"Account's resources usage and limits: how many links/domains/tags/etc created so far and which are the maximum limits\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n## Account Limits object\nAccount Subscription object includes a `limits` dictionary indicating how many:\n\n- links\n- domains\n- teams\n- teammates\n- tags\n- scripts\n\nthere are in the account and how many can be created.\nEach of the objects, having as dictionary key its own name as expressed above, has the following properties specified:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"used\",\n    \"0-1\": \"numeric\",\n    \"0-2\": \"How many resources of the given type used\",\n    \"1-0\": \"max\",\n    \"1-1\": \"numeric\",\n    \"1-2\": \"How many resources of the given type the account is allowing\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n## Account Features object\n\nAccount Subscription object includes a `features` dictionary of booleans indicating whether you have or not the following features:\n\n- Retargeting scripts (`features.links.scripts`)\n- Tags (`features.links.tags`)\n- Emoji on slashtag (`features.links.emoji`)\n- Notes on links (`features.links.notes`)\n- Ability to change your custom homepage and custom 404 on your domains (`features.domains.whitelabeled`)\n\nIf you are implementing an application for third parties, you are supposed to first check whether the Account object is allowing you a specific feature, and then you can proceed with using endpoints related to that feature.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Account management\"\n}\n[/block]\nHere are some basic operations you can perform regarding Account resources:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Operation\",\n    \"h-1\": \"Details\",\n    \"0-0\": \"Get account details\",\n    \"0-1\": \"See [Getting account details](doc:getting-account-details)\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example Account object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"fullName\\\": \\\"Stanford University\\\",\\n  \\\"username\\\": \\\"fake@stanford.edu\\\",\\n  \\\"email\\\": \\\"fake@stanford.edu\\\",\\n  \\\"avatarUrl\\\": \\\"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"subscription\\\": {\\n    \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"limits\\\": {\\n      \\\"links\\\": {\\n        \\\"used\\\": 7504,\\n        \\\"max\\\": 10000\\n      },\\n      \\\"domains\\\": {\\n        \\\"used\\\": 17,\\n        \\\"max\\\": 100\\n      },\\n      \\\"teammates\\\": {\\n        \\\"used\\\": 5,\\n        \\\"max\\\": 100\\n      },\\n      \\\"tags\\\": {\\n        \\\"used\\\": 0,\\n        \\\"max\\\": 50\\n      },\\n      \\\"scripts\\\": {\\n        \\\"used\\\": 0,\\n        \\\"max\\\": 50\\n      }\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"Accounts are designed to provide your application with an identity.","isReference":false,"order":3,"version":"577d1b8b74aea422007230c7","type":"basic","__v":2,"githubsync":"","project":"577d1b8b74aea422007230c4","title":"Account info","sync_unique":"","updates":["5793f338514c7b0e00e17c40"],"user":"577d1b6d87acf617003c421d","createdAt":"2016-07-21T16:48:15.559Z","hidden":false,"link_url":"","parentDoc":null,"slug":"account-model","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"category":"5791e88c4973f50e00f07683","link_external":false,"next":{"pages":[],"description":""},"childrenPages":[]}

Account info

Accounts are designed to provide your application with an identity.

## Account Object Main properties of an Account object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the account", "5-0": "createdAt", "5-1": "timestamp", "5-2": "UTC creation date/time of the account", "1-0": "username", "1-1": "string", "1-2": "Username used in login", "2-0": "email", "2-1": "string", "2-2": "Contact email of the account", "3-0": "fullName", "3-1": "string", "3-2": "Full name of the account owner", "4-0": "avatarUrl", "4-1": "string", "4-2": "URL of the account avatar", "6-0": "subscription", "6-1": "Account Subscription object\nSee below", "6-2": "Set of feature/limits info related to the account and its plan" }, "cols": 3, "rows": 7 } [/block] ## Account Subscription object Account object includes a "subscription" nested object which resumes account's plan status. [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "createdAt", "0-1": "timestamp", "0-2": "UTC subscription date/time of the account's current plan", "1-0": "expiredAt", "1-1": "timestamp", "1-2": "UTC expiration date/time of the account's current plan, when plan's category is not free", "2-0": "limits", "2-1": "Dictionary of Account Limits objects\nSee below", "2-2": "Account's resources usage and limits: how many links/domains/tags/etc created so far and which are the maximum limits" }, "cols": 3, "rows": 3 } [/block] ## Account Limits object Account Subscription object includes a `limits` dictionary indicating how many: - links - domains - teams - teammates - tags - scripts there are in the account and how many can be created. Each of the objects, having as dictionary key its own name as expressed above, has the following properties specified: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "used", "0-1": "numeric", "0-2": "How many resources of the given type used", "1-0": "max", "1-1": "numeric", "1-2": "How many resources of the given type the account is allowing" }, "cols": 3, "rows": 2 } [/block] ## Account Features object Account Subscription object includes a `features` dictionary of booleans indicating whether you have or not the following features: - Retargeting scripts (`features.links.scripts`) - Tags (`features.links.tags`) - Emoji on slashtag (`features.links.emoji`) - Notes on links (`features.links.notes`) - Ability to change your custom homepage and custom 404 on your domains (`features.domains.whitelabeled`) If you are implementing an application for third parties, you are supposed to first check whether the Account object is allowing you a specific feature, and then you can proceed with using endpoints related to that feature. [block:api-header] { "type": "basic", "title": "Account management" } [/block] Here are some basic operations you can perform regarding Account resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Get account details", "0-1": "See [Getting account details](doc:getting-account-details)" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Example Account object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"fullName\": \"Stanford University\",\n \"username\": \"fake@stanford.edu\",\n \"email\": \"fake@stanford.edu\",\n \"avatarUrl\": \"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"subscription\": {\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"limits\": {\n \"links\": {\n \"used\": 7504,\n \"max\": 10000\n },\n \"domains\": {\n \"used\": 17,\n \"max\": 100\n },\n \"teammates\": {\n \"used\": 5,\n \"max\": 100\n },\n \"tags\": {\n \"used\": 0,\n \"max\": 50\n },\n \"scripts\": {\n \"used\": 0,\n \"max\": 50\n }\n }\n }\n}", "language": "json" } ], "sidebar": true } [/block]
## Account Object Main properties of an Account object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the account", "5-0": "createdAt", "5-1": "timestamp", "5-2": "UTC creation date/time of the account", "1-0": "username", "1-1": "string", "1-2": "Username used in login", "2-0": "email", "2-1": "string", "2-2": "Contact email of the account", "3-0": "fullName", "3-1": "string", "3-2": "Full name of the account owner", "4-0": "avatarUrl", "4-1": "string", "4-2": "URL of the account avatar", "6-0": "subscription", "6-1": "Account Subscription object\nSee below", "6-2": "Set of feature/limits info related to the account and its plan" }, "cols": 3, "rows": 7 } [/block] ## Account Subscription object Account object includes a "subscription" nested object which resumes account's plan status. [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "createdAt", "0-1": "timestamp", "0-2": "UTC subscription date/time of the account's current plan", "1-0": "expiredAt", "1-1": "timestamp", "1-2": "UTC expiration date/time of the account's current plan, when plan's category is not free", "2-0": "limits", "2-1": "Dictionary of Account Limits objects\nSee below", "2-2": "Account's resources usage and limits: how many links/domains/tags/etc created so far and which are the maximum limits" }, "cols": 3, "rows": 3 } [/block] ## Account Limits object Account Subscription object includes a `limits` dictionary indicating how many: - links - domains - teams - teammates - tags - scripts there are in the account and how many can be created. Each of the objects, having as dictionary key its own name as expressed above, has the following properties specified: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "used", "0-1": "numeric", "0-2": "How many resources of the given type used", "1-0": "max", "1-1": "numeric", "1-2": "How many resources of the given type the account is allowing" }, "cols": 3, "rows": 2 } [/block] ## Account Features object Account Subscription object includes a `features` dictionary of booleans indicating whether you have or not the following features: - Retargeting scripts (`features.links.scripts`) - Tags (`features.links.tags`) - Emoji on slashtag (`features.links.emoji`) - Notes on links (`features.links.notes`) - Ability to change your custom homepage and custom 404 on your domains (`features.domains.whitelabeled`) If you are implementing an application for third parties, you are supposed to first check whether the Account object is allowing you a specific feature, and then you can proceed with using endpoints related to that feature. [block:api-header] { "type": "basic", "title": "Account management" } [/block] Here are some basic operations you can perform regarding Account resources: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "0-0": "Get account details", "0-1": "See [Getting account details](doc:getting-account-details)" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Example Account object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"fullName\": \"Stanford University\",\n \"username\": \"fake@stanford.edu\",\n \"email\": \"fake@stanford.edu\",\n \"avatarUrl\": \"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"subscription\": {\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"limits\": {\n \"links\": {\n \"used\": 7504,\n \"max\": 10000\n },\n \"domains\": {\n \"used\": 17,\n \"max\": 100\n },\n \"teammates\": {\n \"used\": 5,\n \"max\": 100\n },\n \"tags\": {\n \"used\": 0,\n \"max\": 50\n },\n \"scripts\": {\n \"used\": 0,\n \"max\": 50\n }\n }\n }\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"579253917feea81700e5ac1d","api":{"settings":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check for compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Tags feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\n## Tag Object\nMain properties of a Tag object are: \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier of a tag\",\n    \"1-0\": \"name\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Unique name of a tag\",\n    \"2-0\": \"color\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Hexadecimal representation of a color assigned to a tag\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tags management\"\n}\n[/block]\nHere are some basic operations you can perform regarding Tag resource:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Operation\",\n    \"h-1\": \"Details\",\n    \"2-0\": \"Access your tags collection\",\n    \"2-1\": \"See [Listing your tags](doc:listing-your-tags)\",\n    \"0-0\": \"Create a new tag\",\n    \"0-1\": \"See [Creating a new tag](doc:creating-a-new-tag)\",\n    \"1-0\": \"Get tag details\",\n    \"1-1\": \"See [Getting tag details](doc:getting-tag-details)\",\n    \"3-0\": \"Delete a tag\",\n    \"3-1\": \"See [Deleting a tag](doc:deleting-a-tag)\",\n    \"5-0\": \"Attach a tag to a link\",\n    \"5-1\": \"See [Attaching a tag](doc:attaching-a-tag)\",\n    \"6-0\": \"Detach a tag from a link\",\n    \"6-1\": \"See [Detaching a tag](doc:detaching-a-tag)\",\n    \"4-0\": \"Count your tags\",\n    \"4-1\": \"See [Counting your tags](doc:counting-your-tags)\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example of a Tag object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"Stanford\\\",\\n  \\\"color\\\": \\\"#ddeeff\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","link_url":"","sync_unique":"","type":"basic","createdAt":"2016-07-22T17:10:41.649Z","parentDoc":null,"project":"577d1b8b74aea422007230c4","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","__v":2,"category":"5791e88c4973f50e00f07683","githubsync":"","link_external":false,"order":4,"slug":"tag-model","updates":["5793f58810cd740e004f59cc"],"excerpt":"Tags are used to better organize your branded links collection","hidden":false,"isReference":false,"title":"Tags","next":{"description":"","pages":[]},"childrenPages":[]}

Tags

Tags are used to better organize your branded links collection

[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## Tag Object Main properties of a Tag object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of a tag", "1-0": "name", "1-1": "string", "1-2": "Unique name of a tag", "2-0": "color", "2-1": "string", "2-2": "Hexadecimal representation of a color assigned to a tag" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Tags management" } [/block] Here are some basic operations you can perform regarding Tag resource: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "2-0": "Access your tags collection", "2-1": "See [Listing your tags](doc:listing-your-tags)", "0-0": "Create a new tag", "0-1": "See [Creating a new tag](doc:creating-a-new-tag)", "1-0": "Get tag details", "1-1": "See [Getting tag details](doc:getting-tag-details)", "3-0": "Delete a tag", "3-1": "See [Deleting a tag](doc:deleting-a-tag)", "5-0": "Attach a tag to a link", "5-1": "See [Attaching a tag](doc:attaching-a-tag)", "6-0": "Detach a tag from a link", "6-1": "See [Detaching a tag](doc:detaching-a-tag)", "4-0": "Count your tags", "4-1": "See [Counting your tags](doc:counting-your-tags)" }, "cols": 2, "rows": 7 } [/block] [block:textarea] { "text": "Example of a Tag object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Stanford\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## Tag Object Main properties of a Tag object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of a tag", "1-0": "name", "1-1": "string", "1-2": "Unique name of a tag", "2-0": "color", "2-1": "string", "2-2": "Hexadecimal representation of a color assigned to a tag" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Tags management" } [/block] Here are some basic operations you can perform regarding Tag resource: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "2-0": "Access your tags collection", "2-1": "See [Listing your tags](doc:listing-your-tags)", "0-0": "Create a new tag", "0-1": "See [Creating a new tag](doc:creating-a-new-tag)", "1-0": "Get tag details", "1-1": "See [Getting tag details](doc:getting-tag-details)", "3-0": "Delete a tag", "3-1": "See [Deleting a tag](doc:deleting-a-tag)", "5-0": "Attach a tag to a link", "5-1": "See [Attaching a tag](doc:attaching-a-tag)", "6-0": "Detach a tag from a link", "6-1": "See [Detaching a tag](doc:detaching-a-tag)", "4-0": "Count your tags", "4-1": "See [Counting your tags](doc:counting-your-tags)" }, "cols": 2, "rows": 7 } [/block] [block:textarea] { "text": "Example of a Tag object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Stanford\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c146b5bc639a0032f76bf6","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5791e88c4973f50e00f07683","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T16:32:53.116Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check for compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Scripts feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\n## Script Object\nMain properties of a Script object are: \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier of the script\",\n    \"1-0\": \"name\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Unique name of the script\",\n    \"2-0\": \"value\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Javascript snippet (enclosed into <script> and </script> HTML tags)\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Scripts management\"\n}\n[/block]\nHere are some basic operations you can perform regarding Script resource:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Operation\",\n    \"h-1\": \"Details\",\n    \"2-0\": \"Access your scripts collection\",\n    \"2-1\": \"See [Listing your scripts](doc:listing-your-scripts)\",\n    \"0-0\": \"Create a new script\",\n    \"0-1\": \"See [Creating a new script](doc:creating-a-new-script)\",\n    \"1-0\": \"Get script details\",\n    \"1-1\": \"See [Getting script details](doc:getting-script-details)\",\n    \"3-0\": \"Delete a script\",\n    \"3-1\": \"See [Deleting a script](doc:deleting-a-script)\",\n    \"5-0\": \"Attach a script to a link\",\n    \"5-1\": \"See [Attaching a script](doc:attaching-a-script)\",\n    \"6-0\": \"Detach a script from a link\",\n    \"6-1\": \"See [Detaching a script](doc:detaching-a-script)\",\n    \"4-0\": \"Count your scripts\",\n    \"4-1\": \"See [Counting your scripts](doc:counting-your-scripts)\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example of a Script object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"Test alert\\\",\\n  \\\"color\\\": \\\"<script>alert('test');</script>\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"Retargeting scripts are used to execute custom javascript snippets during the redirection process","slug":"retargeting-cripts","type":"basic","title":"Retargeting scripts","__v":0,"parentDoc":null,"childrenPages":[]}

Retargeting scripts

Retargeting scripts are used to execute custom javascript snippets during the redirection process

[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## Script Object Main properties of a Script object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the script", "1-0": "name", "1-1": "string", "1-2": "Unique name of the script", "2-0": "value", "2-1": "string", "2-2": "Javascript snippet (enclosed into <script> and </script> HTML tags)" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Scripts management" } [/block] Here are some basic operations you can perform regarding Script resource: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "2-0": "Access your scripts collection", "2-1": "See [Listing your scripts](doc:listing-your-scripts)", "0-0": "Create a new script", "0-1": "See [Creating a new script](doc:creating-a-new-script)", "1-0": "Get script details", "1-1": "See [Getting script details](doc:getting-script-details)", "3-0": "Delete a script", "3-1": "See [Deleting a script](doc:deleting-a-script)", "5-0": "Attach a script to a link", "5-1": "See [Attaching a script](doc:attaching-a-script)", "6-0": "Detach a script from a link", "6-1": "See [Detaching a script](doc:detaching-a-script)", "4-0": "Count your scripts", "4-1": "See [Counting your scripts](doc:counting-your-scripts)" }, "cols": 2, "rows": 7 } [/block] [block:textarea] { "text": "Example of a Script object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Test alert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## Script Object Main properties of a Script object are: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the script", "1-0": "name", "1-1": "string", "1-2": "Unique name of the script", "2-0": "value", "2-1": "string", "2-2": "Javascript snippet (enclosed into <script> and </script> HTML tags)" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Scripts management" } [/block] Here are some basic operations you can perform regarding Script resource: [block:parameters] { "data": { "h-0": "Operation", "h-1": "Details", "2-0": "Access your scripts collection", "2-1": "See [Listing your scripts](doc:listing-your-scripts)", "0-0": "Create a new script", "0-1": "See [Creating a new script](doc:creating-a-new-script)", "1-0": "Get script details", "1-1": "See [Getting script details](doc:getting-script-details)", "3-0": "Delete a script", "3-1": "See [Deleting a script](doc:deleting-a-script)", "5-0": "Attach a script to a link", "5-1": "See [Attaching a script](doc:attaching-a-script)", "6-0": "Detach a script from a link", "6-1": "See [Detaching a script](doc:detaching-a-script)", "4-0": "Count your scripts", "4-1": "See [Counting your scripts](doc:counting-your-scripts)" }, "cols": 2, "rows": 7 } [/block] [block:textarea] { "text": "Example of a Script object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Test alert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"579252cf69c5120e00efded4","link_url":"","project":"577d1b8b74aea422007230c4","updates":["5793f4a00b4ca20e00beaa34"],"version":"577d1b8b74aea422007230c7","api":{"url":"","settings":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[]},"body":"A basic Resource Reference is composed of:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier of the original resource\",\n    \"1-0\": \"ref\",\n    \"1-1\": \"string\",\n    \"1-2\": \"API path to resource details\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n## Domain Reference Object\nA Domain Reference is a reference to a [Domain](doc:branded-domain-model) object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier of the [Domain](doc:branded-domain-model) object\",\n    \"1-0\": \"ref\",\n    \"1-1\": \"string\",\n    \"1-2\": \"API path to branded domain details\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example of a Domain Reference Object\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n  \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","order":6,"createdAt":"2016-07-22T17:07:27.098Z","isReference":false,"link_external":false,"parentDoc":null,"sync_unique":"","type":"basic","category":"5791e88c4973f50e00f07683","githubsync":"","hidden":false,"slug":"resource-objects","title":"Resource references","user":"577d1b6d87acf617003c421d","__v":1,"excerpt":"Resource References are objects used to link resources together, in order to allow navigation between them.","childrenPages":[]}

Resource references

Resource References are objects used to link resources together, in order to allow navigation between them.

A basic Resource Reference is composed of: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the original resource", "1-0": "ref", "1-1": "string", "1-2": "API path to resource details" }, "cols": 3, "rows": 2 } [/block] ## Domain Reference Object A Domain Reference is a reference to a [Domain](doc:branded-domain-model) object. [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the [Domain](doc:branded-domain-model) object", "1-0": "ref", "1-1": "string", "1-2": "API path to branded domain details" }, "cols": 3, "rows": 2 } [/block] [block:textarea] { "text": "Example of a Domain Reference Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n\t\"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n}", "language": "json" } ], "sidebar": true } [/block]
A basic Resource Reference is composed of: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the original resource", "1-0": "ref", "1-1": "string", "1-2": "API path to resource details" }, "cols": 3, "rows": 2 } [/block] ## Domain Reference Object A Domain Reference is a reference to a [Domain](doc:branded-domain-model) object. [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "id", "0-1": "string", "0-2": "Unique identifier of the [Domain](doc:branded-domain-model) object", "1-0": "ref", "1-1": "string", "1-2": "API path to branded domain details" }, "cols": 3, "rows": 2 } [/block] [block:textarea] { "text": "Example of a Domain Reference Object", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n\t\"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"5796078ef7d5760e006ee5aa","link_url":"","title":"Branded short links","type":"basic","user":"577d1b6d87acf617003c421d","githubsync":"","isReference":false,"link_external":false,"parentDoc":null,"api":{"auth":"required","params":[],"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-25T12:35:26.232Z","excerpt":"","project":"577d1b8b74aea422007230c4","slug":"links-overview","sync_unique":"","version":"577d1b8b74aea422007230c7","updates":[],"__v":0,"body":"Branded short links are the main Rebrandly resource.\nLinks can be viewed [individually](doc:get-link-details)  or [as a collection](doc:list-links).\nYou can [create](doc:create-a-new-link) , [update](doc:update-a-link)  and [delete](doc:delete-a-link) a branded link.","hidden":false,"order":0,"childrenPages":[]}

Branded short links


Branded short links are the main Rebrandly resource. Links can be viewed [individually](doc:get-link-details) or [as a collection](doc:list-links). You can [create](doc:create-a-new-link) , [update](doc:update-a-link) and [delete](doc:delete-a-link) a branded link.
Branded short links are the main Rebrandly resource. Links can be viewed [individually](doc:get-link-details) or [as a collection](doc:list-links). You can [create](doc:create-a-new-link) , [update](doc:update-a-link) and [delete](doc:delete-a-link) a branded link.
{"_id":"5791f79ddaa64a0e008bc274","slug":"create-a-new-link","title":"Creating a new link","version":"577d1b8b74aea422007230c7","__v":2,"category":"5791f02edaa64a0e008bc261","link_external":false,"project":"577d1b8b74aea422007230c4","body":"Branded short links can be created via:\n- a `POST` HTTP request to `https://api.rebrandly.com/v1/links`, with JSON body defining the [Link](doc:link-entity)\n- a `GET` HTTP request to `https://api.rebrandly.com/v1/links/new`, with query parameters defining the [Link](doc:link-entity)\n\n[See in API explorer](doc:create-link-endpoint) \n\n## Link Parameters\nTable below shows the parameters you should specify when creating a Link:\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-0\": \"Link property\",\n    \"0-0\": \"destination\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nValid URL\\nMax 1000 chars\",\n    \"1-0\": \"slashtag\",\n    \"1-1\": \"string\",\n    \"1-2\": \"*optional*\\nAllowed character set:\\n`A-Z`, `a-z`, `0-9`, `_`, `-`\\nMin 1 chars\\nMax 40 chars\",\n    \"2-0\": \"title\",\n    \"2-1\": \"string\",\n    \"2-2\": \"*optional*\\nUTF8\\nMin 3 chars\\nMax 255 chars\",\n    \"3-0\": \"domain\",\n    \"3-1\": \"object\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"The destination URL you want your branded short link to point to\",\n    \"1-3\": \"The keyword portion of your branded short link. If not specified, will be autogenerated.\",\n    \"2-3\": \"A title you assign to the branded short link in order to remember what's behind it\",\n    \"3-2\": \"*optional*\\nDomain Reference\",\n    \"3-3\": \"A reference to the branded domain resource for this branded short link.\\nIf not set, http://rebrand.ly is used\",\n    \"4-0\": \"description\",\n    \"4-1\": \"string\",\n    \"4-2\": \"*optional*\\nMin 3 chars\\nMax 2000 chars\",\n    \"4-3\": \"**Available only if your plan includes link notes**\\n\\nA description/note you associate to the branded short link\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\",\n  \"title\": \"Check for compatibility first\"\n}\n[/block]\n## Additional Link Parameters\nFor advanced Link creation, further parameters can be specified:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Link property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"favourite\",\n    \"0-1\": \"boolean\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Whether this branded short link should be set as favourite (loved) or not\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Examples of valid Link object to POST:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"title\\\": \\\"What is Rebrandly\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n\\t\\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"rebrand.ly/video\"\n    },\n    {\n      \"code\": \"{\\n  \\\"title\\\": \\\"10 Books\\\",\\n  \\\"slashtag\\\": \\\"Books\\\",\\n\\t\\\"destination\\\": \\\"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"4d20ec31db1e48c5aded19e93f137a11\\\" \\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"brand.cool/Books\"\n    },\n    {\n      \"code\": \"{\\n\\t\\\"destination\\\": \\\"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\\\",\\n}\",\n      \"language\": \"text\",\n      \"name\": \"rebrand.ly/abcd\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Creating a new Link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json' \\\\\\n-d \\\\\\n'{\\n  \\\"title\\\": \\\"What is Rebrandly\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\"\\n}'\\n// slashtag and title are optional\",\n      \"language\": \"curl\",\n      \"name\": \"cURL POST\"\n    },\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&destination=https://www.youtube.com/watch?v=3VmtibKpmXI&slashtag=video&domain\\\\[id\\\\]=8f104cc5b6ee4a4ba7897b06ac2ddcfb'\\n// slashtag and title are optional\",\n      \"language\": \"text\",\n      \"name\": \"cURL GET\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (just created link)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"0-0\": \"403\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"[403 - Already exists](doc:403-already-exists-errors)\",\n    \"0-2\": \"Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag.\",\n    \"1-0\": \"403\",\n    \"1-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"1-2\": \"Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","createdAt":"2016-07-22T10:38:21.309Z","isReference":false,"order":1,"type":"basic","updates":["5794089e7d1e4a0e00346086"],"excerpt":"","githubsync":"","link_url":"","sync_unique":"","user":"577d1b6d87acf617003c421d","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"hidden":false,"parentDoc":null,"next":{"description":"","pages":[]},"childrenPages":[]}

Creating a new link


Branded short links can be created via: - a `POST` HTTP request to `https://api.rebrandly.com/v1/links`, with JSON body defining the [Link](doc:link-entity) - a `GET` HTTP request to `https://api.rebrandly.com/v1/links/new`, with query parameters defining the [Link](doc:link-entity) [See in API explorer](doc:create-link-endpoint) ## Link Parameters Table below shows the parameters you should specify when creating a Link: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "destination", "0-1": "string", "0-2": "**required**\nUTF8\nValid URL\nMax 1000 chars", "1-0": "slashtag", "1-1": "string", "1-2": "*optional*\nAllowed character set:\n`A-Z`, `a-z`, `0-9`, `_`, `-`\nMin 1 chars\nMax 40 chars", "2-0": "title", "2-1": "string", "2-2": "*optional*\nUTF8\nMin 3 chars\nMax 255 chars", "3-0": "domain", "3-1": "object", "h-3": "Description", "0-3": "The destination URL you want your branded short link to point to", "1-3": "The keyword portion of your branded short link. If not specified, will be autogenerated.", "2-3": "A title you assign to the branded short link in order to remember what's behind it", "3-2": "*optional*\nDomain Reference", "3-3": "A reference to the branded domain resource for this branded short link.\nIf not set, http://rebrand.ly is used", "4-0": "description", "4-1": "string", "4-2": "*optional*\nMin 3 chars\nMax 2000 chars", "4-3": "**Available only if your plan includes link notes**\n\nA description/note you associate to the branded short link" }, "cols": 4, "rows": 5 } [/block] [block:callout] { "type": "warning", "body": "Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).", "title": "Check for compatibility first" } [/block] ## Additional Link Parameters For advanced Link creation, further parameters can be specified: [block:parameters] { "data": { "h-0": "Link property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "favourite", "0-1": "boolean", "0-2": "*optional*", "0-3": "Whether this branded short link should be set as favourite (loved) or not" }, "cols": 4, "rows": 1 } [/block] [block:textarea] { "text": "Examples of valid Link object to POST:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n\t\"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\"\n}", "language": "json", "name": "rebrand.ly/video" }, { "code": "{\n \"title\": \"10 Books\",\n \"slashtag\": \"Books\",\n\t\"destination\": \"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\",\n \"domain\": {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\" \n }\n}", "language": "json", "name": "brand.cool/Books" }, { "code": "{\n\t\"destination\": \"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\",\n}", "language": "text", "name": "rebrand.ly/abcd" } ], "sidebar": true } [/block] [block:textarea] { "text": "Creating a new Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\"\n}'\n// slashtag and title are optional", "language": "curl", "name": "cURL POST" }, { "code": "$ curl 'https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&destination=https://www.youtube.com/watch?v=3VmtibKpmXI&slashtag=video&domain\\[id\\]=8f104cc5b6ee4a4ba7897b06ac2ddcfb'\n// slashtag and title are optional", "language": "text", "name": "cURL GET" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created link)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n}", "language": "json", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "0-0": "403", "h-2": "Description", "0-1": "[403 - Already exists](doc:403-already-exists-errors)", "0-2": "Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag.", "1-0": "403", "1-1": "[403 - Invalid format](doc:validation-errors)", "1-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field." }, "cols": 3, "rows": 2 } [/block]
Branded short links can be created via: - a `POST` HTTP request to `https://api.rebrandly.com/v1/links`, with JSON body defining the [Link](doc:link-entity) - a `GET` HTTP request to `https://api.rebrandly.com/v1/links/new`, with query parameters defining the [Link](doc:link-entity) [See in API explorer](doc:create-link-endpoint) ## Link Parameters Table below shows the parameters you should specify when creating a Link: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "destination", "0-1": "string", "0-2": "**required**\nUTF8\nValid URL\nMax 1000 chars", "1-0": "slashtag", "1-1": "string", "1-2": "*optional*\nAllowed character set:\n`A-Z`, `a-z`, `0-9`, `_`, `-`\nMin 1 chars\nMax 40 chars", "2-0": "title", "2-1": "string", "2-2": "*optional*\nUTF8\nMin 3 chars\nMax 255 chars", "3-0": "domain", "3-1": "object", "h-3": "Description", "0-3": "The destination URL you want your branded short link to point to", "1-3": "The keyword portion of your branded short link. If not specified, will be autogenerated.", "2-3": "A title you assign to the branded short link in order to remember what's behind it", "3-2": "*optional*\nDomain Reference", "3-3": "A reference to the branded domain resource for this branded short link.\nIf not set, http://rebrand.ly is used", "4-0": "description", "4-1": "string", "4-2": "*optional*\nMin 3 chars\nMax 2000 chars", "4-3": "**Available only if your plan includes link notes**\n\nA description/note you associate to the branded short link" }, "cols": 4, "rows": 5 } [/block] [block:callout] { "type": "warning", "body": "Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).", "title": "Check for compatibility first" } [/block] ## Additional Link Parameters For advanced Link creation, further parameters can be specified: [block:parameters] { "data": { "h-0": "Link property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "favourite", "0-1": "boolean", "0-2": "*optional*", "0-3": "Whether this branded short link should be set as favourite (loved) or not" }, "cols": 4, "rows": 1 } [/block] [block:textarea] { "text": "Examples of valid Link object to POST:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n\t\"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\"\n}", "language": "json", "name": "rebrand.ly/video" }, { "code": "{\n \"title\": \"10 Books\",\n \"slashtag\": \"Books\",\n\t\"destination\": \"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\",\n \"domain\": {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\" \n }\n}", "language": "json", "name": "brand.cool/Books" }, { "code": "{\n\t\"destination\": \"https://www.linkedin.com/pulse/10-books-every-founder-should-read-davide-de-guz\",\n}", "language": "text", "name": "rebrand.ly/abcd" } ], "sidebar": true } [/block] [block:textarea] { "text": "Creating a new Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\"\n}'\n// slashtag and title are optional", "language": "curl", "name": "cURL POST" }, { "code": "$ curl 'https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&destination=https://www.youtube.com/watch?v=3VmtibKpmXI&slashtag=video&domain\\[id\\]=8f104cc5b6ee4a4ba7897b06ac2ddcfb'\n// slashtag and title are optional", "language": "text", "name": "cURL GET" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created link)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n}", "language": "json", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "0-0": "403", "h-2": "Description", "0-1": "[403 - Already exists](doc:403-already-exists-errors)", "0-2": "Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag.", "1-0": "403", "1-1": "[403 - Invalid format](doc:validation-errors)", "1-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field." }, "cols": 3, "rows": 2 } [/block]
{"_id":"5791f7ab08d7110e0085f62d","body":"Branded short links can be updated via a `POST` method to `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier (id) of the branded short link, which accepts a JSON object describing the [Link](doc:link-entity).\n\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the branded short link you want to update\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## Link Parameters\nThe table below shows the parameters you should specify when updating a link.\nIf you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Link property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"destination\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nValid URL\\nMax 1000 chars\",\n    \"0-3\": \"New destination URL you want to assign to a branded short link\",\n    \"1-0\": \"title\",\n    \"1-1\": \"string\",\n    \"1-2\": \"**required**\\nUTF8\\nMin 2 chars\\nMax 300 chars\",\n    \"1-3\": \"New title you want to assign to a branded short link\",\n    \"2-0\": \"favourite\",\n    \"2-1\": \"boolean\",\n    \"2-2\": \"**required**\",\n    \"2-3\": \"Whether a link should be marked as favourite (loved) or not\",\n    \"3-0\": \"description\",\n    \"3-1\": \"string\",\n    \"3-2\": \"*optional*\",\n    \"3-3\": \"**Available only if your plan includes link notes**\\n\\nA description/note you associate to the branded short link\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\",\n  \"title\": \"Check for compatibility first\"\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Updating an existing link (changing \\\"What is Rebrandly\\\" into \\\"What is Rebrandly?\\\")\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json' \\\\\\n-d \\\\\\n'{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly?\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\"\\n}'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (updated link)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly?\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-15T10:05:22.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"fullName\\\": \\\"rebrand.ly\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Already exists](doc:403-already-exists-errors)\",\n    \"0-2\": \"Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag\",\n    \"1-0\": \"403\",\n    \"1-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"1-2\": \"Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field\",\n    \"2-0\": \"404\",\n    \"2-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"id\\\"\",\n    \"2-2\": \"Given `id` does not correspond to any existing link\",\n    \"3-0\": \"404\",\n    \"3-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"domain.id\\\"\",\n    \"3-2\": \"Given `domain.id` does not correspond to any existing domain\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]","isReference":false,"project":"577d1b8b74aea422007230c4","type":"basic","githubsync":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"updates":["57940b0e7d1e4a0e00346087"],"link_external":false,"link_url":"","slug":"update-a-link","sync_unique":"","version":"577d1b8b74aea422007230c7","title":"Updating a link","user":"577d1b6d87acf617003c421d","__v":2,"api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","auth":"required","params":[],"url":""},"category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:38:35.213Z","excerpt":"","hidden":false,"childrenPages":[]}

Updating a link


Branded short links can be updated via a `POST` method to `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier (id) of the branded short link, which accepts a JSON object describing the [Link](doc:link-entity). ## PATH Parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to update" }, "cols": 2, "rows": 1 } [/block] ## Link Parameters The table below shows the parameters you should specify when updating a link. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Link property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "destination", "0-1": "string", "0-2": "**required**\nUTF8\nValid URL\nMax 1000 chars", "0-3": "New destination URL you want to assign to a branded short link", "1-0": "title", "1-1": "string", "1-2": "**required**\nUTF8\nMin 2 chars\nMax 300 chars", "1-3": "New title you want to assign to a branded short link", "2-0": "favourite", "2-1": "boolean", "2-2": "**required**", "2-3": "Whether a link should be marked as favourite (loved) or not", "3-0": "description", "3-1": "string", "3-2": "*optional*", "3-3": "**Available only if your plan includes link notes**\n\nA description/note you associate to the branded short link" }, "cols": 4, "rows": 4 } [/block] [block:callout] { "type": "warning", "body": "Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).", "title": "Check for compatibility first" } [/block] [block:textarea] { "text": "Updating an existing link (changing \"What is Rebrandly\" into \"What is Rebrandly?\")", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"shortUrl\": \"rebrand.ly/video\"\n}'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated link)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n }\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Already exists](doc:403-already-exists-errors)", "0-2": "Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag", "1-0": "403", "1-1": "[403 - Invalid format](doc:validation-errors)", "1-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "2-0": "404", "2-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "2-2": "Given `id` does not correspond to any existing link", "3-0": "404", "3-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"domain.id\"", "3-2": "Given `domain.id` does not correspond to any existing domain" }, "cols": 3, "rows": 4 } [/block]
Branded short links can be updated via a `POST` method to `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier (id) of the branded short link, which accepts a JSON object describing the [Link](doc:link-entity). ## PATH Parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to update" }, "cols": 2, "rows": 1 } [/block] ## Link Parameters The table below shows the parameters you should specify when updating a link. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Link property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "destination", "0-1": "string", "0-2": "**required**\nUTF8\nValid URL\nMax 1000 chars", "0-3": "New destination URL you want to assign to a branded short link", "1-0": "title", "1-1": "string", "1-2": "**required**\nUTF8\nMin 2 chars\nMax 300 chars", "1-3": "New title you want to assign to a branded short link", "2-0": "favourite", "2-1": "boolean", "2-2": "**required**", "2-3": "Whether a link should be marked as favourite (loved) or not", "3-0": "description", "3-1": "string", "3-2": "*optional*", "3-3": "**Available only if your plan includes link notes**\n\nA description/note you associate to the branded short link" }, "cols": 4, "rows": 4 } [/block] [block:callout] { "type": "warning", "body": "Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a `description` field along with your Link object.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).", "title": "Check for compatibility first" } [/block] [block:textarea] { "text": "Updating an existing link (changing \"What is Rebrandly\" into \"What is Rebrandly?\")", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"shortUrl\": \"rebrand.ly/video\"\n}'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated link)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n }\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Already exists](doc:403-already-exists-errors)", "0-2": "Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag", "1-0": "403", "1-1": "[403 - Invalid format](doc:validation-errors)", "1-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "2-0": "404", "2-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "2-2": "Given `id` does not correspond to any existing link", "3-0": "404", "3-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"domain.id\"", "3-2": "Given `domain.id` does not correspond to any existing domain" }, "cols": 3, "rows": 4 } [/block]
{"_id":"5791f7d24973f50e00f0768c","project":"577d1b8b74aea422007230c4","user":"577d1b6d87acf617003c421d","excerpt":"","link_external":false,"order":3,"parentDoc":null,"slug":"get-link-details","sync_unique":"","__v":2,"category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:39:14.857Z","next":{"description":"","pages":[]},"version":"577d1b8b74aea422007230c7","githubsync":"","hidden":false,"link_url":"","isReference":false,"title":"Getting link details","type":"basic","updates":["57940b817d1e4a0e00346088"],"api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"body":"Each Link object has its own URL: `https://api.rebrandly.com/v1/links/{id}`, where ` {id}`  is the unique identifier of the branded short link.\nTo get Link object details, you should HTTP GET on the specific links endpoint, and a JSON object representing the link will be returned.\n\n## PATH PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the branded short link you want to get details for\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting link details\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (link details)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"fullName\\\": \\\"rebrand.ly\\\"\\n  },\\n  \\\"status\\\": \\\"active\\\",\\n  \\\"favourite\\\": false\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"404\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors)\",\n    \"0-2\": \"Given `id` does not correspond to any existing link\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","childrenPages":[]}

Getting link details


Each Link object has its own URL: `https://api.rebrandly.com/v1/links/{id}`, where ` {id}` is the unique identifier of the branded short link. To get Link object details, you should HTTP GET on the specific links endpoint, and a JSON object representing the link will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting link details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (link details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n \"status\": \"active\",\n \"favourite\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing link" }, "cols": 3, "rows": 1 } [/block]
Each Link object has its own URL: `https://api.rebrandly.com/v1/links/{id}`, where ` {id}` is the unique identifier of the branded short link. To get Link object details, you should HTTP GET on the specific links endpoint, and a JSON object representing the link will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting link details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (link details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n \"status\": \"active\",\n \"favourite\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing link" }, "cols": 3, "rows": 1 } [/block]
{"_id":"5791f7b608d7110e0085f62e","excerpt":"","githubsync":"","title":"Listing your links","createdAt":"2016-07-22T10:38:46.725Z","hidden":false,"order":4,"parentDoc":null,"slug":"list-links","project":"577d1b8b74aea422007230c4","__v":2,"api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"category":"5791f02edaa64a0e008bc261","isReference":false,"link_url":"","next":{"pages":[],"description":""},"sync_unique":"","type":"basic","version":"577d1b8b74aea422007230c7","body":"You can access your branded short links collection at any time with an HTTP `GET` on the links endpoint `https://api.rebrandly.com/v1/links`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).\",\n  \"title\": \"Understanding pagination and sortings\"\n}\n[/block]\n\nIf you want to get only branded short links matching a given set of conditions, you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"orderBy\",\n    \"0-1\": \"string enum\\n- `createdAt`\\n  *default*\\n- `updatedAt`\\n- `title`\\n- `slashtag`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Sorting criteria to apply to your branded short links collection\",\n    \"1-0\": \"orderDir\",\n    \"1-1\": \"string enum\\n- `desc`\\n  *default*\\n- `asc`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Sorting direction to apply to your branded short links collection\",\n    \"2-0\": \"offset\",\n    \"2-1\": \"integer\\n*default is 0*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"2-2\": \"*optional*\\nPositive (including zero)\",\n    \"2-3\": \"How many branded short links to skip\",\n    \"3-0\": \"limit\",\n    \"3-1\": \"integer\\n*default is 100*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"3-2\": \"*optional*\\nStrictly positive\\nMax 100\",\n    \"3-3\": \"How many branded short links to load, starting from offset on\",\n    \"4-0\": \"favourite\",\n    \"4-1\": \"boolean\",\n    \"4-2\": \"*optional*\",\n    \"4-3\": \"Filter branded short links depending on favourite (loved) property\",\n    \"5-0\": \"status\",\n    \"5-1\": \"string enum\\n- `active`\\n- `trashed`\",\n    \"5-2\": \"*optional*\",\n    \"5-3\": \"Filter branded short links according to their status\",\n    \"6-0\": \"domain.id\",\n    \"6-1\": \"string\",\n    \"6-2\": \"*optional*\",\n    \"6-3\": \"Filter branded short links which refer to a specific branded domain id\"\n  },\n  \"cols\": 4,\n  \"rows\": 7\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting links collection\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links?orderBy=createdAt&orderDir=desc&offset=0&limit=100&favourite=false&status=active&domain[id]=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (list of links matching filters)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n {\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly?\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-15T10:05:22.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"favourite\\\": false,\\n   \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"fullName\\\": \\\"rebrand.ly\\\"\\n  }\\n},\\n{\\n  \\\"id\\\": \\\"abcdecc5b6ee45d6g7897b06ac2d1xyz\\\",\\n  \\\"title\\\": \\\"Trending now movies\\\",\\n  \\\"slashtag\\\": \\\"MoviesTr3nd\\\",\\n  \\\"destination\\\": \\\"http://www.the-numbers.com/movies/trending\\\",\\n  \\\"createdAt\\\": \\\"2016-07-12T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-17T10:05:22.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/MoviesTr3nd\\\",\\n  \\\"favourite\\\": false,\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n  }\\n },\\n // up to 100 non-favourite Link objects created with domain rebrand.ly\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","link_external":false,"updates":["57940ccaf7ffa30e00431774"],"user":"577d1b6d87acf617003c421d","childrenPages":[]}

Listing your links


You can access your branded short links collection at any time with an HTTP `GET` on the links endpoint `https://api.rebrandly.com/v1/links`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only branded short links matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `createdAt`\n *default*\n- `updatedAt`\n- `title`\n- `slashtag`\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your branded short links collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your branded short links collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many branded short links to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many branded short links to load, starting from offset on", "4-0": "favourite", "4-1": "boolean", "4-2": "*optional*", "4-3": "Filter branded short links depending on favourite (loved) property", "5-0": "status", "5-1": "string enum\n- `active`\n- `trashed`", "5-2": "*optional*", "5-3": "Filter branded short links according to their status", "6-0": "domain.id", "6-1": "string", "6-2": "*optional*", "6-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 7 } [/block] [block:textarea] { "text": "GETting links collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links?orderBy=createdAt&orderDir=desc&offset=0&limit=100&favourite=false&status=active&domain[id]=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of links matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"favourite\": false,\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n }\n},\n{\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"title\": \"Trending now movies\",\n \"slashtag\": \"MoviesTr3nd\",\n \"destination\": \"http://www.the-numbers.com/movies/trending\",\n \"createdAt\": \"2016-07-12T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-17T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/MoviesTr3nd\",\n \"favourite\": false,\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n },\n // up to 100 non-favourite Link objects created with domain rebrand.ly\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
You can access your branded short links collection at any time with an HTTP `GET` on the links endpoint `https://api.rebrandly.com/v1/links`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only branded short links matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `createdAt`\n *default*\n- `updatedAt`\n- `title`\n- `slashtag`\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your branded short links collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your branded short links collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many branded short links to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many branded short links to load, starting from offset on", "4-0": "favourite", "4-1": "boolean", "4-2": "*optional*", "4-3": "Filter branded short links depending on favourite (loved) property", "5-0": "status", "5-1": "string enum\n- `active`\n- `trashed`", "5-2": "*optional*", "5-3": "Filter branded short links according to their status", "6-0": "domain.id", "6-1": "string", "6-2": "*optional*", "6-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 7 } [/block] [block:textarea] { "text": "GETting links collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links?orderBy=createdAt&orderDir=desc&offset=0&limit=100&favourite=false&status=active&domain[id]=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of links matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly?\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-15T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"favourite\": false,\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n }\n},\n{\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"title\": \"Trending now movies\",\n \"slashtag\": \"MoviesTr3nd\",\n \"destination\": \"http://www.the-numbers.com/movies/trending\",\n \"createdAt\": \"2016-07-12T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-17T10:05:22.000Z\",\n \"shortUrl\": \"rebrand.ly/MoviesTr3nd\",\n \"favourite\": false,\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n },\n // up to 100 non-favourite Link objects created with domain rebrand.ly\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
{"_id":"57924b35310cb22200f6e179","excerpt":"","hidden":false,"link_url":"","title":"Counting your links","type":"basic","githubsync":"","isReference":false,"parentDoc":null,"version":"577d1b8b74aea422007230c7","__v":1,"body":"Your branded short links collection size can be read with a HTTP `GET` on the count links endpoint `https://api.rebrandly.com/v1/links/count`.\n\nIf you want to get the number of branded short links matching a given set of conditions (e.g. answering *how many branded short links have been created with the domain brand.cool?*), you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"favourite\",\n    \"0-1\": \"boolean\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Filter branded short links depnding on the favourite (loved) property\",\n    \"1-0\": \"status\",\n    \"1-1\": \"string enum\\n- `active`\\n- `trashed`\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Filter branded short links depending on their status\",\n    \"2-0\": \"domain.id\",\n    \"2-1\": \"string\",\n    \"2-2\": \"*optional*\",\n    \"2-3\": \"Filter branded short links which refer to a specific branded domain id\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting filtered links collection size\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/count?favourite=false&status=active&domain.id=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"A numeric value is provided back:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"count\\\": 42\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field.\",\n    \"1-0\": \"404\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"domain.id\\\"\",\n    \"1-2\": \"Given `domain.id` does not correspond to any existing domain\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T16:35:01.133Z","slug":"counting-your-links","sync_unique":"","user":"577d1b6d87acf617003c421d","api":{"auth":"required","params":[],"url":"","settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"link_external":false,"order":5,"project":"577d1b8b74aea422007230c4","updates":["57940dfa0b4ca20e00beaa43"],"childrenPages":[]}

Counting your links


Your branded short links collection size can be read with a HTTP `GET` on the count links endpoint `https://api.rebrandly.com/v1/links/count`. If you want to get the number of branded short links matching a given set of conditions (e.g. answering *how many branded short links have been created with the domain brand.cool?*), you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "favourite", "0-1": "boolean", "0-2": "*optional*", "0-3": "Filter branded short links depnding on the favourite (loved) property", "1-0": "status", "1-1": "string enum\n- `active`\n- `trashed`", "1-2": "*optional*", "1-3": "Filter branded short links depending on their status", "2-0": "domain.id", "2-1": "string", "2-2": "*optional*", "2-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 3 } [/block] [block:textarea] { "text": "GETting filtered links collection size", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/count?favourite=false&status=active&domain.id=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field.", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"domain.id\"", "1-2": "Given `domain.id` does not correspond to any existing domain" }, "cols": 3, "rows": 2 } [/block]
Your branded short links collection size can be read with a HTTP `GET` on the count links endpoint `https://api.rebrandly.com/v1/links/count`. If you want to get the number of branded short links matching a given set of conditions (e.g. answering *how many branded short links have been created with the domain brand.cool?*), you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "favourite", "0-1": "boolean", "0-2": "*optional*", "0-3": "Filter branded short links depnding on the favourite (loved) property", "1-0": "status", "1-1": "string enum\n- `active`\n- `trashed`", "1-2": "*optional*", "1-3": "Filter branded short links depending on their status", "2-0": "domain.id", "2-1": "string", "2-2": "*optional*", "2-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 3 } [/block] [block:textarea] { "text": "GETting filtered links collection size", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/count?favourite=false&status=active&domain.id=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field.", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"domain.id\"", "1-2": "Given `domain.id` does not correspond to any existing domain" }, "cols": 3, "rows": 2 } [/block]
{"_id":"5791f7c608d7110e0085f62f","__v":1,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"link_url":"","order":6,"project":"577d1b8b74aea422007230c4","user":"577d1b6d87acf617003c421d","excerpt":"","isReference":false,"link_external":false,"slug":"delete-a-link","updates":["5794106f10cd740e004f59d2"],"version":"577d1b8b74aea422007230c7","body":"A branded short link can be deleted from your collection in two ways:\n- *Trashing* it: this allows you to restore it later\n- *Deleting* it: this is a permanent action, you will need to recreate the link if you want it in the future.\n\nBoth options require you to send a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier of the branded short link.\nIn case you want to trash a link, without permanently deleting it, you should add a `trash` query parameter to the request (see below).\n\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the branded short link you want to trash or delete\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"0-0\": \"trash\",\n    \"0-1\": \"boolean\\n*default is false*\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Set to `true` if you want the branded short link to be recoverable in the future\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Trashing a single link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af?trash=true' \\\\\\n-X DELETE \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Permanently deleting a single link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\\\\n-X DELETE \\\\\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"When a link is trashed, its updated object representation is returned. On the other hand, when a link is deleted, its last object representation is returned (prior to deletion).\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"title\\\": \\\"What is Rebrandly\\\",\\n  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n    \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n  },\\n  \\\"status\\\": \\\"trashed\\\",\\n  \\\"favourite\\\": false\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid `trash` property format in query parameters\",\n    \"1-0\": \"404\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors)\",\n    \"1-2\": \"Given `id` does not correspond to any existing link\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","category":"5791f02edaa64a0e008bc261","hidden":false,"parentDoc":null,"sync_unique":"","createdAt":"2016-07-22T10:39:02.221Z","githubsync":"","title":"Deleting a link","type":"basic","childrenPages":[]}

Deleting a link


A branded short link can be deleted from your collection in two ways: - *Trashing* it: this allows you to restore it later - *Deleting* it: this is a permanent action, you will need to recreate the link if you want it in the future. Both options require you to send a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier of the branded short link. In case you want to trash a link, without permanently deleting it, you should add a `trash` query parameter to the request (see below). ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to trash or delete" }, "cols": 2, "rows": 1 } [/block] ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "0-0": "trash", "0-1": "boolean\n*default is false*", "h-2": "Description", "0-2": "Set to `true` if you want the branded short link to be recoverable in the future" }, "cols": 3, "rows": 1 } [/block] [block:textarea] { "text": "Trashing a single link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af?trash=true' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "Permanently deleting a single link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a link is trashed, its updated object representation is returned. On the other hand, when a link is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n },\n \"status\": \"trashed\",\n \"favourite\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid `trash` property format in query parameters", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors)", "1-2": "Given `id` does not correspond to any existing link" }, "cols": 3, "rows": 2 } [/block]
A branded short link can be deleted from your collection in two ways: - *Trashing* it: this allows you to restore it later - *Deleting* it: this is a permanent action, you will need to recreate the link if you want it in the future. Both options require you to send a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/links/{id}`, where `{id}` is the unique identifier of the branded short link. In case you want to trash a link, without permanently deleting it, you should add a `trash` query parameter to the request (see below). ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded short link you want to trash or delete" }, "cols": 2, "rows": 1 } [/block] ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "0-0": "trash", "0-1": "boolean\n*default is false*", "h-2": "Description", "0-2": "Set to `true` if you want the branded short link to be recoverable in the future" }, "cols": 3, "rows": 1 } [/block] [block:textarea] { "text": "Trashing a single link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af?trash=true' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "Permanently deleting a single link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a link is trashed, its updated object representation is returned. On the other hand, when a link is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"title\": \"What is Rebrandly\",\n \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n },\n \"status\": \"trashed\",\n \"favourite\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid `trash` property format in query parameters", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors)", "1-2": "Given `id` does not correspond to any existing link" }, "cols": 3, "rows": 2 } [/block]
{"_id":"57960a31cf84ae1700244f0b","type":"basic","updates":[],"__v":0,"githubsync":"","sync_unique":"","slug":"branded-domains","user":"577d1b6d87acf617003c421d","api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]}},"hidden":false,"link_external":false,"parentDoc":null,"body":"Branded domains allow you to create your custom link shortener.\nBranded domains can be viewed [individually](doc:getting-single-domain-details)  or [as a collection](doc:listing-your-domains-collection)","link_url":"","order":0,"excerpt":"","isReference":false,"project":"577d1b8b74aea422007230c4","title":"Branded domains","version":"577d1b8b74aea422007230c7","category":"5792332d90ad641700d46b75","createdAt":"2016-07-25T12:46:41.997Z","childrenPages":[]}

Branded domains


Branded domains allow you to create your custom link shortener. Branded domains can be viewed [individually](doc:getting-single-domain-details) or [as a collection](doc:listing-your-domains-collection)
Branded domains allow you to create your custom link shortener. Branded domains can be viewed [individually](doc:getting-single-domain-details) or [as a collection](doc:listing-your-domains-collection)
{"_id":"579235f17feea81700e5abed","slug":"getting-single-domain-details","user":"577d1b6d87acf617003c421d","__v":1,"project":"577d1b8b74aea422007230c4","parentDoc":null,"sync_unique":"","type":"basic","version":"577d1b8b74aea422007230c7","api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required"},"category":"5792332d90ad641700d46b75","excerpt":"","updates":["5792b917f967f617000d9e81"],"body":"Each Domain object has its own URL: `https://api.rebrandly.com/v1/domains/{id}`, where `{id}` is the unique identifier of the branded domain.\nTo get Domain object details, you should HTTP `GET` on the specific domain endpoint, and a JSON object representing the domain will be returned.\n\n## PATH PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the branded domain you want to get details about\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting Domain details\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/domains/4d20ec31db1e48c5aded19e93f137a11' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (Domain details)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"4d20ec31db1e48c5aded19e93f137a11\\\",\\n  \\\"fullName\\\": \\\"brand.cool\\\",\\n  \\\"topLevelDomain\\\": \\\"cool\\\",\\n  \\\"createdAt\\\": \\\"2016-07-01T13:12:22.000Z\\\",\\n  \\\"updatedAt\\\": \\\"2016-07-03T13:17:50.000Z\\\",\\n  \\\"type\\\": \\\"user\\\",\\n  \\\"active\\\": false\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"404\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors)\",\n    \"0-2\": \"Given `id` does not correspond to any existing domain\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","link_url":"","title":"Getting domain details","isReference":false,"link_external":false,"order":1,"createdAt":"2016-07-22T15:04:17.214Z","githubsync":"","hidden":false,"childrenPages":[]}

Getting domain details


Each Domain object has its own URL: `https://api.rebrandly.com/v1/domains/{id}`, where `{id}` is the unique identifier of the branded domain. To get Domain object details, you should HTTP `GET` on the specific domain endpoint, and a JSON object representing the domain will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded domain you want to get details about" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting Domain details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains/4d20ec31db1e48c5aded19e93f137a11' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (Domain details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing domain" }, "cols": 3, "rows": 1 } [/block]
Each Domain object has its own URL: `https://api.rebrandly.com/v1/domains/{id}`, where `{id}` is the unique identifier of the branded domain. To get Domain object details, you should HTTP `GET` on the specific domain endpoint, and a JSON object representing the domain will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the branded domain you want to get details about" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting Domain details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains/4d20ec31db1e48c5aded19e93f137a11' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (Domain details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing domain" }, "cols": 3, "rows": 1 } [/block]
{"_id":"5792333c310cb22200f6e162","title":"Listing your domains","updates":["5792baac23106419009c4315"],"__v":2,"api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]}},"excerpt":"","hidden":false,"link_external":false,"next":{"description":"","pages":[]},"version":"577d1b8b74aea422007230c7","category":"5792332d90ad641700d46b75","isReference":false,"order":2,"project":"577d1b8b74aea422007230c4","type":"basic","user":"577d1b6d87acf617003c421d","parentDoc":null,"slug":"listing-your-domains-collection","sync_unique":"","body":"You can access your branded domains collection at any time with an HTTP `GET` on the branded domains endpoint `https://api.rebrandly.com/v1/domains`.\n\nWe recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).\n\nIf you want to get only branded domains matching a given set of conditions, you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"orderBy\",\n    \"0-1\": \"string enum\\n- `createdAt`\\n  *default*\\n- `updatedAt`\\n- `fullName`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Sorting criteria to apply to your branded domains collection\",\n    \"1-0\": \"orderDir\",\n    \"1-1\": \"string enum\\n- `desc`\\n  *default*\\n- `asc`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Sorting direction to apply to your branded short links collection\",\n    \"2-0\": \"offset\",\n    \"2-1\": \"integer\\n*default is 0*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"2-2\": \"*optional*\\nPositive\\n(including zero)\",\n    \"2-3\": \"How many branded domains to skip\",\n    \"3-0\": \"limit\",\n    \"3-1\": \"integer\\n*default is 100*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"3-2\": \"*optional*\\nStrictly positive\\nMax 100\",\n    \"3-3\": \"How many branded domains to load, starting from offset on\",\n    \"4-0\": \"active\",\n    \"4-1\": \"boolean\",\n    \"4-2\": \"*optional*\",\n    \"4-3\": \"Filter branded domains depending on whether they can be used to brand short links or not\",\n    \"5-0\": \"type\",\n    \"5-1\": \"string enum\\n- `user`\\n- `service`\",\n    \"5-2\": \"*optional*\",\n    \"5-3\": \"Filter branded domains depending on their type (owned by user or service domains like rebrand.ly)\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting branded domains collection\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/domains?orderBy=createdAt&orderDir=desc&offset=0&limit=100&active=true&type=user' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (list of domains matching filters)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"id\\\": \\\"4d20ec31db1e48c5aded19e93f137a11\\\",\\n    \\\"fullName\\\": \\\"brand.cool\\\",\\n    \\\"topLevelDomain\\\": \\\"cool\\\",\\n    \\\"createdAt\\\": \\\"2016-07-01T13:12:22.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-03T13:17:50.000Z\\\",\\n    \\\"type\\\": \\\"user\\\",\\n    \\\"active\\\": false\\n  },\\n  // up to 100 active user branded domains\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field.\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","createdAt":"2016-07-22T14:52:44.134Z","githubsync":"","link_url":"","childrenPages":[]}

Listing your domains


You can access your branded domains collection at any time with an HTTP `GET` on the branded domains endpoint `https://api.rebrandly.com/v1/domains`. We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting). If you want to get only branded domains matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `createdAt`\n *default*\n- `updatedAt`\n- `fullName`\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your branded domains collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your branded short links collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive\n(including zero)", "2-3": "How many branded domains to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many branded domains to load, starting from offset on", "4-0": "active", "4-1": "boolean", "4-2": "*optional*", "4-3": "Filter branded domains depending on whether they can be used to brand short links or not", "5-0": "type", "5-1": "string enum\n- `user`\n- `service`", "5-2": "*optional*", "5-3": "Filter branded domains depending on their type (owned by user or service domains like rebrand.ly)" }, "cols": 4, "rows": 6 } [/block] [block:textarea] { "text": "GETting branded domains collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains?orderBy=createdAt&orderDir=desc&offset=0&limit=100&active=true&type=user' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of domains matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n },\n // up to 100 active user branded domains\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field." }, "cols": 3, "rows": 1 } [/block]
You can access your branded domains collection at any time with an HTTP `GET` on the branded domains endpoint `https://api.rebrandly.com/v1/domains`. We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting). If you want to get only branded domains matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `createdAt`\n *default*\n- `updatedAt`\n- `fullName`\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your branded domains collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your branded short links collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive\n(including zero)", "2-3": "How many branded domains to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many branded domains to load, starting from offset on", "4-0": "active", "4-1": "boolean", "4-2": "*optional*", "4-3": "Filter branded domains depending on whether they can be used to brand short links or not", "5-0": "type", "5-1": "string enum\n- `user`\n- `service`", "5-2": "*optional*", "5-3": "Filter branded domains depending on their type (owned by user or service domains like rebrand.ly)" }, "cols": 4, "rows": 6 } [/block] [block:textarea] { "text": "GETting branded domains collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains?orderBy=createdAt&orderDir=desc&offset=0&limit=100&active=true&type=user' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of domains matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"4d20ec31db1e48c5aded19e93f137a11\",\n \"fullName\": \"brand.cool\",\n \"topLevelDomain\": \"cool\",\n \"createdAt\": \"2016-07-01T13:12:22.000Z\",\n \"updatedAt\": \"2016-07-03T13:17:50.000Z\",\n \"type\": \"user\",\n \"active\": false\n },\n // up to 100 active user branded domains\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field." }, "cols": 3, "rows": 1 } [/block]
{"_id":"57924cb57feea81700e5ac15","slug":"counting-your-domains","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","__v":1,"body":"Your branded domains collection size can be read with a HTTP `GET` on the count domains endpoint `https://api.rebrandly.com/v1/domains/count`.\n\nIf you want to get the number of branded domains matching a given set of conditions (e.g. answering *how many active branded domains are in my account?*), you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"active\",\n    \"0-1\": \"boolean\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Filter branded domains depending on whether they can be used to branded short links or not\",\n    \"1-0\": \"type\",\n    \"1-1\": \"string enum\\n- `user`\\n- `service`\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Filter branded domains depending on their type (own by user or service domains like rebrand.ly)\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting domains collection size\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/domains/count?active=true&type=user' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"A numeric value is provided back:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"count\\\": 42\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","link_url":"","parentDoc":null,"hidden":false,"link_external":false,"order":3,"title":"Counting your domains","createdAt":"2016-07-22T16:41:25.478Z","sync_unique":"","updates":["5792bcd479215d1900324382"],"project":"577d1b8b74aea422007230c4","type":"basic","api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]}},"category":"5792332d90ad641700d46b75","excerpt":"","githubsync":"","isReference":false,"childrenPages":[]}

Counting your domains


Your branded domains collection size can be read with a HTTP `GET` on the count domains endpoint `https://api.rebrandly.com/v1/domains/count`. If you want to get the number of branded domains matching a given set of conditions (e.g. answering *how many active branded domains are in my account?*), you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "active", "0-1": "boolean", "0-2": "*optional*", "0-3": "Filter branded domains depending on whether they can be used to branded short links or not", "1-0": "type", "1-1": "string enum\n- `user`\n- `service`", "1-2": "*optional*", "1-3": "Filter branded domains depending on their type (own by user or service domains like rebrand.ly)" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "GETting domains collection size", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains/count?active=true&type=user' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
Your branded domains collection size can be read with a HTTP `GET` on the count domains endpoint `https://api.rebrandly.com/v1/domains/count`. If you want to get the number of branded domains matching a given set of conditions (e.g. answering *how many active branded domains are in my account?*), you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "active", "0-1": "boolean", "0-2": "*optional*", "0-3": "Filter branded domains depending on whether they can be used to branded short links or not", "1-0": "type", "1-1": "string enum\n- `user`\n- `service`", "1-2": "*optional*", "1-3": "Filter branded domains depending on their type (own by user or service domains like rebrand.ly)" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "GETting domains collection size", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/domains/count?active=true&type=user' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
{"_id":"579634e73fedf00e0067acdc","type":"basic","__v":0,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"category":"579242d1310cb22200f6e172","isReference":false,"slug":"account-identity","title":"Account identity","updates":[],"version":"577d1b8b74aea422007230c7","body":"Accounts are designed to provide your application with an identity.\nYou can [get](doc:getting-account-details) account details at any time.","createdAt":"2016-07-25T15:48:55.820Z","link_url":"","order":0,"excerpt":"","githubsync":"","parentDoc":null,"project":"577d1b8b74aea422007230c4","sync_unique":"","hidden":false,"link_external":false,"user":"577d1b6d87acf617003c421d","childrenPages":[]}

Account identity


Accounts are designed to provide your application with an identity. You can [get](doc:getting-account-details) account details at any time.
Accounts are designed to provide your application with an identity. You can [get](doc:getting-account-details) account details at any time.
{"_id":"5792432108d7110e0085f69a","excerpt":"","githubsync":"","isReference":false,"order":1,"createdAt":"2016-07-22T16:00:33.978Z","link_external":false,"link_url":"","parentDoc":null,"slug":"getting-account-details","title":"Getting account details","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":"","settings":""},"category":"579242d1310cb22200f6e172","hidden":false,"type":"basic","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","__v":2,"body":"To get account details, you should HTTP `GET` on the account endpoint `https://api.rebrandly.com/v1/account`, and a JSON object representing the Account will be returned.\n[block:html]\n{\n  \"html\": \"<div></div>\\n\\n<style></style>\"\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting Account details\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/account' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (Account details)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"fullName\\\": \\\"Stanford University\\\",\\n  \\\"username\\\": \\\"fake@stanford.edu\\\",\\n  \\\"email\\\": \\\"fake@stanford.edu\\\",\\n  \\\"avatarUrl\\\": \\\"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\\\",\\n  \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n  \\\"subscription\\\": {\\n    \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"limits\\\": {\\n      \\\"links\\\": {\\n        \\\"used\\\": 7504,\\n        \\\"max\\\": 10000\\n      },\\n      \\\"domains\\\": {\\n        \\\"used\\\": 17,\\n        \\\"max\\\": 100\\n      },\\n      \\\"teammates\\\": {\\n        \\\"used\\\": 5,\\n        \\\"max\\\": 100\\n      },\\n      \\\"tags\\\": {\\n        \\\"used\\\": 0,\\n        \\\"max\\\": 50\\n      },\\n      \\\"scripts\\\": {\\n        \\\"used\\\": 0,\\n        \\\"max\\\": 50\\n      }\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","next":{"description":"","pages":[]},"project":"577d1b8b74aea422007230c4","sync_unique":"","updates":["5793f6957d1e4a0e00346082"],"childrenPages":[]}

Getting account details


To get account details, you should HTTP `GET` on the account endpoint `https://api.rebrandly.com/v1/account`, and a JSON object representing the Account will be returned. [block:html] { "html": "<div></div>\n\n<style></style>" } [/block] [block:textarea] { "text": "GETting Account details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/account' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (Account details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"fullName\": \"Stanford University\",\n \"username\": \"fake@stanford.edu\",\n \"email\": \"fake@stanford.edu\",\n \"avatarUrl\": \"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"subscription\": {\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"limits\": {\n \"links\": {\n \"used\": 7504,\n \"max\": 10000\n },\n \"domains\": {\n \"used\": 17,\n \"max\": 100\n },\n \"teammates\": {\n \"used\": 5,\n \"max\": 100\n },\n \"tags\": {\n \"used\": 0,\n \"max\": 50\n },\n \"scripts\": {\n \"used\": 0,\n \"max\": 50\n }\n }\n }\n}", "language": "json" } ], "sidebar": true } [/block]
To get account details, you should HTTP `GET` on the account endpoint `https://api.rebrandly.com/v1/account`, and a JSON object representing the Account will be returned. [block:html] { "html": "<div></div>\n\n<style></style>" } [/block] [block:textarea] { "text": "GETting Account details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/account' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (Account details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"fullName\": \"Stanford University\",\n \"username\": \"fake@stanford.edu\",\n \"email\": \"fake@stanford.edu\",\n \"avatarUrl\": \"https://d3e7f5z1blhqw4.cloudfront.net/avatars/364381e1-963e-460a-9a6b-a16e86d196a2\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"subscription\": {\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"limits\": {\n \"links\": {\n \"used\": 7504,\n \"max\": 10000\n },\n \"domains\": {\n \"used\": 17,\n \"max\": 100\n },\n \"teammates\": {\n \"used\": 5,\n \"max\": 100\n },\n \"tags\": {\n \"used\": 0,\n \"max\": 50\n },\n \"scripts\": {\n \"used\": 0,\n \"max\": 50\n }\n }\n }\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c0e7e875aab0002627ab74","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T09:48:24.876Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Tags are used to better organize your branded links collection.\nTags can be viewed [individually](doc:getting-tag-details) or [as a collection](doc:listing-your-tags).","excerpt":"","slug":"tags","type":"basic","title":"Tags","__v":0,"parentDoc":null,"childrenPages":[]}

Tags


Tags are used to better organize your branded links collection. Tags can be viewed [individually](doc:getting-tag-details) or [as a collection](doc:listing-your-tags).
Tags are used to better organize your branded links collection. Tags can be viewed [individually](doc:getting-tag-details) or [as a collection](doc:listing-your-tags).
{"_id":"579255df4973f50e00f07705","slug":"creating-a-new-tag","sync_unique":"","api":{"params":[],"url":"","settings":"","results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check for compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Tags feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\nTags can be created via a `POST` method to `http://api.rebrandly.com/v1/tags`, which accepts a JSON object describing the [Tag](doc:tag-model) .\n\n## Tag Parameters\nThe table below shows the parameters you should specify when creating a Tag:\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-0\": \"Link property\",\n    \"0-0\": \"name\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nMin 2 chars\",\n    \"1-0\": \"color\",\n    \"1-1\": \"string\",\n    \"1-2\": \"*optional*\\nValid hex\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"Unique name of the tag\",\n    \"1-3\": \"Hexadecimal representation of a color assigned to the tag\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Creating a new Tag\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl http://api.rebrandly.com/tags \\\\\\n-X POST \\\\\\n-H 'Accept: application/json' \\\\\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\\\\n-H 'Content-Type: application/json' -d '\\n{\\n  \\\"name\\\": \\\"personal\\\",\\n  \\\"color\\\": \\\"ddeeff\\\"\\n}'\\n\\nHTTP/1.1 200 OK\\n\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (just created Tag)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"personal\\\",\\n  \\\"color\\\": \\\"#ddeeff\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","createdAt":"2016-07-22T17:20:31.258Z","excerpt":"","link_external":false,"type":"basic","updates":["579411d010cd740e004f59d3"],"version":"577d1b8b74aea422007230c7","hidden":false,"isReference":false,"githubsync":"","order":1,"user":"577d1b6d87acf617003c421d","__v":2,"category":"5792557390ad641700d46b8d","link_url":"","parentDoc":null,"project":"577d1b8b74aea422007230c4","title":"Creating a new tag","next":{"description":"","pages":[]},"childrenPages":[]}

Creating a new tag


[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] Tags can be created via a `POST` method to `http://api.rebrandly.com/v1/tags`, which accepts a JSON object describing the [Tag](doc:tag-model) . ## Tag Parameters The table below shows the parameters you should specify when creating a Tag: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 2 chars", "1-0": "color", "1-1": "string", "1-2": "*optional*\nValid hex", "h-3": "Description", "0-3": "Unique name of the tag", "1-3": "Hexadecimal representation of a color assigned to the tag" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Creating a new Tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl http://api.rebrandly.com/tags \\\n-X POST \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\n-H 'Content-Type: application/json' -d '\n{\n \"name\": \"personal\",\n \"color\": \"ddeeff\"\n}'\n\nHTTP/1.1 200 OK\n", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created Tag)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"personal\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] Tags can be created via a `POST` method to `http://api.rebrandly.com/v1/tags`, which accepts a JSON object describing the [Tag](doc:tag-model) . ## Tag Parameters The table below shows the parameters you should specify when creating a Tag: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 2 chars", "1-0": "color", "1-1": "string", "1-2": "*optional*\nValid hex", "h-3": "Description", "0-3": "Unique name of the tag", "1-3": "Hexadecimal representation of a color assigned to the tag" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Creating a new Tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl http://api.rebrandly.com/tags \\\n-X POST \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\n-H 'Content-Type: application/json' -d '\n{\n \"name\": \"personal\",\n \"color\": \"ddeeff\"\n}'\n\nHTTP/1.1 200 OK\n", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created Tag)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"personal\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c0e88375aab0002627ab75","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T09:50:59.837Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Tags can be updated via a `POST` method to `https://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier (id) of the tag, which accepts a JSON object describing the [Tag](doc:tag-model).\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Tags feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"Unique identifier of the tag you want to update\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## Link Parameters\nThe table below shows the parameters you should specify when updating a tag.\nIf you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Tag property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"name\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nMin 3 chars\\nMax 255 chars\",\n    \"0-3\": \"New name you want to assign to the tag\",\n    \"1-0\": \"color\",\n    \"1-1\": \"string\",\n    \"1-2\": \"**required**\\n6-digits Hexadecimal\",\n    \"1-3\": \"Hexadecimal code of the color you want to assign to the tag (without the opening \\\"#\\\" char)\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Updating an existing tag (changing \\\"marketing\\\" into \\\"promo\\\")\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/tags/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json' \\\\\\n-d \\\\\\n'{\\n  \\\"id\\\": \\\"gewa4cc5b6ee45d6gkj65b06ac2d1hww\\\",\\n  \\\"name\\\": \\\"promo\\\",\\n  \\\"color\\\": \\\"FFAA99\\\"\\n}'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (updated tag)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"gewa4cc5b6ee45d6gkj65b06ac2d1hww\\\",\\n  \\\"name\\\": \\\"promo\\\",\\n  \\\"color\\\": \\\"FFAA99\\\"\\n}\",\n      \"language\": \"text\",\n      \"name\": \"JSON\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"id\\\"\",\n    \"1-2\": \"Given `id` does not correspond to any existing tag\",\n    \"1-0\": \"404\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","excerpt":"","slug":"updating-a-tag","type":"basic","title":"Updating a tag","__v":0,"parentDoc":null,"childrenPages":[]}

Updating a tag


Tags can be updated via a `POST` method to `https://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier (id) of the tag, which accepts a JSON object describing the [Tag](doc:tag-model). [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## PATH Parameters [block:parameters] { "data": { "0-0": "id", "h-0": "Path parameter", "h-1": "Description", "h-2": "Description", "0-1": "Unique identifier of the tag you want to update" }, "cols": 2, "rows": 1 } [/block] ## Link Parameters The table below shows the parameters you should specify when updating a tag. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Tag property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 3 chars\nMax 255 chars", "0-3": "New name you want to assign to the tag", "1-0": "color", "1-1": "string", "1-2": "**required**\n6-digits Hexadecimal", "1-3": "Hexadecimal code of the color you want to assign to the tag (without the opening \"#\" char)" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Updating an existing tag (changing \"marketing\" into \"promo\")", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"promo\",\n \"color\": \"FFAA99\"\n}'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated tag)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"promo\",\n \"color\": \"FFAA99\"\n}", "language": "text", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "1-2": "Given `id` does not correspond to any existing tag", "1-0": "404" }, "cols": 3, "rows": 2 } [/block]
Tags can be updated via a `POST` method to `https://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier (id) of the tag, which accepts a JSON object describing the [Tag](doc:tag-model). [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## PATH Parameters [block:parameters] { "data": { "0-0": "id", "h-0": "Path parameter", "h-1": "Description", "h-2": "Description", "0-1": "Unique identifier of the tag you want to update" }, "cols": 2, "rows": 1 } [/block] ## Link Parameters The table below shows the parameters you should specify when updating a tag. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Tag property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 3 chars\nMax 255 chars", "0-3": "New name you want to assign to the tag", "1-0": "color", "1-1": "string", "1-2": "**required**\n6-digits Hexadecimal", "1-3": "Hexadecimal code of the color you want to assign to the tag (without the opening \"#\" char)" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Updating an existing tag (changing \"marketing\" into \"promo\")", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"promo\",\n \"color\": \"FFAA99\"\n}'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated tag)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"promo\",\n \"color\": \"FFAA99\"\n}", "language": "text", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "1-2": "Given `id` does not correspond to any existing tag", "1-0": "404" }, "cols": 3, "rows": 2 } [/block]
{"_id":"579255907feea81700e5ac1f","category":"5792557390ad641700d46b8d","githubsync":"","sync_unique":"","__v":2,"hidden":false,"link_external":false,"link_url":"","project":"577d1b8b74aea422007230c4","slug":"getting-tag-details","title":"Getting tag details","type":"basic","createdAt":"2016-07-22T17:19:12.968Z","version":"577d1b8b74aea422007230c7","order":3,"parentDoc":null,"updates":["5794113dd7519f0e00cd20a7"],"body":"Each Tag object has its own URL: `http://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier of the tag.\nTo get Tag object details, you should HTTP `GET` on the specific tags endpoint, and a JSON object representing the tag will be returned.\n\n## PATH PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the tag you want to get details for\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting tag details\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl \\\\\\n-s http://api.rebrandly.com/v1/tags/3aehje9d536s46d59ba5bcf49b582ear \\\\\\n-H 'Accept: application/json'\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (tag details)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"personal\\\",\\n  \\\"color\\\": \\\"#ddeeff\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","api":{"settings":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"excerpt":"","isReference":false,"user":"577d1b6d87acf617003c421d","next":{"pages":[]},"childrenPages":[]}

Getting tag details


Each Tag object has its own URL: `http://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier of the tag. To get Tag object details, you should HTTP `GET` on the specific tags endpoint, and a JSON object representing the tag will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the tag you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting tag details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl \\\n-s http://api.rebrandly.com/v1/tags/3aehje9d536s46d59ba5bcf49b582ear \\\n-H 'Accept: application/json'\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (tag details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"personal\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
Each Tag object has its own URL: `http://api.rebrandly.com/v1/tags/{id}`, where `{id}` is the unique identifier of the tag. To get Tag object details, you should HTTP `GET` on the specific tags endpoint, and a JSON object representing the tag will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the tag you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting tag details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl \\\n-s http://api.rebrandly.com/v1/tags/3aehje9d536s46d59ba5bcf49b582ear \\\n-H 'Accept: application/json'\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (tag details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"personal\",\n \"color\": \"#ddeeff\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c0f25855166d00301e596c","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T10:32:56.956Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"You can access your tags collection at any time with an HTTP `GET` on the tags endpoint `https://api.rebrandly.com/v1/tags`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).\",\n  \"title\": \"Understanding pagination and sortings\"\n}\n[/block]\n\nIf you want to get only tags matching a given set of conditions, you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"orderBy\",\n    \"0-1\": \"string enum\\n- `name`\\n  *default*\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Sorting criteria to apply to your tags collection\",\n    \"1-0\": \"orderDir\",\n    \"1-1\": \"string enum\\n- `desc`\\n  *default*\\n- `asc`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Sorting direction to apply to your tags collection\",\n    \"2-0\": \"offset\",\n    \"2-1\": \"integer\\n*default is 0*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"2-2\": \"*optional*\\nPositive (including zero)\",\n    \"2-3\": \"How many tags to skip\",\n    \"3-0\": \"limit\",\n    \"3-1\": \"integer\\n*default is 100*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"3-2\": \"*optional*\\nStrictly positive\\nMax 100\",\n    \"3-3\": \"How many tags to load, starting from offset on\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting tags collection\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/tags?orderBy=name&orderDir=asc&offset=0&limit=100' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (list of tags matching filters)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n {\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"name\\\": \\\"promo\\\",\\n  \\\"color\\\": \\\"FF9944\\\"\\n },\\n {\\n  \\\"id\\\": \\\"abcdecc5b6ee45d6g7897b06ac2d1xyz\\\",\\n  \\\"name\\\": \\\"tracked\\\",\\n  \\\"color\\\": \\\"55223D\\\"\\n }\\n // up to 100 tag objects sorted by name asc\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"listing-your-tags","type":"basic","title":"Listing your tags","__v":0,"parentDoc":null,"childrenPages":[]}

Listing your tags


You can access your tags collection at any time with an HTTP `GET` on the tags endpoint `https://api.rebrandly.com/v1/tags`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only tags matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `name`\n *default*\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your tags collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your tags collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many tags to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many tags to load, starting from offset on" }, "cols": 4, "rows": 4 } [/block] [block:textarea] { "text": "GETting tags collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags?orderBy=name&orderDir=asc&offset=0&limit=100' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of tags matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"promo\",\n \"color\": \"FF9944\"\n },\n {\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"name\": \"tracked\",\n \"color\": \"55223D\"\n }\n // up to 100 tag objects sorted by name asc\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
You can access your tags collection at any time with an HTTP `GET` on the tags endpoint `https://api.rebrandly.com/v1/tags`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only tags matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `name`\n *default*\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your tags collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your tags collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many tags to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many tags to load, starting from offset on" }, "cols": 4, "rows": 4 } [/block] [block:textarea] { "text": "GETting tags collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags?orderBy=name&orderDir=asc&offset=0&limit=100' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of tags matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"promo\",\n \"color\": \"FF9944\"\n },\n {\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"name\": \"tracked\",\n \"color\": \"55223D\"\n }\n // up to 100 tag objects sorted by name asc\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
{"_id":"59c0f41f75aab0002627ac8d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T10:40:31.285Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Your tags collection size can be read with a HTTP `GET` on the count tags endpoint `https://api.rebrandly.com/v1/tags/count`.\n\nGETting tags collection size\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/tags/count' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"A numeric value is provided back:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"count\\\": 42\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"\"\n}\n[/block]","excerpt":"","slug":"counting-your-tags","type":"basic","title":"Counting your tags","__v":0,"parentDoc":null,"childrenPages":[]}

Counting your tags


Your tags collection size can be read with a HTTP `GET` on the count tags endpoint `https://api.rebrandly.com/v1/tags/count`. GETting tags collection size [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/count' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "" } [/block]
Your tags collection size can be read with a HTTP `GET` on the count tags endpoint `https://api.rebrandly.com/v1/tags/count`. GETting tags collection size [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/count' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "" } [/block]
{"_id":"59c0f4de75aab0002627ac9f","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T10:43:42.316Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"A tag can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/tags/:id`, where `:id` is the unique identifier of the tag.\nThe action is not reversible and will permanently delete your tag, detaching it from all links you have attached it to.\n\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the tag you want to permanently delete\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Permanently deleting a single tag\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/tags/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\\\\n-X DELETE \\\\\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"When a tag is deleted, its last object representation is returned (prior to deletion).\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"name\\\": \\\"promo\\\",\\n  \\\"color\\\": \\\"FF0044\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"404\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors)\",\n    \"0-2\": \"Given `id` does not correspond to any existing tag\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"deleting-a-tag","type":"basic","title":"Deleting a tag","__v":0,"parentDoc":null,"childrenPages":[]}

Deleting a tag


A tag can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/tags/:id`, where `:id` is the unique identifier of the tag. The action is not reversible and will permanently delete your tag, detaching it from all links you have attached it to. ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the tag you want to permanently delete" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Permanently deleting a single tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a tag is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"promo\",\n \"color\": \"FF0044\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing tag" }, "cols": 3, "rows": 1 } [/block]
A tag can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/tags/:id`, where `:id` is the unique identifier of the tag. The action is not reversible and will permanently delete your tag, detaching it from all links you have attached it to. ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the tag you want to permanently delete" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Permanently deleting a single tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/tags/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a tag is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"promo\",\n \"color\": \"FF0044\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing tag" }, "cols": 3, "rows": 1 } [/block]
{"_id":"59c0f5bfd98014002654509c","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T10:47:27.920Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"You can attach a Tag object to a Link object.\n\nIn order to attach a Tag to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow:\n\n`https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property.\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Tags feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Attaching a Tag to a Link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"attaching-a-tag","type":"basic","title":"Attaching a tag","__v":0,"parentDoc":null,"childrenPages":[]}

Attaching a tag


You can attach a Tag object to a Link object. In order to attach a Tag to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property. [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] [block:textarea] { "text": "Attaching a Tag to a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block]
You can attach a Tag object to a Link object. In order to attach a Tag to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property. [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Tags feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] [block:textarea] { "text": "Attaching a Tag to a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block]
{"_id":"59c0f85755166d00301e5abe","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"5792557390ad641700d46b8d","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T10:58:31.362Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"You can detach a Tag object from a Link object.\nWhen you delete a Tag, it is detached from all the branded links it was attached to.\n\nIn order to detach a Tag from a Link, you must first get both unique identifiers for the Link and the Tag. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow:\n\n`https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property.\n\n## Path parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"lid\",\n    \"0-1\": \"Unique identifier of the branded short link you want the tag to be attached to\",\n    \"1-0\": \"tid\",\n    \"1-1\": \"Unique identifier of the tag you want to attach to this link\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Detaching a Tag to a Link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\\\\n-X DELETE \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"link.id\\\"\",\n    \"0-0\": \"404\",\n    \"0-2\": \"Given path parameter `lid` does not correspond to any existing link\",\n    \"1-0\": \"404\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"tag.id\\\"\",\n    \"1-2\": \"Given path parameter `tid` does not correspond to any existing tag\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","excerpt":"","slug":"detaching-a-tag","type":"basic","title":"Detaching a tag","__v":0,"parentDoc":null,"childrenPages":[]}

Detaching a tag


You can detach a Tag object from a Link object. When you delete a Tag, it is detached from all the branded links it was attached to. In order to detach a Tag from a Link, you must first get both unique identifiers for the Link and the Tag. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "lid", "0-1": "Unique identifier of the branded short link you want the tag to be attached to", "1-0": "tid", "1-1": "Unique identifier of the tag you want to attach to this link" }, "cols": 2, "rows": 2 } [/block] [block:textarea] { "text": "Detaching a Tag to a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"link.id\"", "0-0": "404", "0-2": "Given path parameter `lid` does not correspond to any existing link", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"tag.id\"", "1-2": "Given path parameter `tid` does not correspond to any existing tag" }, "cols": 3, "rows": 2 } [/block]
You can detach a Tag object from a Link object. When you delete a Tag, it is detached from all the branded links it was attached to. In order to detach a Tag from a Link, you must first get both unique identifiers for the Link and the Tag. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/tags/:tid`, where `lid` is the Link resource's `id` property and `tid` is the Tag resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "lid", "0-1": "Unique identifier of the branded short link you want the tag to be attached to", "1-0": "tid", "1-1": "Unique identifier of the tag you want to attach to this link" }, "cols": 2, "rows": 2 } [/block] [block:textarea] { "text": "Detaching a Tag to a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/tags/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"link.id\"", "0-0": "404", "0-2": "Given path parameter `lid` does not correspond to any existing link", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"tag.id\"", "1-2": "Given path parameter `tid` does not correspond to any existing tag" }, "cols": 3, "rows": 2 } [/block]
{"_id":"59c13ee42d0b430010f6502d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T15:59:32.876Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"You can run custom scripts at redirection time on your short links: every time someone clicks on your links, your script will run on his browser.\nSuch scripts are generally referred to as Retargeting scripts (or just scripts).\n\nScripts can be viewed [individually](doc:getting-script-details) or [as a collection](doc:listing-your-scripts).","excerpt":"","slug":"retargeting-scripts","type":"basic","title":"Retargeting scripts","__v":0,"parentDoc":null,"childrenPages":[]}

Retargeting scripts


You can run custom scripts at redirection time on your short links: every time someone clicks on your links, your script will run on his browser. Such scripts are generally referred to as Retargeting scripts (or just scripts). Scripts can be viewed [individually](doc:getting-script-details) or [as a collection](doc:listing-your-scripts).
You can run custom scripts at redirection time on your short links: every time someone clicks on your links, your script will run on his browser. Such scripts are generally referred to as Retargeting scripts (or just scripts). Scripts can be viewed [individually](doc:getting-script-details) or [as a collection](doc:listing-your-scripts).
{"_id":"59c14670a811850030a04959","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T16:31:44.239Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check for compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Scripts feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\nTags can be created via a `POST` method to `http://api.rebrandly.com/v1/scripts`, which accepts a JSON object describing a [Script](doc:retargeting-scripts) .\n\n## Script Parameters\nThe table below shows the parameters you should specify when creating a Script:\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-0\": \"Link property\",\n    \"0-0\": \"name\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nMin 2 chars\",\n    \"1-0\": \"value\",\n    \"1-1\": \"string\",\n    \"1-2\": \"*optional*\\nValid javascript code\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"Unique name of the script\",\n    \"1-3\": \"Javascript snippet including opening and closing <script> HTML tags\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\nCreating a new Tag\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl http://api.rebrandly.com/scripts \\\\\\n-X POST \\\\\\n-H 'Accept: application/json' \\\\\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\\\\n-H 'Content-Type: application/json' -d '\\n{\\n  \\\"name\\\": \\\"Alert\\\",\\n  \\\"value\\\": \\\"<script>alert('test');</script>\\\"\\n}'\\n\\nHTTP/1.1 200 OK\\n\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (just created Script)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"Alert\\\",\\n  \\\"value\\\": \\\"<script>alert('test');</script>\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"creating-a-new-script","type":"basic","title":"Creating a new script","__v":0,"parentDoc":null,"childrenPages":[]}

Creating a new script


[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] Tags can be created via a `POST` method to `http://api.rebrandly.com/v1/scripts`, which accepts a JSON object describing a [Script](doc:retargeting-scripts) . ## Script Parameters The table below shows the parameters you should specify when creating a Script: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 2 chars", "1-0": "value", "1-1": "string", "1-2": "*optional*\nValid javascript code", "h-3": "Description", "0-3": "Unique name of the script", "1-3": "Javascript snippet including opening and closing <script> HTML tags" }, "cols": 4, "rows": 2 } [/block] Creating a new Tag [block:code] { "codes": [ { "code": "$ curl http://api.rebrandly.com/scripts \\\n-X POST \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\n-H 'Content-Type: application/json' -d '\n{\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}'\n\nHTTP/1.1 200 OK\n", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created Script)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
[block:callout] { "type": "warning", "title": "Check for compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] Tags can be created via a `POST` method to `http://api.rebrandly.com/v1/scripts`, which accepts a JSON object describing a [Script](doc:retargeting-scripts) . ## Script Parameters The table below shows the parameters you should specify when creating a Script: [block:parameters] { "data": { "h-1": "Type", "h-2": "Constraints", "h-0": "Link property", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 2 chars", "1-0": "value", "1-1": "string", "1-2": "*optional*\nValid javascript code", "h-3": "Description", "0-3": "Unique name of the script", "1-3": "Javascript snippet including opening and closing <script> HTML tags" }, "cols": 4, "rows": 2 } [/block] Creating a new Tag [block:code] { "codes": [ { "code": "$ curl http://api.rebrandly.com/scripts \\\n-X POST \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE' \\\n-H 'Content-Type: application/json' -d '\n{\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}'\n\nHTTP/1.1 200 OK\n", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (just created Script)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c147dca811850030a0496d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T16:37:48.277Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Scripts can be updated via a `POST` method to `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier (id) of the script, which accepts a JSON object describing the [Script](doc:retargeting-scripts).\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Scripts feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"Unique identifier of the script you want to update\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## Script Parameters\nThe table below shows the parameters you should specify when updating a script.\nIf you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Tag property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"name\",\n    \"0-1\": \"string\",\n    \"0-2\": \"**required**\\nUTF8\\nMin 3 chars\\nMax 255 chars\",\n    \"0-3\": \"New name you want to assign to the script\",\n    \"1-0\": \"value\",\n    \"1-1\": \"string\",\n    \"1-2\": \"**required**\\nValid javascript code\",\n    \"1-3\": \"Javascript snippet including opening and closing <script> HTML tags\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Updating an existing script\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/scripts/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json' \\\\\\n-d \\\\\\n'{\\n  \\\"name\\\": \\\"NewAlert\\\",\\n  \\\"value\\\": \\\"<script>alert('test');</script>\\\"\\n}'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (updated script)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"gewa4cc5b6ee45d6gkj65b06ac2d1hww\\\",\\n  \\\"name\\\": \\\"NewAlert\\\",\\n  \\\"color\\\": \\\"<script>alert('test');</script>\\\"\\n}\",\n      \"language\": \"text\",\n      \"name\": \"JSON\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"id\\\"\",\n    \"1-2\": \"Given `id` does not correspond to any existing script\",\n    \"1-0\": \"404\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","excerpt":"","slug":"updating-a-script","type":"basic","title":"Updating a script","__v":0,"parentDoc":null,"childrenPages":[]}

Updating a script


Scripts can be updated via a `POST` method to `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier (id) of the script, which accepts a JSON object describing the [Script](doc:retargeting-scripts). [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## PATH Parameters [block:parameters] { "data": { "0-0": "id", "h-0": "Path parameter", "h-1": "Description", "h-2": "Description", "0-1": "Unique identifier of the script you want to update" }, "cols": 2, "rows": 1 } [/block] ## Script Parameters The table below shows the parameters you should specify when updating a script. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Tag property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 3 chars\nMax 255 chars", "0-3": "New name you want to assign to the script", "1-0": "value", "1-1": "string", "1-2": "**required**\nValid javascript code", "1-3": "Javascript snippet including opening and closing <script> HTML tags" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Updating an existing script", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"name\": \"NewAlert\",\n \"value\": \"<script>alert('test');</script>\"\n}'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated script)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"NewAlert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "text", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "1-2": "Given `id` does not correspond to any existing script", "1-0": "404" }, "cols": 3, "rows": 2 } [/block]
Scripts can be updated via a `POST` method to `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier (id) of the script, which accepts a JSON object describing the [Script](doc:retargeting-scripts). [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] ## PATH Parameters [block:parameters] { "data": { "0-0": "id", "h-0": "Path parameter", "h-1": "Description", "h-2": "Description", "0-1": "Unique identifier of the script you want to update" }, "cols": 2, "rows": 1 } [/block] ## Script Parameters The table below shows the parameters you should specify when updating a script. If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them. [block:parameters] { "data": { "h-0": "Tag property", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "name", "0-1": "string", "0-2": "**required**\nUTF8\nMin 3 chars\nMax 255 chars", "0-3": "New name you want to assign to the script", "1-0": "value", "1-1": "string", "1-2": "**required**\nValid javascript code", "1-3": "Javascript snippet including opening and closing <script> HTML tags" }, "cols": 4, "rows": 2 } [/block] [block:textarea] { "text": "Updating an existing script", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json' \\\n-d \\\n'{\n \"name\": \"NewAlert\",\n \"value\": \"<script>alert('test');</script>\"\n}'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (updated script)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"gewa4cc5b6ee45d6gkj65b06ac2d1hww\",\n \"name\": \"NewAlert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "text", "name": "JSON" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid Link object. Double check value for `property` field. Details about validation failure in `message` field", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"id\"", "1-2": "Given `id` does not correspond to any existing script", "1-0": "404" }, "cols": 3, "rows": 2 } [/block]
{"_id":"59c148f8bc639a0032f76c5b","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T16:42:32.120Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Each Script object has its own URL: `http://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script.\nTo get Script object details, you should HTTP `GET` on the specific scripts endpoint, and a JSON object representing the script will be returned.\n\n## PATH PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the script you want to get details for\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting script details\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl \\\\\\n-s http://api.rebrandly.com/v1/scripts/3aehje9d536s46d59ba5bcf49b582ear \\\\\\n-H 'Accept: application/json'\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON Response (script details)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"3aehje9d536s46d59ba5bcf49b582ear\\\",\\n  \\\"name\\\": \\\"Alert\\\",\\n  \\\"value\\\": \\\"<script>alert('test');</script>\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"getting-script-details","type":"basic","title":"Getting script details","__v":0,"parentDoc":null,"childrenPages":[]}

Getting script details


Each Script object has its own URL: `http://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script. To get Script object details, you should HTTP `GET` on the specific scripts endpoint, and a JSON object representing the script will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the script you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting script details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl \\\n-s http://api.rebrandly.com/v1/scripts/3aehje9d536s46d59ba5bcf49b582ear \\\n-H 'Accept: application/json'\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (script details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
Each Script object has its own URL: `http://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script. To get Script object details, you should HTTP `GET` on the specific scripts endpoint, and a JSON object representing the script will be returned. ## PATH PARAMETERS [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the script you want to get details for" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "GETting script details", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl \\\n-s http://api.rebrandly.com/v1/scripts/3aehje9d536s46d59ba5bcf49b582ear \\\n-H 'Accept: application/json'\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\n\nHTTP/1.1 200 OK", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON Response (script details)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"3aehje9d536s46d59ba5bcf49b582ear\",\n \"name\": \"Alert\",\n \"value\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c1493fbc639a0032f76c5d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-19T16:43:43.628Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"You can access your scripts collection at any time with an HTTP `GET` on the scripts endpoint `https://api.rebrandly.com/v1/scripts`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).\",\n  \"title\": \"Understanding pagination and sortings\"\n}\n[/block]\n\nIf you want to get only scripts matching a given set of conditions, you can attach filters to your request:\n\n## QUERY PARAMETERS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Constraints\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"orderBy\",\n    \"0-1\": \"string enum\\n- `name`\\n  *default*\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"0-2\": \"*optional*\",\n    \"0-3\": \"Sorting criteria to apply to your scripts collection\",\n    \"1-0\": \"orderDir\",\n    \"1-1\": \"string enum\\n- `desc`\\n  *default*\\n- `asc`\\n\\nSee [Sorting](doc:understanding-sorting)\",\n    \"1-2\": \"*optional*\",\n    \"1-3\": \"Sorting direction to apply to your scripts collection\",\n    \"2-0\": \"offset\",\n    \"2-1\": \"integer\\n*default is 0*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"2-2\": \"*optional*\\nPositive (including zero)\",\n    \"2-3\": \"How many scripts to skip\",\n    \"3-0\": \"limit\",\n    \"3-1\": \"integer\\n*default is 100*\\n\\nSee [Pagination](doc:understanding-pagination)\",\n    \"3-2\": \"*optional*\\nStrictly positive\\nMax 100\",\n    \"3-3\": \"How many scripts to load, starting from offset on\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"GETting scripts collection\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/scripts ?orderBy=name&orderDir=asc&offset=0&limit=100' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"JSON response (list of scripts matching filters)\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n {\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"name\\\": \\\"Alert1\\\",\\n  \\\"value\\\": \\\"<script>alert('test1');</script>\\\"\\n },\\n {\\n  \\\"id\\\": \\\"abcdecc5b6ee45d6g7897b06ac2d1xyz\\\",\\n  \\\"name\\\": \\\"Alert2\\\",\\n  \\\"value\\\": \\\"<script>alert('test2');</script>\\\"\\n }\\n // up to 100 scripts objects sorted by name\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"403\",\n    \"0-1\": \"[403 - Invalid format](doc:validation-errors)\",\n    \"0-2\": \"Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"listing-your-scripts","type":"basic","title":"Listing your scripts","__v":0,"parentDoc":null,"childrenPages":[]}

Listing your scripts


You can access your scripts collection at any time with an HTTP `GET` on the scripts endpoint `https://api.rebrandly.com/v1/scripts`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only scripts matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `name`\n *default*\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your scripts collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your scripts collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many scripts to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many scripts to load, starting from offset on" }, "cols": 4, "rows": 4 } [/block] [block:textarea] { "text": "GETting scripts collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts ?orderBy=name&orderDir=asc&offset=0&limit=100' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of scripts matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"Alert1\",\n \"value\": \"<script>alert('test1');</script>\"\n },\n {\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"name\": \"Alert2\",\n \"value\": \"<script>alert('test2');</script>\"\n }\n // up to 100 scripts objects sorted by name\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
You can access your scripts collection at any time with an HTTP `GET` on the scripts endpoint `https://api.rebrandly.com/v1/scripts`. [block:callout] { "type": "info", "body": "We recommend you have deep comprehension about how our API manages [Pagination](doc:understanding-pagination) and [Sorting](doc:understanding-sorting).", "title": "Understanding pagination and sortings" } [/block] If you want to get only scripts matching a given set of conditions, you can attach filters to your request: ## QUERY PARAMETERS [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Type", "h-2": "Constraints", "h-3": "Description", "0-0": "orderBy", "0-1": "string enum\n- `name`\n *default*\n\nSee [Sorting](doc:understanding-sorting)", "0-2": "*optional*", "0-3": "Sorting criteria to apply to your scripts collection", "1-0": "orderDir", "1-1": "string enum\n- `desc`\n *default*\n- `asc`\n\nSee [Sorting](doc:understanding-sorting)", "1-2": "*optional*", "1-3": "Sorting direction to apply to your scripts collection", "2-0": "offset", "2-1": "integer\n*default is 0*\n\nSee [Pagination](doc:understanding-pagination)", "2-2": "*optional*\nPositive (including zero)", "2-3": "How many scripts to skip", "3-0": "limit", "3-1": "integer\n*default is 100*\n\nSee [Pagination](doc:understanding-pagination)", "3-2": "*optional*\nStrictly positive\nMax 100", "3-3": "How many scripts to load, starting from offset on" }, "cols": 4, "rows": 4 } [/block] [block:textarea] { "text": "GETting scripts collection", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts ?orderBy=name&orderDir=asc&offset=0&limit=100' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "JSON response (list of scripts matching filters)", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"Alert1\",\n \"value\": \"<script>alert('test1');</script>\"\n },\n {\n \"id\": \"abcdecc5b6ee45d6g7897b06ac2d1xyz\",\n \"name\": \"Alert2\",\n \"value\": \"<script>alert('test2');</script>\"\n }\n // up to 100 scripts objects sorted by name\n]", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "403", "0-1": "[403 - Invalid format](doc:validation-errors)", "0-2": "Invalid query parameters format. Double check value for `property` query parameter. Details about validation failure in `message` field" }, "cols": 3, "rows": 1 } [/block]
{"_id":"59c372d22262d50032e9496d","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:05:38.853Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Your scripts collection size can be read with a HTTP `GET` on the count scripts endpoint `https://api.rebrandly.com/v1/scripts/count`.\n\nGETting scripts collection size\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/scripts/count' \\\\\\n-H 'apikey: YOUR_API_KEY'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"A numeric value is provided back:\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"count\\\": 42\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"\"\n}\n[/block]","excerpt":"","slug":"counting-your-scripts","type":"basic","title":"Counting your scripts","__v":0,"parentDoc":null,"childrenPages":[]}

Counting your scripts


Your scripts collection size can be read with a HTTP `GET` on the count scripts endpoint `https://api.rebrandly.com/v1/scripts/count`. GETting scripts collection size [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/count' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "" } [/block]
Your scripts collection size can be read with a HTTP `GET` on the count scripts endpoint `https://api.rebrandly.com/v1/scripts/count`. GETting scripts collection size [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/count' \\\n-H 'apikey: YOUR_API_KEY'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "A numeric value is provided back:", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 42\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "" } [/block]
{"_id":"59c373acc99a7d0010b48850","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:09:16.431Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"A script can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script.\nThe action is not reversible and will permanently delete your script, detaching it from all links you have attached it to.\n\n## PATH Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Unique identifier of the script you want to permanently delete\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Permanently deleting a single tag\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/scripts/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\\\\n-X DELETE \\\\\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"When a script is deleted, its last object representation is returned (prior to deletion).\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"fffa4cc5b6ee45d6g7897b06ac2d16af\\\",\\n  \\\"name\\\": \\\"Test Alert\\\",\\n  \\\"color\\\": \\\"<script>alert('test');</script>\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"404\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors)\",\n    \"0-2\": \"Given `id` does not correspond to any existing script\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"deleting-a-script","type":"basic","title":"Deleting a script","__v":0,"parentDoc":null,"childrenPages":[]}

Deleting a script


A script can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script. The action is not reversible and will permanently delete your script, detaching it from all links you have attached it to. ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the script you want to permanently delete" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Permanently deleting a single tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a script is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"Test Alert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing script" }, "cols": 3, "rows": 1 } [/block]
A script can be deleted from your collection by sending a `DELETE` request to its API URL: `https://api.rebrandly.com/v1/scripts/:id`, where `:id` is the unique identifier of the script. The action is not reversible and will permanently delete your script, detaching it from all links you have attached it to. ## PATH Parameters [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Description", "0-0": "id", "0-1": "Unique identifier of the script you want to permanently delete" }, "cols": 2, "rows": 1 } [/block] [block:textarea] { "text": "Permanently deleting a single tag", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/scripts/fffa4cc5b6ee45d6g7897b06ac2d16af' \\\n-X DELETE \\\n-H 'Authorization: Bearer YOUR_TOKEN_HERE'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "When a script is deleted, its last object representation is returned (prior to deletion).", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"fffa4cc5b6ee45d6g7897b06ac2d16af\",\n \"name\": \"Test Alert\",\n \"color\": \"<script>alert('test');</script>\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP Status", "h-1": "Error type", "h-2": "Description", "0-0": "404", "0-1": "[404 - Not found](doc:404-not-found-errors)", "0-2": "Given `id` does not correspond to any existing script" }, "cols": 3, "rows": 1 } [/block]
{"_id":"59c37447b2b45c0010b7b2bc","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:11:51.463Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"You can attach a Script object to a Link object.\nWhen someone clicks on the link, during the redirection process the script will be executed on his/her browser.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Check compatibility first\",\n  \"body\": \"Double check whether your API key or OAuth token is enabled to use the Scripts feature.\\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model).\"\n}\n[/block]\nIn order to attach a Script to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow:\n\n`https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `sid` is the Link resource's `id` property and `sid` is the Script resource's `id` property.\n\n## Path parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Unique identifier of the branded short link you want the script to be attached to\",\n    \"0-0\": \"lid\",\n    \"1-0\": \"sid\",\n    \"1-1\": \"Unique identifier of the script you want to attach to the link\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nAttaching a Scripts to a Link\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\\\\n-X POST \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"attaching-a-script","type":"basic","title":"Attaching a script","__v":0,"parentDoc":null,"childrenPages":[]}

Attaching a script


You can attach a Script object to a Link object. When someone clicks on the link, during the redirection process the script will be executed on his/her browser. [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] In order to attach a Script to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `sid` is the Link resource's `id` property and `sid` is the Script resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-1": "Unique identifier of the branded short link you want the script to be attached to", "0-0": "lid", "1-0": "sid", "1-1": "Unique identifier of the script you want to attach to the link" }, "cols": 2, "rows": 2 } [/block] Attaching a Scripts to a Link [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block]
You can attach a Script object to a Link object. When someone clicks on the link, during the redirection process the script will be executed on his/her browser. [block:callout] { "type": "warning", "title": "Check compatibility first", "body": "Double check whether your API key or OAuth token is enabled to use the Scripts feature.\nFor every account, you can check for features and limits with [a preliminary API call](doc:account-model)." } [/block] In order to attach a Script to a Link, you must first create both the resources and get their unique identifiers. Once you have them, you can perform a `POST` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `sid` is the Link resource's `id` property and `sid` is the Script resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-1": "Unique identifier of the branded short link you want the script to be attached to", "0-0": "lid", "1-0": "sid", "1-1": "Unique identifier of the script you want to attach to the link" }, "cols": 2, "rows": 2 } [/block] Attaching a Scripts to a Link [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X POST \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block]
{"_id":"59c376e5c99a7d0010b488b4","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"59c13eceeafd5b0026571219","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:23:01.606Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"You can detach a Script object from a Link object.\nWhen you delete a Script, it is detached from all the branded links it was attached to.\n\nIn order to detach a Script from a Link, you must first get both unique identifiers for the Link and the Script. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow:\n\n`https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `lid` is the Link resource's `id` property and `sid` is the Script resource's `id` property.\n\n## Path parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Path parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"lid\",\n    \"0-1\": \"Unique identifier of the branded short link you want the script to be attached to\",\n    \"1-0\": \"sid\",\n    \"1-1\": \"Unique identifier of the script you want to attach to this link\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Detaching a Script from a Link\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\\\\n-X DELETE \\\\\\n-H 'apikey: YOUR_API_KEY' \\\\\\n-H 'Content-Type: application/json'\\n\\nHTTP/1.1 200 OK\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Handling errors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP status\",\n    \"h-1\": \"Error type\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"link.id\\\"\",\n    \"0-0\": \"404\",\n    \"0-2\": \"Given path parameter `lid` does not correspond to any existing link\",\n    \"1-0\": \"404\",\n    \"1-1\": \"[404 - Not found](doc:404-not-found-errors) \\nwith `property` value \\\"script.id\\\"\",\n    \"1-2\": \"Given path parameter `sid` does not correspond to any existing script\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]","excerpt":"","slug":"detaching-a-script","type":"basic","title":"Detaching a script","__v":0,"parentDoc":null,"childrenPages":[]}

Detaching a script


You can detach a Script object from a Link object. When you delete a Script, it is detached from all the branded links it was attached to. In order to detach a Script from a Link, you must first get both unique identifiers for the Link and the Script. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `lid` is the Link resource's `id` property and `sid` is the Script resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "lid", "0-1": "Unique identifier of the branded short link you want the script to be attached to", "1-0": "sid", "1-1": "Unique identifier of the script you want to attach to this link" }, "cols": 2, "rows": 2 } [/block] [block:textarea] { "text": "Detaching a Script from a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"link.id\"", "0-0": "404", "0-2": "Given path parameter `lid` does not correspond to any existing link", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"script.id\"", "1-2": "Given path parameter `sid` does not correspond to any existing script" }, "cols": 3, "rows": 2 } [/block]
You can detach a Script object from a Link object. When you delete a Script, it is detached from all the branded links it was attached to. In order to detach a Script from a Link, you must first get both unique identifiers for the Link and the Script. Once you have them, you can perform a `DELETE` API call (without body) to the association endpoint, which is composed as follow: `https://api.rebrandly.com/v1/links/:lid/scripts/:sid`, where `lid` is the Link resource's `id` property and `sid` is the Script resource's `id` property. ## Path parameters [block:parameters] { "data": { "h-0": "Path parameter", "h-1": "Description", "0-0": "lid", "0-1": "Unique identifier of the branded short link you want the script to be attached to", "1-0": "sid", "1-1": "Unique identifier of the script you want to attach to this link" }, "cols": 2, "rows": 2 } [/block] [block:textarea] { "text": "Detaching a Script from a Link", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \\\n-X DELETE \\\n-H 'apikey: YOUR_API_KEY' \\\n-H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK", "language": "text", "name": "cURL" } ], "sidebar": true } [/block] [block:api-header] { "title": "Handling errors" } [/block] [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Error type", "h-2": "Description", "0-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"link.id\"", "0-0": "404", "0-2": "Given path parameter `lid` does not correspond to any existing link", "1-0": "404", "1-1": "[404 - Not found](doc:404-not-found-errors) \nwith `property` value \"script.id\"", "1-2": "Given path parameter `sid` does not correspond to any existing script" }, "cols": 3, "rows": 2 } [/block]
{"_id":"57971ad2acc0bb0e0033358b","githubsync":"","hidden":false,"slug":"resource-collections","version":"577d1b8b74aea422007230c7","category":"577d2b505fd4de0e00cc3e09","link_external":false,"link_url":"","sync_unique":"","type":"basic","api":{"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[]},"order":0,"project":"577d1b8b74aea422007230c4","title":"Resource collections","updates":[],"__v":0,"body":"Your branded short links and branded domains are arranged by **collections**. \nA collection can contain as many elements as your Rebrandly plan allows, or can be empty.","createdAt":"2016-07-26T08:09:54.900Z","excerpt":"","isReference":false,"parentDoc":null,"user":"577d1b6d87acf617003c421d","childrenPages":[]}

Resource collections


Your branded short links and branded domains are arranged by **collections**. A collection can contain as many elements as your Rebrandly plan allows, or can be empty.
Your branded short links and branded domains are arranged by **collections**. A collection can contain as many elements as your Rebrandly plan allows, or can be empty.
{"_id":"5790ea9af7ff000e004ba3e6","hidden":false,"parentDoc":null,"slug":"understanding-pagination","updates":["5793e4e90b4ca20e00beaa2e","5793e590514c7b0e00e17c3e"],"version":"577d1b8b74aea422007230c7","category":"577d2b505fd4de0e00cc3e09","sync_unique":"","title":"Paginating collections","order":1,"createdAt":"2016-07-21T15:30:34.698Z","excerpt":"","isReference":false,"link_url":"","user":"577d1b6d87acf617003c421d","__v":2,"api":{"auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":""},"body":"You don't want to list all of your collection's resources at once: there can be too many to be rendered somewhere. So we provided you with standard pagination features: we divide your collection in **pages** of resources.\n\nThe largest possible page contains up to 100 resources at any point in time, and it's the default choice we provide to you. This means that if you have less than 100 resources in a collection, you don't have to worry about pagination at all.\n\nHowever, when you have more than 100 resources in a collection, you'll need to organize them into pages.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Limiting resources per page\"\n}\n[/block]\nA `limit` parameter is provided in all endpoints returning a collection of resources.\nSuch parameter is valued 100 (maximum) as default, but you can change with smaller values if you want your collection to be organized into smaller pages.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting next pages\"\n}\n[/block]\nAn `offset` parameter is provided in all endpoints returning a collection of resources.\nSuch parameter is valued 0 (minimum) as default, but you can change with multiple of `limit` parameter's value (100 by default) to skip as many resources as specified in `offset` parameter.\n\nIf you want pages to not be more than 100 elements each, you can get them separately as follows:\n- Page 1, from element #1 to element #100: `offset` is 0 (you don't want to skip any resource), `limit` is 100\n- Page 2, from element #101 to element #200: `offset` is 100 (you want to skip 100 resources you already rendered in Page 1), `limit` is again 100\n- Page 3, from element #201 to element #300: `offset` is 200, `limit` is again 100\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Anatomy of a resources page\"\n}\n[/block]\nPages are ordered lists of resources, according to a sorting criteria and a sorting direction. \nIf a request wasn't specifying any criteria and any direction (see [Sorting collections](doc:understanding-sorting)), default values apply for sorting, depending on the collection's nature.","githubsync":"","link_external":false,"project":"577d1b8b74aea422007230c4","type":"basic","childrenPages":[]}

Paginating collections


You don't want to list all of your collection's resources at once: there can be too many to be rendered somewhere. So we provided you with standard pagination features: we divide your collection in **pages** of resources. The largest possible page contains up to 100 resources at any point in time, and it's the default choice we provide to you. This means that if you have less than 100 resources in a collection, you don't have to worry about pagination at all. However, when you have more than 100 resources in a collection, you'll need to organize them into pages. [block:api-header] { "type": "basic", "title": "Limiting resources per page" } [/block] A `limit` parameter is provided in all endpoints returning a collection of resources. Such parameter is valued 100 (maximum) as default, but you can change with smaller values if you want your collection to be organized into smaller pages. [block:api-header] { "type": "basic", "title": "Getting next pages" } [/block] An `offset` parameter is provided in all endpoints returning a collection of resources. Such parameter is valued 0 (minimum) as default, but you can change with multiple of `limit` parameter's value (100 by default) to skip as many resources as specified in `offset` parameter. If you want pages to not be more than 100 elements each, you can get them separately as follows: - Page 1, from element #1 to element #100: `offset` is 0 (you don't want to skip any resource), `limit` is 100 - Page 2, from element #101 to element #200: `offset` is 100 (you want to skip 100 resources you already rendered in Page 1), `limit` is again 100 - Page 3, from element #201 to element #300: `offset` is 200, `limit` is again 100 [block:api-header] { "type": "basic", "title": "Anatomy of a resources page" } [/block] Pages are ordered lists of resources, according to a sorting criteria and a sorting direction. If a request wasn't specifying any criteria and any direction (see [Sorting collections](doc:understanding-sorting)), default values apply for sorting, depending on the collection's nature.
You don't want to list all of your collection's resources at once: there can be too many to be rendered somewhere. So we provided you with standard pagination features: we divide your collection in **pages** of resources. The largest possible page contains up to 100 resources at any point in time, and it's the default choice we provide to you. This means that if you have less than 100 resources in a collection, you don't have to worry about pagination at all. However, when you have more than 100 resources in a collection, you'll need to organize them into pages. [block:api-header] { "type": "basic", "title": "Limiting resources per page" } [/block] A `limit` parameter is provided in all endpoints returning a collection of resources. Such parameter is valued 100 (maximum) as default, but you can change with smaller values if you want your collection to be organized into smaller pages. [block:api-header] { "type": "basic", "title": "Getting next pages" } [/block] An `offset` parameter is provided in all endpoints returning a collection of resources. Such parameter is valued 0 (minimum) as default, but you can change with multiple of `limit` parameter's value (100 by default) to skip as many resources as specified in `offset` parameter. If you want pages to not be more than 100 elements each, you can get them separately as follows: - Page 1, from element #1 to element #100: `offset` is 0 (you don't want to skip any resource), `limit` is 100 - Page 2, from element #101 to element #200: `offset` is 100 (you want to skip 100 resources you already rendered in Page 1), `limit` is again 100 - Page 3, from element #201 to element #300: `offset` is 200, `limit` is again 100 [block:api-header] { "type": "basic", "title": "Anatomy of a resources page" } [/block] Pages are ordered lists of resources, according to a sorting criteria and a sorting direction. If a request wasn't specifying any criteria and any direction (see [Sorting collections](doc:understanding-sorting)), default values apply for sorting, depending on the collection's nature.
{"_id":"5790f0f2f7ff000e004ba3ec","title":"Sorting collections","updates":["5793eaf87d1e4a0e0034607f"],"__v":1,"api":{"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","auth":"required","params":[]},"category":"577d2b505fd4de0e00cc3e09","createdAt":"2016-07-21T15:57:38.895Z","link_url":"","excerpt":"","project":"577d1b8b74aea422007230c4","slug":"understanding-sorting","user":"577d1b6d87acf617003c421d","githubsync":"","isReference":false,"order":2,"type":"basic","version":"577d1b8b74aea422007230c7","body":"A collection of resources can be sorted (either descending or ascending) according to a given criteria.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sorting criteria\"\n}\n[/block]\nSorting criteria is the sorting mode to be applied on a collection *before* pagination (see [Understanding Pagination](doc:understanding-pagination)) applies.\n\nEvery resource collection management endpoint comes with an `orderBy` parameter used to define which sorting criteria has to be applied.\n\nExamples of an `orderBy` parameter's possible values are: `createdAt` (to sort by creation datetime), `updatedAt` (to sort by last update date/time) and so on.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sorting direction\"\n}\n[/block]\nSorting direction is the direction, according to sorting criteria, to be applied on a collection *before* pagination applies. The only two possible directions are \"ascending\" (from first to last) and \"descending\" (from last to first).\n\nEvery resource collection management endpoint comes with an `orderDir` parameter used to define which sorting direction has to be applied.\nPossible values for `orderDir` are `asc` (ascending) and `desc` (descending).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Combining sorting criteria\"\n}\n[/block]\nTo exploit the full power of sorting criteria, it is possible to combine two sorting criteria together:\n\n*First, sort by descending X, then sort by ascending Y if X subsequent X values are equal*,\ncan be obtained by assigning `orderBy` parameter value `X,Y` and by assigning `orderDir` parameter value `desc,asc`.","hidden":false,"link_external":false,"parentDoc":null,"sync_unique":"","childrenPages":[]}

Sorting collections


A collection of resources can be sorted (either descending or ascending) according to a given criteria. [block:api-header] { "type": "basic", "title": "Sorting criteria" } [/block] Sorting criteria is the sorting mode to be applied on a collection *before* pagination (see [Understanding Pagination](doc:understanding-pagination)) applies. Every resource collection management endpoint comes with an `orderBy` parameter used to define which sorting criteria has to be applied. Examples of an `orderBy` parameter's possible values are: `createdAt` (to sort by creation datetime), `updatedAt` (to sort by last update date/time) and so on. [block:api-header] { "type": "basic", "title": "Sorting direction" } [/block] Sorting direction is the direction, according to sorting criteria, to be applied on a collection *before* pagination applies. The only two possible directions are "ascending" (from first to last) and "descending" (from last to first). Every resource collection management endpoint comes with an `orderDir` parameter used to define which sorting direction has to be applied. Possible values for `orderDir` are `asc` (ascending) and `desc` (descending). [block:api-header] { "type": "basic", "title": "Combining sorting criteria" } [/block] To exploit the full power of sorting criteria, it is possible to combine two sorting criteria together: *First, sort by descending X, then sort by ascending Y if X subsequent X values are equal*, can be obtained by assigning `orderBy` parameter value `X,Y` and by assigning `orderDir` parameter value `desc,asc`.
A collection of resources can be sorted (either descending or ascending) according to a given criteria. [block:api-header] { "type": "basic", "title": "Sorting criteria" } [/block] Sorting criteria is the sorting mode to be applied on a collection *before* pagination (see [Understanding Pagination](doc:understanding-pagination)) applies. Every resource collection management endpoint comes with an `orderBy` parameter used to define which sorting criteria has to be applied. Examples of an `orderBy` parameter's possible values are: `createdAt` (to sort by creation datetime), `updatedAt` (to sort by last update date/time) and so on. [block:api-header] { "type": "basic", "title": "Sorting direction" } [/block] Sorting direction is the direction, according to sorting criteria, to be applied on a collection *before* pagination applies. The only two possible directions are "ascending" (from first to last) and "descending" (from last to first). Every resource collection management endpoint comes with an `orderDir` parameter used to define which sorting direction has to be applied. Possible values for `orderDir` are `asc` (ascending) and `desc` (descending). [block:api-header] { "type": "basic", "title": "Combining sorting criteria" } [/block] To exploit the full power of sorting criteria, it is possible to combine two sorting criteria together: *First, sort by descending X, then sort by ascending Y if X subsequent X values are equal*, can be obtained by assigning `orderBy` parameter value `X,Y` and by assigning `orderDir` parameter value `desc,asc`.
{"_id":"579228ea310cb22200f6e153","slug":"understanding-responses","version":"577d1b8b74aea422007230c7","body":"Each API endpoint has its own response model.","createdAt":"2016-07-22T14:08:42.111Z","link_url":"","parentDoc":null,"title":"Handling errors","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"githubsync":"","isReference":false,"project":"577d1b8b74aea422007230c4","type":"basic","user":"577d1b6d87acf617003c421d","excerpt":"","hidden":false,"order":0,"sync_unique":"","updates":["5793e112514c7b0e00e17c3c","579653a75fe9610e00d8a8bd"],"__v":2,"category":"579619c5cf84ae1700244f1c","link_external":false,"childrenPages":[]}

Handling errors


Each API endpoint has its own response model.
Each API endpoint has its own response model.
{"_id":"57961a20769c3a0e001cd421","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"createdAt":"2016-07-25T13:54:40.354Z","order":1,"title":"HTTP responses","updates":["579653f9f64c9f0e007cd732"],"hidden":false,"isReference":false,"sync_unique":"","user":"577d1b6d87acf617003c421d","__v":2,"body":"The API uses HTTP responses to indicate success or error.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP status\",\n    \"h-1\": \"Why\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"200 OK\",\n    \"0-1\": \"- Successful operations\",\n    \"0-2\": \"When API operations behave as expected\",\n    \"2-0\": \"401 Unauthorized\",\n    \"2-1\": \"- Account does not have permission to perform the operation.\\n- OAuth token is missing or invalid/expired.\",\n    \"3-0\": \"403 Forbidden\",\n    \"3-1\": \"- Invalid input format\\n- Missing body\\n- Limits threshold reached\",\n    \"4-0\": \"404 Not Found\",\n    \"4-1\": \"- Resource not found\\n- Endpoint not found\",\n    \"7-0\": \"500 Server Error\",\n    \"1-0\": \"400 Bad Request\",\n    \"7-1\": \"- Internal API error\",\n    \"10-0\": \"504 Gateway Timeout\",\n    \"10-1\": \"- Timeout on operation\",\n    \"8-0\": \"502 Bad Gateway\",\n    \"8-1\": \"- Failure in our upstream providers\",\n    \"9-0\": \"503 Service Unavailable\",\n    \"9-1\": \"- API is experiencing a downtime\\n- API is under maintenance\",\n    \"1-1\": \"- Invalid JSON request\",\n    \"6-0\": \"429 Too Many Requests\",\n    \"6-1\": \"- Rate limit exceeded\",\n    \"5-0\": \"406 Not Acceptable\",\n    \"5-1\": \"- No content-type specified\\n- Content-Type not accepted\"\n  },\n  \"cols\": 2,\n  \"rows\": 11\n}\n[/block]","category":"579619c5cf84ae1700244f1c","excerpt":"","githubsync":"","project":"577d1b8b74aea422007230c4","slug":"http-responses","link_external":false,"link_url":"","parentDoc":null,"type":"basic","version":"577d1b8b74aea422007230c7","next":{"description":"","pages":[]},"childrenPages":[]}

HTTP responses


The API uses HTTP responses to indicate success or error. [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Why", "h-2": "Description", "0-0": "200 OK", "0-1": "- Successful operations", "0-2": "When API operations behave as expected", "2-0": "401 Unauthorized", "2-1": "- Account does not have permission to perform the operation.\n- OAuth token is missing or invalid/expired.", "3-0": "403 Forbidden", "3-1": "- Invalid input format\n- Missing body\n- Limits threshold reached", "4-0": "404 Not Found", "4-1": "- Resource not found\n- Endpoint not found", "7-0": "500 Server Error", "1-0": "400 Bad Request", "7-1": "- Internal API error", "10-0": "504 Gateway Timeout", "10-1": "- Timeout on operation", "8-0": "502 Bad Gateway", "8-1": "- Failure in our upstream providers", "9-0": "503 Service Unavailable", "9-1": "- API is experiencing a downtime\n- API is under maintenance", "1-1": "- Invalid JSON request", "6-0": "429 Too Many Requests", "6-1": "- Rate limit exceeded", "5-0": "406 Not Acceptable", "5-1": "- No content-type specified\n- Content-Type not accepted" }, "cols": 2, "rows": 11 } [/block]
The API uses HTTP responses to indicate success or error. [block:parameters] { "data": { "h-0": "HTTP status", "h-1": "Why", "h-2": "Description", "0-0": "200 OK", "0-1": "- Successful operations", "0-2": "When API operations behave as expected", "2-0": "401 Unauthorized", "2-1": "- Account does not have permission to perform the operation.\n- OAuth token is missing or invalid/expired.", "3-0": "403 Forbidden", "3-1": "- Invalid input format\n- Missing body\n- Limits threshold reached", "4-0": "404 Not Found", "4-1": "- Resource not found\n- Endpoint not found", "7-0": "500 Server Error", "1-0": "400 Bad Request", "7-1": "- Internal API error", "10-0": "504 Gateway Timeout", "10-1": "- Timeout on operation", "8-0": "502 Bad Gateway", "8-1": "- Failure in our upstream providers", "9-0": "503 Service Unavailable", "9-1": "- API is experiencing a downtime\n- API is under maintenance", "1-1": "- Invalid JSON request", "6-0": "429 Too Many Requests", "6-1": "- Rate limit exceeded", "5-0": "406 Not Acceptable", "5-1": "- No content-type specified\n- Content-Type not accepted" }, "cols": 2, "rows": 11 } [/block]
{"_id":"59c37f382262d50032e94c07","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:58:32.980Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"A `400 - Bad Request` error occurs when you send to Rebrandly API a `POST` or `PUT` API call without a JSON body inside. All such requests must provide a JSON: if the endpoint does not require a specific body to be specified, you are supposed to forward an empty JSON body (`{}`) along with the request.\n\nExample generic error\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"Body required.\\\"\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"400-bad-request","type":"basic","title":"400 - Bad Request","__v":0,"parentDoc":null,"childrenPages":[]}

400 - Bad Request


A `400 - Bad Request` error occurs when you send to Rebrandly API a `POST` or `PUT` API call without a JSON body inside. All such requests must provide a JSON: if the endpoint does not require a specific body to be specified, you are supposed to forward an empty JSON body (`{}`) along with the request. Example generic error [block:code] { "codes": [ { "code": "\"Body required.\"", "language": "text" } ], "sidebar": true } [/block]
A `400 - Bad Request` error occurs when you send to Rebrandly API a `POST` or `PUT` API call without a JSON body inside. All such requests must provide a JSON: if the endpoint does not require a specific body to be specified, you are supposed to forward an empty JSON body (`{}`) along with the request. Example generic error [block:code] { "codes": [ { "code": "\"Body required.\"", "language": "text" } ], "sidebar": true } [/block]
{"_id":"579629dd4913990e001a58fb","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T15:01:49.239Z","order":3,"parentDoc":null,"__v":0,"api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","auth":"required","params":[],"url":""},"link_url":"","slug":"401-unauthorized","updates":[],"body":"An authorization error is an API operation denial which corresponds to a 401 HTTP status.\nPlease read [Authentication](doc:request-api-access) guide to understand how to authorize your application.\n\nAn authorization error occurs when:\n- Client is not authorized to perform the operation\n- Authentication token is missing or invalid\n\n## Authorization Error Object\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"message\",\n    \"0-1\": \"string\",\n    \"0-2\": \"A message to the user explaining why the request was not authorized\",\n    \"1-0\": \"code\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Always \\\"Unauthorized\\\"\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example authorization error\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 401\\n{\\n\\t\\\"code\\\": \\\"Unauthorized\\\",\\n  \\\"message\\\": \\\"Missing OAuth token in request\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","link_external":false,"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","isReference":false,"title":"401 - Unauthorized","githubsync":"","hidden":false,"project":"577d1b8b74aea422007230c4","sync_unique":"","type":"basic","excerpt":"","childrenPages":[]}

401 - Unauthorized


An authorization error is an API operation denial which corresponds to a 401 HTTP status. Please read [Authentication](doc:request-api-access) guide to understand how to authorize your application. An authorization error occurs when: - Client is not authorized to perform the operation - Authentication token is missing or invalid ## Authorization Error Object [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "message", "0-1": "string", "0-2": "A message to the user explaining why the request was not authorized", "1-0": "code", "1-1": "string", "1-2": "Always \"Unauthorized\"" }, "cols": 3, "rows": 2 } [/block] [block:textarea] { "text": "Example authorization error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 401\n{\n\t\"code\": \"Unauthorized\",\n \"message\": \"Missing OAuth token in request\"\n}", "language": "json" } ], "sidebar": true } [/block]
An authorization error is an API operation denial which corresponds to a 401 HTTP status. Please read [Authentication](doc:request-api-access) guide to understand how to authorize your application. An authorization error occurs when: - Client is not authorized to perform the operation - Authentication token is missing or invalid ## Authorization Error Object [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "message", "0-1": "string", "0-2": "A message to the user explaining why the request was not authorized", "1-0": "code", "1-1": "string", "1-2": "Always \"Unauthorized\"" }, "cols": 3, "rows": 2 } [/block] [block:textarea] { "text": "Example authorization error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 401\n{\n\t\"code\": \"Unauthorized\",\n \"message\": \"Missing OAuth token in request\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"57961a3bf7d5760e006ee5bb","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[],"url":""},"link_external":false,"parentDoc":null,"sync_unique":"","link_url":"","order":4,"slug":"validation-errors","user":"577d1b6d87acf617003c421d","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T13:55:07.290Z","excerpt":"","hidden":false,"type":"basic","version":"577d1b8b74aea422007230c7","body":"A validation error is an error due to invalid client requests.\nAll validation errors correspond with a 403 HTTP status code.\n\nA validation error occurs when:\n- Request body is ill-formed\n  *e.g. invalid JSON*\n- Required parameters are missing (either in body or in query string)\n  *e.g. endpoint required a field which is (empty or) not specified in the request*\n- Endpoint validation rules are not matched\n  *e.g. minimum/maximum length constraint doesn't match*\n\n## VALIDATION ERROR OBJECT\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"1-0\": \"message\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Message to the user explaining what happened\",\n    \"3-0\": \"code\",\n    \"3-1\": \"string enum\\n- `InvalidFormat`\\n- `RequiredField`\\n- `InvalidLength`\\n- `InvalidMinLength`\\n- `InvalidMaxLength`\\n- `InvalidEmailAddress`\\n- `OutOfRange`\\n- `PatternMismatch`\\n- `PrefixMismatch`\\n- `InvalidCharacter`\\n- `MustBeLowerCase`\\n- `MustBeUpperCase`\",\n    \"3-2\": \"Machine readable code to handle the error\",\n    \"0-0\": \"property\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Request property which originated the error\",\n    \"2-0\": \"verbose\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Message to the developer futher explaining what happened\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example validation error: missing required field\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 403\\n{\\n\\t\\\"code\\\": \\\"RequiredField\\\",\\n  \\\"message\\\": \\\"Cannot be empty\\\",\\n  \\\"property\\\": \\\"slashtag\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example of validation error: invalid min length\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 403\\n{\\n  \\\"property\\\": \\\"slashtag\\\",\\n  \\\"message\\\": \\\"Value cannot be less than 2 characters long\\\",\\n\\t\\\"code\\\": \\\"InvalidMinLength\\\",\\n  \\\"input\\\": \\\"a\\\",\\n  \\\"minLength\\\": 2\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example of validation error: OutOfRange\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 403\\n{\\n\\t\\\"property\\\": \\\"regType\\\",\\n  \\\"message\\\": \\\"Value is not allowed\\\",\\n  \\\"code\\\": \\\"OutOfRange\\\",\\n  \\\"input\\\": \\\"cat\\\",\\n  \\\"range\\\": [\\\"individual\\\", \\\"business\\\"]\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nFollowing additional properties may appear in validation errors:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"input\",\n    \"0-1\": \"object\",\n    \"0-2\": \"Original input value for `property`\",\n    \"1-0\": \"minLength\",\n    \"1-1\": \"numerical\\nPositive\",\n    \"1-2\": \"Minimum length allowed\",\n    \"2-0\": \"maxLength\",\n    \"2-1\": \"numerical\\nStrictly positive\",\n    \"2-2\": \"Maximum length allowed\",\n    \"3-0\": \"length\",\n    \"3-1\": \"numerical\\nStrictly positive\",\n    \"3-2\": \"Length to match\",\n    \"4-0\": \"range\",\n    \"4-1\": \"array of objects\",\n    \"4-2\": \"Set of allowed values\",\n    \"5-0\": \"pattern\",\n    \"5-1\": \"string regex\",\n    \"5-2\": \"Regex to test the input with\",\n    \"6-0\": \"prefix\",\n    \"6-1\": \"string\",\n    \"6-2\": \"Prefix that input has to match\",\n    \"7-0\": \"character\",\n    \"7-1\": \"string\",\n    \"7-2\": \"Character given in input\"\n  },\n  \"cols\": 3,\n  \"rows\": 8\n}\n[/block]\n## Validation error codes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Additional properties\",\n    \"h-2\": \"Message\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"InvalidFormat\",\n    \"0-1\": \"*none*\",\n    \"0-2\": \"Invalid format\",\n    \"0-3\": \"Generic invalid format error with respect to the `property` value\",\n    \"1-0\": \"RequiredField\",\n    \"1-1\": \"*none*\",\n    \"1-2\": \"Cannot be empty\",\n    \"1-3\": \"Field indicated in `property` was empty or not specified in the request\",\n    \"2-0\": \"InvalidLength\",\n    \"2-1\": \"input, length\",\n    \"2-2\": \"Value cannot be different than `length` characters long\",\n    \"2-3\": \"Number of characters of `property` value not matching `length`\",\n    \"3-0\": \"InvalidMinLength\",\n    \"3-1\": \"input, minLength\",\n    \"3-2\": \"Value cannot be less than `minLength` characters long\",\n    \"3-3\": \"Value for field indicated in `property` was too short with respect to `minLength`\",\n    \"4-0\": \"InvalidMaxLength\",\n    \"4-1\": \"input, maxLength\",\n    \"4-2\": \"Value cannot be more than `maxLength` characters long\",\n    \"4-3\": \"Value for field indicated in `property` was too long with respect to `maxLength`\",\n    \"5-0\": \"InvalidEmailAddress\",\n    \"5-1\": \"input\",\n    \"5-2\": \"Value is not a valid email address\",\n    \"5-3\": \"Value for field indicated in `property` was not a valid email address\",\n    \"6-0\": \"OutOfRange\",\n    \"6-1\": \"input, range\",\n    \"6-2\": \"Value is not allowed\",\n    \"6-3\": \"Value for field indicated in `property` was not included in `range`\",\n    \"7-0\": \"PatternMismatch\",\n    \"7-1\": \"input, pattern\",\n    \"7-2\": \"Invalid format\",\n    \"7-3\": \"Value for field indicated in `property` does not match regex in `pattern`\",\n    \"8-0\": \"PrefixMismatch\",\n    \"8-1\": \"input, prefix\",\n    \"8-2\": \"Prefix mismatch\",\n    \"8-3\": \"Prefix of value for field indicated in `property` does not match `prefix`\",\n    \"9-0\": \"InvalidCharacter\",\n    \"9-1\": \"input, character\",\n    \"9-2\": \"Invalid character: '`character`'\",\n    \"9-3\": \"Value for field indicated in `property` contains invalid character\",\n    \"10-0\": \"MustBeLowerCase\",\n    \"10-1\": \"input\",\n    \"10-2\": \"Value must be lowercase\",\n    \"10-3\": \"Value for field indicated in `property` is not lowercased\",\n    \"11-0\": \"MustBeUpperCase\",\n    \"11-1\": \"input\",\n    \"11-2\": \"Value must be uppercase\",\n    \"11-3\": \"Value for field indicated in `property` is not uppercased\"\n  },\n  \"cols\": 4,\n  \"rows\": 12\n}\n[/block]","project":"577d1b8b74aea422007230c4","title":"403 - Invalid format","__v":1,"githubsync":"","isReference":false,"updates":["579655c65fe9610e00d8a8bf"],"childrenPages":[]}

403 - Invalid format


A validation error is an error due to invalid client requests. All validation errors correspond with a 403 HTTP status code. A validation error occurs when: - Request body is ill-formed *e.g. invalid JSON* - Required parameters are missing (either in body or in query string) *e.g. endpoint required a field which is (empty or) not specified in the request* - Endpoint validation rules are not matched *e.g. minimum/maximum length constraint doesn't match* ## VALIDATION ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Message to the user explaining what happened", "3-0": "code", "3-1": "string enum\n- `InvalidFormat`\n- `RequiredField`\n- `InvalidLength`\n- `InvalidMinLength`\n- `InvalidMaxLength`\n- `InvalidEmailAddress`\n- `OutOfRange`\n- `PatternMismatch`\n- `PrefixMismatch`\n- `InvalidCharacter`\n- `MustBeLowerCase`\n- `MustBeUpperCase`", "3-2": "Machine readable code to handle the error", "0-0": "property", "0-1": "string", "0-2": "Request property which originated the error", "2-0": "verbose", "2-1": "string", "2-2": "Message to the developer futher explaining what happened" }, "cols": 3, "rows": 4 } [/block] [block:textarea] { "text": "Example validation error: missing required field", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"code\": \"RequiredField\",\n \"message\": \"Cannot be empty\",\n \"property\": \"slashtag\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:textarea] { "text": "Example of validation error: invalid min length", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n \"property\": \"slashtag\",\n \"message\": \"Value cannot be less than 2 characters long\",\n\t\"code\": \"InvalidMinLength\",\n \"input\": \"a\",\n \"minLength\": 2\n}", "language": "json" } ], "sidebar": true } [/block] [block:textarea] { "text": "Example of validation error: OutOfRange", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"property\": \"regType\",\n \"message\": \"Value is not allowed\",\n \"code\": \"OutOfRange\",\n \"input\": \"cat\",\n \"range\": [\"individual\", \"business\"]\n}", "language": "json" } ], "sidebar": true } [/block] Following additional properties may appear in validation errors: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "input", "0-1": "object", "0-2": "Original input value for `property`", "1-0": "minLength", "1-1": "numerical\nPositive", "1-2": "Minimum length allowed", "2-0": "maxLength", "2-1": "numerical\nStrictly positive", "2-2": "Maximum length allowed", "3-0": "length", "3-1": "numerical\nStrictly positive", "3-2": "Length to match", "4-0": "range", "4-1": "array of objects", "4-2": "Set of allowed values", "5-0": "pattern", "5-1": "string regex", "5-2": "Regex to test the input with", "6-0": "prefix", "6-1": "string", "6-2": "Prefix that input has to match", "7-0": "character", "7-1": "string", "7-2": "Character given in input" }, "cols": 3, "rows": 8 } [/block] ## Validation error codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Additional properties", "h-2": "Message", "h-3": "Description", "0-0": "InvalidFormat", "0-1": "*none*", "0-2": "Invalid format", "0-3": "Generic invalid format error with respect to the `property` value", "1-0": "RequiredField", "1-1": "*none*", "1-2": "Cannot be empty", "1-3": "Field indicated in `property` was empty or not specified in the request", "2-0": "InvalidLength", "2-1": "input, length", "2-2": "Value cannot be different than `length` characters long", "2-3": "Number of characters of `property` value not matching `length`", "3-0": "InvalidMinLength", "3-1": "input, minLength", "3-2": "Value cannot be less than `minLength` characters long", "3-3": "Value for field indicated in `property` was too short with respect to `minLength`", "4-0": "InvalidMaxLength", "4-1": "input, maxLength", "4-2": "Value cannot be more than `maxLength` characters long", "4-3": "Value for field indicated in `property` was too long with respect to `maxLength`", "5-0": "InvalidEmailAddress", "5-1": "input", "5-2": "Value is not a valid email address", "5-3": "Value for field indicated in `property` was not a valid email address", "6-0": "OutOfRange", "6-1": "input, range", "6-2": "Value is not allowed", "6-3": "Value for field indicated in `property` was not included in `range`", "7-0": "PatternMismatch", "7-1": "input, pattern", "7-2": "Invalid format", "7-3": "Value for field indicated in `property` does not match regex in `pattern`", "8-0": "PrefixMismatch", "8-1": "input, prefix", "8-2": "Prefix mismatch", "8-3": "Prefix of value for field indicated in `property` does not match `prefix`", "9-0": "InvalidCharacter", "9-1": "input, character", "9-2": "Invalid character: '`character`'", "9-3": "Value for field indicated in `property` contains invalid character", "10-0": "MustBeLowerCase", "10-1": "input", "10-2": "Value must be lowercase", "10-3": "Value for field indicated in `property` is not lowercased", "11-0": "MustBeUpperCase", "11-1": "input", "11-2": "Value must be uppercase", "11-3": "Value for field indicated in `property` is not uppercased" }, "cols": 4, "rows": 12 } [/block]
A validation error is an error due to invalid client requests. All validation errors correspond with a 403 HTTP status code. A validation error occurs when: - Request body is ill-formed *e.g. invalid JSON* - Required parameters are missing (either in body or in query string) *e.g. endpoint required a field which is (empty or) not specified in the request* - Endpoint validation rules are not matched *e.g. minimum/maximum length constraint doesn't match* ## VALIDATION ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Message to the user explaining what happened", "3-0": "code", "3-1": "string enum\n- `InvalidFormat`\n- `RequiredField`\n- `InvalidLength`\n- `InvalidMinLength`\n- `InvalidMaxLength`\n- `InvalidEmailAddress`\n- `OutOfRange`\n- `PatternMismatch`\n- `PrefixMismatch`\n- `InvalidCharacter`\n- `MustBeLowerCase`\n- `MustBeUpperCase`", "3-2": "Machine readable code to handle the error", "0-0": "property", "0-1": "string", "0-2": "Request property which originated the error", "2-0": "verbose", "2-1": "string", "2-2": "Message to the developer futher explaining what happened" }, "cols": 3, "rows": 4 } [/block] [block:textarea] { "text": "Example validation error: missing required field", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"code\": \"RequiredField\",\n \"message\": \"Cannot be empty\",\n \"property\": \"slashtag\"\n}", "language": "json" } ], "sidebar": true } [/block] [block:textarea] { "text": "Example of validation error: invalid min length", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n \"property\": \"slashtag\",\n \"message\": \"Value cannot be less than 2 characters long\",\n\t\"code\": \"InvalidMinLength\",\n \"input\": \"a\",\n \"minLength\": 2\n}", "language": "json" } ], "sidebar": true } [/block] [block:textarea] { "text": "Example of validation error: OutOfRange", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"property\": \"regType\",\n \"message\": \"Value is not allowed\",\n \"code\": \"OutOfRange\",\n \"input\": \"cat\",\n \"range\": [\"individual\", \"business\"]\n}", "language": "json" } ], "sidebar": true } [/block] Following additional properties may appear in validation errors: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "input", "0-1": "object", "0-2": "Original input value for `property`", "1-0": "minLength", "1-1": "numerical\nPositive", "1-2": "Minimum length allowed", "2-0": "maxLength", "2-1": "numerical\nStrictly positive", "2-2": "Maximum length allowed", "3-0": "length", "3-1": "numerical\nStrictly positive", "3-2": "Length to match", "4-0": "range", "4-1": "array of objects", "4-2": "Set of allowed values", "5-0": "pattern", "5-1": "string regex", "5-2": "Regex to test the input with", "6-0": "prefix", "6-1": "string", "6-2": "Prefix that input has to match", "7-0": "character", "7-1": "string", "7-2": "Character given in input" }, "cols": 3, "rows": 8 } [/block] ## Validation error codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Additional properties", "h-2": "Message", "h-3": "Description", "0-0": "InvalidFormat", "0-1": "*none*", "0-2": "Invalid format", "0-3": "Generic invalid format error with respect to the `property` value", "1-0": "RequiredField", "1-1": "*none*", "1-2": "Cannot be empty", "1-3": "Field indicated in `property` was empty or not specified in the request", "2-0": "InvalidLength", "2-1": "input, length", "2-2": "Value cannot be different than `length` characters long", "2-3": "Number of characters of `property` value not matching `length`", "3-0": "InvalidMinLength", "3-1": "input, minLength", "3-2": "Value cannot be less than `minLength` characters long", "3-3": "Value for field indicated in `property` was too short with respect to `minLength`", "4-0": "InvalidMaxLength", "4-1": "input, maxLength", "4-2": "Value cannot be more than `maxLength` characters long", "4-3": "Value for field indicated in `property` was too long with respect to `maxLength`", "5-0": "InvalidEmailAddress", "5-1": "input", "5-2": "Value is not a valid email address", "5-3": "Value for field indicated in `property` was not a valid email address", "6-0": "OutOfRange", "6-1": "input, range", "6-2": "Value is not allowed", "6-3": "Value for field indicated in `property` was not included in `range`", "7-0": "PatternMismatch", "7-1": "input, pattern", "7-2": "Invalid format", "7-3": "Value for field indicated in `property` does not match regex in `pattern`", "8-0": "PrefixMismatch", "8-1": "input, prefix", "8-2": "Prefix mismatch", "8-3": "Prefix of value for field indicated in `property` does not match `prefix`", "9-0": "InvalidCharacter", "9-1": "input, character", "9-2": "Invalid character: '`character`'", "9-3": "Value for field indicated in `property` contains invalid character", "10-0": "MustBeLowerCase", "10-1": "input", "10-2": "Value must be lowercase", "10-3": "Value for field indicated in `property` is not lowercased", "11-0": "MustBeUpperCase", "11-1": "input", "11-2": "Value must be uppercase", "11-3": "Value for field indicated in `property` is not uppercased" }, "cols": 4, "rows": 12 } [/block]
{"_id":"579629a5f7d5760e006ee5d7","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T15:00:53.291Z","slug":"403-already-exists-errors","updates":["579656392cd23b0e00283bc5"],"body":"A `403 - Already Exists` error indicates that it is not possible to create a resource with the given definition because another resource already exists with the same attributes.\nSuch errors always correspond with a 403 HTTP status code.\n\n## Already Exists error object\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"property\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Request property which originated the error\",\n    \"1-0\": \"message\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Always \\\"Already exists\\\"\",\n    \"2-0\": \"code\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Always \\\"AlreadyExists\\\"\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example Already Exists error\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 403\\n{\\n  \\\"property\\\": \\\"slashtag\\\",\\n  \\\"message\\\": \\\"Already exists\\\",\\n\\t\\\"code\\\": \\\"AlreadyExists\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","hidden":false,"link_url":"","user":"577d1b6d87acf617003c421d","sync_unique":"","title":"403 - Already exists","type":"basic","__v":2,"excerpt":"","githubsync":"","link_external":false,"project":"577d1b8b74aea422007230c4","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"parentDoc":null,"next":{"description":"","pages":[]},"childrenPages":[]}

403 - Already exists


A `403 - Already Exists` error indicates that it is not possible to create a resource with the given definition because another resource already exists with the same attributes. Such errors always correspond with a 403 HTTP status code. ## Already Exists error object [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "property", "0-1": "string", "0-2": "Request property which originated the error", "1-0": "message", "1-1": "string", "1-2": "Always \"Already exists\"", "2-0": "code", "2-1": "string", "2-2": "Always \"AlreadyExists\"" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example Already Exists error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n \"property\": \"slashtag\",\n \"message\": \"Already exists\",\n\t\"code\": \"AlreadyExists\"\n}", "language": "json" } ], "sidebar": true } [/block]
A `403 - Already Exists` error indicates that it is not possible to create a resource with the given definition because another resource already exists with the same attributes. Such errors always correspond with a 403 HTTP status code. ## Already Exists error object [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "property", "0-1": "string", "0-2": "Request property which originated the error", "1-0": "message", "1-1": "string", "1-2": "Always \"Already exists\"", "2-0": "code", "2-1": "string", "2-2": "Always \"AlreadyExists\"" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example Already Exists error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n \"property\": \"slashtag\",\n \"message\": \"Already exists\",\n\t\"code\": \"AlreadyExists\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"579627c83fedf00e0067acbf","project":"577d1b8b74aea422007230c4","sync_unique":"","updates":[],"__v":1,"body":"A `404 - Not Found` error occurs when:\n- Given unique identifier in request doesn't match any resource\n- Endpoint does not exist\n\n##NOT FOUND ERROR OBJECT\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"1-0\": \"message\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Always \\\"Not found\\\"\",\n    \"2-0\": \"code\",\n    \"2-1\": \"string\",\n    \"0-0\": \"source\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Request property which originated the error.\\nCan be:\\n- `domain`\\n- `link`\\n- `script`\\n- `tag`\\n- `team`\\n- `teammate`\",\n    \"2-2\": \"Always \\\"NotFound\\\"\",\n    \"3-0\": \"id\",\n    \"3-1\": \"string\",\n    \"3-2\": \"When present, is the unique identifier of the resource which was specified in the input object.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Example 404 sources\",\n  \"body\": \"A 404 on a given resource id may happen when one of the following *sources* is missing: domain, link, script, tag, team, teammate.\"\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example Not Found error\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 404\\n{\\n  \\\"source\\\": \\\"domain\\\",\\n  \\\"message\\\": \\\"Not found\\\",\\n\\t\\\"code\\\": \\\"NotFound\\\",\\n  \\\"id\\\": \\\"h64fj1f18f61495fle82e072471fq5hg\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"579619c5cf84ae1700244f1c","githubsync":"","link_external":false,"link_url":"","title":"404 - Not found","api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"createdAt":"2016-07-25T14:52:56.328Z","excerpt":"","hidden":false,"order":7,"parentDoc":null,"isReference":false,"slug":"404-not-found-errors","type":"basic","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","next":{"description":"","pages":[]},"childrenPages":[]}

404 - Not found


A `404 - Not Found` error occurs when: - Given unique identifier in request doesn't match any resource - Endpoint does not exist ##NOT FOUND ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Always \"Not found\"", "2-0": "code", "2-1": "string", "0-0": "source", "0-1": "string", "0-2": "Request property which originated the error.\nCan be:\n- `domain`\n- `link`\n- `script`\n- `tag`\n- `team`\n- `teammate`", "2-2": "Always \"NotFound\"", "3-0": "id", "3-1": "string", "3-2": "When present, is the unique identifier of the resource which was specified in the input object." }, "cols": 3, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Example 404 sources", "body": "A 404 on a given resource id may happen when one of the following *sources* is missing: domain, link, script, tag, team, teammate." } [/block] [block:textarea] { "text": "Example Not Found error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 404\n{\n \"source\": \"domain\",\n \"message\": \"Not found\",\n\t\"code\": \"NotFound\",\n \"id\": \"h64fj1f18f61495fle82e072471fq5hg\"\n}", "language": "json" } ], "sidebar": true } [/block]
A `404 - Not Found` error occurs when: - Given unique identifier in request doesn't match any resource - Endpoint does not exist ##NOT FOUND ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Always \"Not found\"", "2-0": "code", "2-1": "string", "0-0": "source", "0-1": "string", "0-2": "Request property which originated the error.\nCan be:\n- `domain`\n- `link`\n- `script`\n- `tag`\n- `team`\n- `teammate`", "2-2": "Always \"NotFound\"", "3-0": "id", "3-1": "string", "3-2": "When present, is the unique identifier of the resource which was specified in the input object." }, "cols": 3, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Example 404 sources", "body": "A 404 on a given resource id may happen when one of the following *sources* is missing: domain, link, script, tag, team, teammate." } [/block] [block:textarea] { "text": "Example Not Found error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 404\n{\n \"source\": \"domain\",\n \"message\": \"Not found\",\n\t\"code\": \"NotFound\",\n \"id\": \"h64fj1f18f61495fle82e072471fq5hg\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c37ee1b2b45c0010b7b5a3","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:57:05.182Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"A `406 - Not Acceptable` error occurs when you send to Rebrandly API a `POST` or `PUT` API call which is not explicitly declaring `application/json` as `Content-Type` header.\n\nExample generic error\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"POST supports only application/json\\\"\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"406-not-acceptable","type":"basic","title":"406 - Not Acceptable","__v":0,"parentDoc":null,"childrenPages":[]}

406 - Not Acceptable


A `406 - Not Acceptable` error occurs when you send to Rebrandly API a `POST` or `PUT` API call which is not explicitly declaring `application/json` as `Content-Type` header. Example generic error [block:code] { "codes": [ { "code": "\"POST supports only application/json\"", "language": "text" } ], "sidebar": true } [/block]
A `406 - Not Acceptable` error occurs when you send to Rebrandly API a `POST` or `PUT` API call which is not explicitly declaring `application/json` as `Content-Type` header. Example generic error [block:code] { "codes": [ { "code": "\"POST supports only application/json\"", "language": "text" } ], "sidebar": true } [/block]
{"_id":"59c37cf8b2b45c0010b7b4f1","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:48:56.598Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"A `429 - Too Many Requests` error indicates that you exceeded the allowed API rate your account is allowed to reach.\n\nWe have per-second rate checking, you are allowed to perform up to 10 API calls per second in a classic Rebrandly account.","excerpt":"","slug":"429-too-many-requests","type":"basic","title":"429 - Too Many Requests","__v":0,"parentDoc":null,"childrenPages":[]}

429 - Too Many Requests


A `429 - Too Many Requests` error indicates that you exceeded the allowed API rate your account is allowed to reach. We have per-second rate checking, you are allowed to perform up to 10 API calls per second in a classic Rebrandly account.
A `429 - Too Many Requests` error indicates that you exceeded the allowed API rate your account is allowed to reach. We have per-second rate checking, you are allowed to perform up to 10 API calls per second in a classic Rebrandly account.
{"_id":"579632003fedf00e0067acd2","order":10,"parentDoc":null,"sync_unique":"","type":"basic","__v":2,"body":"A `500 - Server Error` error occurs when something went unexpectedly wrong with API operation.\n\n## GENERIC ERROR OBJECT\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"message\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Message to user explaining what happened\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example generic error\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"message\\\": \\\"An error occurred\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","link_url":"","category":"579619c5cf84ae1700244f1c","excerpt":"","user":"577d1b6d87acf617003c421d","api":{"auth":"required","params":[],"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":""},"githubsync":"","project":"577d1b8b74aea422007230c4","title":"500 - Server error","slug":"500-server-error","updates":["579656c25fe9610e00d8a8c0"],"version":"577d1b8b74aea422007230c7","createdAt":"2016-07-25T15:36:32.752Z","hidden":false,"isReference":false,"link_external":false,"next":{"description":"","pages":[]},"childrenPages":[]}

500 - Server error


A `500 - Server Error` error occurs when something went unexpectedly wrong with API operation. ## GENERIC ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "message", "0-1": "string", "0-2": "Message to user explaining what happened" }, "cols": 3, "rows": 1 } [/block] [block:textarea] { "text": "Example generic error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n\t\"message\": \"An error occurred\"\n}", "language": "json" } ], "sidebar": true } [/block]
A `500 - Server Error` error occurs when something went unexpectedly wrong with API operation. ## GENERIC ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "message", "0-1": "string", "0-2": "Message to user explaining what happened" }, "cols": 3, "rows": 1 } [/block] [block:textarea] { "text": "Example generic error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n\t\"message\": \"An error occurred\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"59c3814fc65b90001a6622de","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:07:27.263Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"A `502 - Bad Gateway` occurs when one of the upstream providers Rebrandly relies on is under maintenance or is experiencing a downtime.","excerpt":"","slug":"502-bad-gateway","type":"basic","title":"502 - Bad Gateway","__v":0,"parentDoc":null,"childrenPages":[]}

502 - Bad Gateway


A `502 - Bad Gateway` occurs when one of the upstream providers Rebrandly relies on is under maintenance or is experiencing a downtime.
A `502 - Bad Gateway` occurs when one of the upstream providers Rebrandly relies on is under maintenance or is experiencing a downtime.
{"_id":"59c37e57c65b90001a6622db","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T08:54:47.235Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"A `503 - Server Error` occurs when Rebrandly API is under maintenance or is generally not available.\n\nExample generic error\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"Maintenance is on\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"503-maintenance","type":"basic","title":"503 - Service Unavailable","__v":0,"parentDoc":null,"childrenPages":[]}

503 - Service Unavailable


A `503 - Server Error` occurs when Rebrandly API is under maintenance or is generally not available. Example generic error [block:code] { "codes": [ { "code": "\"Maintenance is on\"", "language": "text" } ] } [/block]
A `503 - Server Error` occurs when Rebrandly API is under maintenance or is generally not available. Example generic error [block:code] { "codes": [ { "code": "\"Maintenance is on\"", "language": "text" } ] } [/block]
{"_id":"59c38350c65b90001a66232e","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T09:16:00.343Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":13,"body":"A `504 - Gateway Timeout` occurs when Rebrandly API is not reachable or when an API operation is taking more than expected to be completed.\nThis generally resembles a buggy behavior, please report to us.","excerpt":"","slug":"504-gateway-timeout","type":"basic","title":"504 - Gateway Timeout","__v":0,"parentDoc":null,"childrenPages":[]}

504 - Gateway Timeout


A `504 - Gateway Timeout` occurs when Rebrandly API is not reachable or when an API operation is taking more than expected to be completed. This generally resembles a buggy behavior, please report to us.
A `504 - Gateway Timeout` occurs when Rebrandly API is not reachable or when an API operation is taking more than expected to be completed. This generally resembles a buggy behavior, please report to us.
{"_id":"59d22ab5f59f4f0010572e2f","project":"577d1b8b74aea422007230c4","version":"577d1b8b74aea422007230c7","category":"579619c5cf84ae1700244f1c","user":"577d1b6d87acf617003c421d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-02T12:01:57.358Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"When the API call is meant to create an additional resource and the account has not enough room left for it, a validation error occurs, explaining the API user which resource threshold has been hit.\n\n## VALIDATION ERROR OBJECT\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"1-0\": \"message\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Message to the user explaining which threshold has been hit.\\nE.g. \\\"Number of domains exceeded\\\"\",\n    \"2-0\": \"code\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Always `LimitExceeded`\",\n    \"0-0\": \"source\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Request property which originated the error.\\nCan be:\\n-`links`\\n-`domains`\\n-`tags`\\n-`scripts`\\n-`teams`\\n-`teammates`\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"Example validation error: missing required field\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// HTTP status 403\\n{\\n\\t\\\"code\\\": \\\"LimitExceeded\\\",\\n  \\\"message\\\": \\\"Number of domains exceeded\\\",\\n  \\\"source\\\": \\\"domains\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"403-limit-exceeded","type":"basic","title":"403 - Limit Exceeded","__v":0,"parentDoc":null,"childrenPages":[]}

403 - Limit Exceeded


When the API call is meant to create an additional resource and the account has not enough room left for it, a validation error occurs, explaining the API user which resource threshold has been hit. ## VALIDATION ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Message to the user explaining which threshold has been hit.\nE.g. \"Number of domains exceeded\"", "2-0": "code", "2-1": "string", "2-2": "Always `LimitExceeded`", "0-0": "source", "0-1": "string", "0-2": "Request property which originated the error.\nCan be:\n-`links`\n-`domains`\n-`tags`\n-`scripts`\n-`teams`\n-`teammates`" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example validation error: missing required field", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"code\": \"LimitExceeded\",\n \"message\": \"Number of domains exceeded\",\n \"source\": \"domains\"\n}", "language": "json" } ], "sidebar": true } [/block]
When the API call is meant to create an additional resource and the account has not enough room left for it, a validation error occurs, explaining the API user which resource threshold has been hit. ## VALIDATION ERROR OBJECT [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "1-0": "message", "1-1": "string", "1-2": "Message to the user explaining which threshold has been hit.\nE.g. \"Number of domains exceeded\"", "2-0": "code", "2-1": "string", "2-2": "Always `LimitExceeded`", "0-0": "source", "0-1": "string", "0-2": "Request property which originated the error.\nCan be:\n-`links`\n-`domains`\n-`tags`\n-`scripts`\n-`teams`\n-`teammates`" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example validation error: missing required field", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 403\n{\n\t\"code\": \"LimitExceeded\",\n \"message\": \"Number of domains exceeded\",\n \"source\": \"domains\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"_id":"57bdd4bf342bcf0e00d5afbc","isReference":false,"link_external":false,"link_url":"","parentDoc":null,"sync_unique":"","user":"56b22f582d96461700599230","project":"577d1b8b74aea422007230c4","title":"Authentication overview","type":"basic","version":"577d1b8b74aea422007230c7","__v":0,"body":"All requests to Rebrandly API need to be authenticated.\nWe currently support:\n- [API Key mode](doc:api-key-authentication) \n- [OAuth mode](doc:request-api-access)","createdAt":"2016-08-24T17:09:19.883Z","excerpt":"","order":0,"api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"category":"57bdd4aa0fe3a00e003e2d22","githubsync":"","hidden":false,"slug":"authentication-overview","updates":[],"childrenPages":[]}

Authentication overview


All requests to Rebrandly API need to be authenticated. We currently support: - [API Key mode](doc:api-key-authentication) - [OAuth mode](doc:request-api-access)
All requests to Rebrandly API need to be authenticated. We currently support: - [API Key mode](doc:api-key-authentication) - [OAuth mode](doc:request-api-access)
{"_id":"57bdd47add496f0e0004c006","sync_unique":"","type":"basic","__v":0,"category":"57bdd4aa0fe3a00e003e2d22","createdAt":"2016-08-24T17:08:10.057Z","excerpt":"","link_external":false,"project":"577d1b8b74aea422007230c4","githubsync":"","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"link_url":"","order":1,"updates":[],"version":"577d1b8b74aea422007230c7","user":"56b22f582d96461700599230","body":"Create a new API key for your application/script in <a href=\"https://www.rebrandly.com/api-settings\" target=\"_blank\">your Rebrandly dashboard</a>.\n\nYou have three ways to include API key in your HTTP requests:\n- Specifying an HTTP header\n- Specifying an HTTP query parameter\n- Specifying an HTTP body parameter\n\nIn all cases, parameter name must be `apikey` and parameter value is `YOUR_API_KEY`.\nAll examples in this documentation include API Key authentication via HTTP header.","hidden":false,"parentDoc":null,"slug":"api-key-authentication","title":"API Key","childrenPages":[]}

API Key


Create a new API key for your application/script in <a href="https://www.rebrandly.com/api-settings" target="_blank">your Rebrandly dashboard</a>. You have three ways to include API key in your HTTP requests: - Specifying an HTTP header - Specifying an HTTP query parameter - Specifying an HTTP body parameter In all cases, parameter name must be `apikey` and parameter value is `YOUR_API_KEY`. All examples in this documentation include API Key authentication via HTTP header.
Create a new API key for your application/script in <a href="https://www.rebrandly.com/api-settings" target="_blank">your Rebrandly dashboard</a>. You have three ways to include API key in your HTTP requests: - Specifying an HTTP header - Specifying an HTTP query parameter - Specifying an HTTP body parameter In all cases, parameter name must be `apikey` and parameter value is `YOUR_API_KEY`. All examples in this documentation include API Key authentication via HTTP header.
{"_id":"577e6147c7b5c50e00a70a63","user":"577d1b6d87acf617003c421d","excerpt":"","isReference":false,"__v":95,"sync_unique":"","version":"577d1b8b74aea422007230c7","createdAt":"2016-07-07T14:03:51.224Z","hidden":false,"link_external":false,"order":2,"api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"body":"**IMPORTANT**: you don't need to implement an OAuth flow if you know the API key of the Rebrandly account. If you are using Rebrandly API with your own Rebrandly account, it's lot easier to use an [API Key](doc:api-key-authentication) than to use an OAuth flow.\n\nIf you want to use the Rebrandly API in your app on behalf of a Rebrandly account, you need to authorize your application.\nYou can submit your authorization request at <a  target=\"_blank\" href=\"http://rebrand.ly/AuthorizeMe\">Rebrand.ly/AuthorizeMe</a>. \n\nWhen you authorize a new app in Rebrandly, a `client_id` is assigned to it. \nThat's enough to let your app users connect with their Rebrandly accounts:\nif your users happen not to have a Rebrandly account, they will be able to register a new account from the same page and then get back to you. \n\nYou can either search for an OAuth client in your favorite programming language or you can configure your own HTTP calls.\n\nIf the following standard OAuth flow doesn't fit your needs, we can arrange together for another OAuth flow.\n\n## Using an OAuth client\n\nThere are <a href='http://oauth.net/2/' target='_blank'>plenty of OAuth clients</a> you can include in your application to get the authorization job done for you.\n\n## Configuring a basic OAuth flow\n\nIf you need to take control over the http flow, here's how to manually setup the authentication process.\nIn order to get a valid token, you have to redirect your users to `https://oauth.rebrandly.com/connect/authorize` with the following query parameters:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"client_id\",\n    \"0-1\": \"The unique Client ID associated with your app.\",\n    \"1-0\": \"redirect_uri\",\n    \"1-1\": \"This is the callback to your app you asked to be authorized in your request. You can ask us to change it anytime.\",\n    \"2-0\": \"response_type\",\n    \"2-1\": \"This should be always `token`.\",\n    \"3-0\": \"scope\",\n    \"3-1\": \"This should be always `rbapi`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\nA full URL would be like: `https://oauth.rebrandly.com/connect/authorize` with parameters `?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=token&scope=rbapi`.\n\nYour users will compile the <a href='https://www.rebrandly.com/login' target='_blank'>Rebrandly Signin form</a> and we will send them back to you via GET HTTP method ([What if I need HTTP POST?](doc:authentication)) at the `redirect_uri` you provided in the request, with the token in URL:\n\n`http://yourapp.com/#access_token=YOUR_TOKEN&token_type=Bearer&expires_in=2592000&scope=rbapi`\n\n## Authenticate requests with OAuth\n\nNow that you have a valid token, you need to add this HTTP header **in all future API requests** to `https://api.rebrandly.com`: \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Header name\",\n    \"h-1\": \"Header value\",\n    \"0-0\": \"Authorization\",\n    \"0-1\": \"\\\"Bearer YOUR_TOKEN\\\"\\n(`Bearer`, then a white space, then the token)\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\nYet another cURL example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl \\\\\\n-H \\\"Authorization: Bearer YOUR_TOKEN\\\" \\\\\\n'https://api.rebrandly.com/v1/account'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","category":"57bdd4aa0fe3a00e003e2d22","parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"request-api-access","title":"OAuth flow","type":"basic","githubsync":"","link_url":"","next":{"pages":[],"description":""},"updates":["57925cbb4973f50e00f0770e","5792b6b390ad641700d46bd2"],"childrenPages":[]}

OAuth flow


**IMPORTANT**: you don't need to implement an OAuth flow if you know the API key of the Rebrandly account. If you are using Rebrandly API with your own Rebrandly account, it's lot easier to use an [API Key](doc:api-key-authentication) than to use an OAuth flow. If you want to use the Rebrandly API in your app on behalf of a Rebrandly account, you need to authorize your application. You can submit your authorization request at <a target="_blank" href="http://rebrand.ly/AuthorizeMe">Rebrand.ly/AuthorizeMe</a>. When you authorize a new app in Rebrandly, a `client_id` is assigned to it. That's enough to let your app users connect with their Rebrandly accounts: if your users happen not to have a Rebrandly account, they will be able to register a new account from the same page and then get back to you. You can either search for an OAuth client in your favorite programming language or you can configure your own HTTP calls. If the following standard OAuth flow doesn't fit your needs, we can arrange together for another OAuth flow. ## Using an OAuth client There are <a href='http://oauth.net/2/' target='_blank'>plenty of OAuth clients</a> you can include in your application to get the authorization job done for you. ## Configuring a basic OAuth flow If you need to take control over the http flow, here's how to manually setup the authentication process. In order to get a valid token, you have to redirect your users to `https://oauth.rebrandly.com/connect/authorize` with the following query parameters: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "client_id", "0-1": "The unique Client ID associated with your app.", "1-0": "redirect_uri", "1-1": "This is the callback to your app you asked to be authorized in your request. You can ask us to change it anytime.", "2-0": "response_type", "2-1": "This should be always `token`.", "3-0": "scope", "3-1": "This should be always `rbapi`." }, "cols": 2, "rows": 4 } [/block] A full URL would be like: `https://oauth.rebrandly.com/connect/authorize` with parameters `?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=token&scope=rbapi`. Your users will compile the <a href='https://www.rebrandly.com/login' target='_blank'>Rebrandly Signin form</a> and we will send them back to you via GET HTTP method ([What if I need HTTP POST?](doc:authentication)) at the `redirect_uri` you provided in the request, with the token in URL: `http://yourapp.com/#access_token=YOUR_TOKEN&token_type=Bearer&expires_in=2592000&scope=rbapi` ## Authenticate requests with OAuth Now that you have a valid token, you need to add this HTTP header **in all future API requests** to `https://api.rebrandly.com`: [block:parameters] { "data": { "h-0": "Header name", "h-1": "Header value", "0-0": "Authorization", "0-1": "\"Bearer YOUR_TOKEN\"\n(`Bearer`, then a white space, then the token)" }, "cols": 2, "rows": 1 } [/block] Yet another cURL example: [block:code] { "codes": [ { "code": "curl \\\n-H \"Authorization: Bearer YOUR_TOKEN\" \\\n'https://api.rebrandly.com/v1/account'", "language": "curl" } ] } [/block]
**IMPORTANT**: you don't need to implement an OAuth flow if you know the API key of the Rebrandly account. If you are using Rebrandly API with your own Rebrandly account, it's lot easier to use an [API Key](doc:api-key-authentication) than to use an OAuth flow. If you want to use the Rebrandly API in your app on behalf of a Rebrandly account, you need to authorize your application. You can submit your authorization request at <a target="_blank" href="http://rebrand.ly/AuthorizeMe">Rebrand.ly/AuthorizeMe</a>. When you authorize a new app in Rebrandly, a `client_id` is assigned to it. That's enough to let your app users connect with their Rebrandly accounts: if your users happen not to have a Rebrandly account, they will be able to register a new account from the same page and then get back to you. You can either search for an OAuth client in your favorite programming language or you can configure your own HTTP calls. If the following standard OAuth flow doesn't fit your needs, we can arrange together for another OAuth flow. ## Using an OAuth client There are <a href='http://oauth.net/2/' target='_blank'>plenty of OAuth clients</a> you can include in your application to get the authorization job done for you. ## Configuring a basic OAuth flow If you need to take control over the http flow, here's how to manually setup the authentication process. In order to get a valid token, you have to redirect your users to `https://oauth.rebrandly.com/connect/authorize` with the following query parameters: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "client_id", "0-1": "The unique Client ID associated with your app.", "1-0": "redirect_uri", "1-1": "This is the callback to your app you asked to be authorized in your request. You can ask us to change it anytime.", "2-0": "response_type", "2-1": "This should be always `token`.", "3-0": "scope", "3-1": "This should be always `rbapi`." }, "cols": 2, "rows": 4 } [/block] A full URL would be like: `https://oauth.rebrandly.com/connect/authorize` with parameters `?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=token&scope=rbapi`. Your users will compile the <a href='https://www.rebrandly.com/login' target='_blank'>Rebrandly Signin form</a> and we will send them back to you via GET HTTP method ([What if I need HTTP POST?](doc:authentication)) at the `redirect_uri` you provided in the request, with the token in URL: `http://yourapp.com/#access_token=YOUR_TOKEN&token_type=Bearer&expires_in=2592000&scope=rbapi` ## Authenticate requests with OAuth Now that you have a valid token, you need to add this HTTP header **in all future API requests** to `https://api.rebrandly.com`: [block:parameters] { "data": { "h-0": "Header name", "h-1": "Header value", "0-0": "Authorization", "0-1": "\"Bearer YOUR_TOKEN\"\n(`Bearer`, then a white space, then the token)" }, "cols": 2, "rows": 1 } [/block] Yet another cURL example: [block:code] { "codes": [ { "code": "curl \\\n-H \"Authorization: Bearer YOUR_TOKEN\" \\\n'https://api.rebrandly.com/v1/account'", "language": "curl" } ] } [/block]
{"_id":"57ea7f0f7728c8220022bff0","sync_unique":"","title":"Examples","body":"","category":"577d22a35fd4de0e00cc3ddd","hidden":false,"link_external":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"excerpt":"","link_url":"","user":"56b22f582d96461700599230","order":0,"parentDoc":null,"slug":"examples","type":"basic","__v":0,"createdAt":"2016-09-27T14:15:43.254Z","githubsync":"","version":"577d1b8b74aea422007230c7","isReference":false,"project":"577d1b8b74aea422007230c4","updates":[],"childrenPages":[]}
{"_id":"577d23925fd4de0e00cc3de5","slug":"create-your-first-link","title":"Rebrand your first link","user":"577d1b6d87acf617003c421d","createdAt":"2016-07-06T15:28:18.091Z","isReference":false,"next":{"pages":[],"description":""},"parentDoc":null,"type":"basic","version":"577d1b8b74aea422007230c7","__v":36,"api":{"auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"link_url":"","updates":["579404ce514c7b0e00e17c4a"],"category":"577d22a35fd4de0e00cc3ddd","link_external":false,"order":1,"githubsync":"","hidden":false,"project":"577d1b8b74aea422007230c4","sync_unique":"","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Prerequisites\"\n}\n[/block]\n * You have already created a Rebrandly account\n If you have not, please read the [Signup to Rebrandly guide](doc:getting-started).\n\n * You already have an API KEY to authenticate your API requests\n  If you don't know how to authenticate your API requests, please read the [Authentication guide](doc:request-api-access) documentation\n\n * You understood what a branded short link is and how it is represented as an API\n If you have not, please read [Branded short link model](doc:link-entity)\n\n* You understood what a branded domain is and how it is related to a branded short link\nIf you have not, please read [Branded domain model](doc:branded-domain-model)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Creating a new branded short link\"\n}\n[/block]\nIn order to create a new Link entity, you should first decide what content to rebrand and how you want the final branded short link to look like.\n\nQuick example of rebranding a link with the 'rebrand.ly' default domain: every account can use the 'rebrand.ly' default.\nLet's say we want to shorten [https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/](https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/) to become [http://rebrand.ly/burn10M](http://rebrand.ly/burn10M).\n\nWell, the domain id of rebrand.ly is `8f104cc5b6ee4a4ba7897b06ac2ddcfb`, but since rebrand.ly is the default domain for every Rebrandly account, we can choose to not specify the domain while creating a new link. This is up to the user.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Where do I get that branded domain \\\"id\\\"?\",\n  \"body\": \"Every time you add a new branded domain in Rebrandly, it is associated with a unique identifier. If you want to create a link with your own custom branded domain, instead of the default rebrand.ly domain, you should [list your domains](doc:listing-your-domains-collection) in order to get each domain's id.\"\n}\n[/block]\nCorrespondent Link object is:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"title\\\": \\\"How to burn 10M\\\",\\n  \\\"slashtag\\\": \\\"burn10M\\\",\\n\\t\\\"destination\\\": \\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Test with a different slashtag!\",\n  \"body\": \"**NOTE**: for your personal tests, you should choose another `slashtag`, because the one used for this demo is already used.\"\n}\n[/block]\nNow we have to send our Link entity to Rebrandly API.\nThe endpoint to do this is `/links` (see [how to create a new link](doc:create-a-new-link)).\nAn HTTP POST request to `https://api.rebrandly.com/v1/links` will create the link:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl \\\\\\n  -H 'apikey: YOUR_API_KEY' \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  -X POST -d '\\n  {\\n  \\t\\\"slashtag\\\":\\\"burn10M\\\",\\n    \\\"title\\\":\\\"How to burn 10M\\\",\\n    \\\"domain\\\": {\\t\\n    \\t\\\"id\\\":\\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n    },\\n    \\\"destination\\\":\\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\"\\n  }' \\\\\\n  'https://api.rebrandly.com/v1/links'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nOr, without the domain part (because the domain is rebrand.ly, the default domain):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl \\n  -H 'apikey: YOUR_API_KEY' \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  -X POST -d \\\\\\n  '{\\n  \\t\\\"slashtag\\\":\\\"burn10M\\\",\\n    \\\"title\\\":\\\"How to burn 10M\\\",\\n    \\\"destination\\\":\\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\"\\n    }' \\\\\\n  'https://api.rebrandly.com/v1/links'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nIf everything works properly, you will get back the Link entity you just created:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  {\\n    \\\"id\\\": \\\"ffs24cc5b6ee4a5gh7897b06ac2d16d4\\\",\\n    \\\"title\\\": \\\"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\\\",\\n    \\\"slashtag\\\": \\\"burn10M\\\",\\n    \\\"destination\\\": \\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\",\\n    \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"shortUrl\\\": \\\"rebrand.ly/burn10M\\\",\\n    \\\"domain\\\": {\\n      \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n      \\\"ref\\\": \\\"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n      \\\"fullName\\\": \\\"rebrand.ly\\\"\\n    },\\n    ...\\n  }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Testing your branded short link\"\n}\n[/block]\nJust click on <a href=\"http://rebrand.ly/burn10M\" target=\"_blank\">http://rebrand.ly/burn10M</a> to test it: you should be redirected to the destination url within milliseconds.\nWeird, right?","excerpt":"How to rebrand your first link with API","childrenPages":[]}

Rebrand your first link

How to rebrand your first link with API

[block:api-header] { "type": "basic", "title": "Prerequisites" } [/block] * You have already created a Rebrandly account If you have not, please read the [Signup to Rebrandly guide](doc:getting-started). * You already have an API KEY to authenticate your API requests If you don't know how to authenticate your API requests, please read the [Authentication guide](doc:request-api-access) documentation * You understood what a branded short link is and how it is represented as an API If you have not, please read [Branded short link model](doc:link-entity) * You understood what a branded domain is and how it is related to a branded short link If you have not, please read [Branded domain model](doc:branded-domain-model) [block:api-header] { "type": "basic", "title": "Creating a new branded short link" } [/block] In order to create a new Link entity, you should first decide what content to rebrand and how you want the final branded short link to look like. Quick example of rebranding a link with the 'rebrand.ly' default domain: every account can use the 'rebrand.ly' default. Let's say we want to shorten [https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/](https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/) to become [http://rebrand.ly/burn10M](http://rebrand.ly/burn10M). Well, the domain id of rebrand.ly is `8f104cc5b6ee4a4ba7897b06ac2ddcfb`, but since rebrand.ly is the default domain for every Rebrandly account, we can choose to not specify the domain while creating a new link. This is up to the user. [block:callout] { "type": "info", "title": "Where do I get that branded domain \"id\"?", "body": "Every time you add a new branded domain in Rebrandly, it is associated with a unique identifier. If you want to create a link with your own custom branded domain, instead of the default rebrand.ly domain, you should [list your domains](doc:listing-your-domains-collection) in order to get each domain's id." } [/block] Correspondent Link object is: [block:code] { "codes": [ { "code": "{\n \"title\": \"How to burn 10M\",\n \"slashtag\": \"burn10M\",\n\t\"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n}", "language": "json" } ] } [/block] [block:callout] { "type": "warning", "title": "Test with a different slashtag!", "body": "**NOTE**: for your personal tests, you should choose another `slashtag`, because the one used for this demo is already used." } [/block] Now we have to send our Link entity to Rebrandly API. The endpoint to do this is `/links` (see [how to create a new link](doc:create-a-new-link)). An HTTP POST request to `https://api.rebrandly.com/v1/links` will create the link: [block:code] { "codes": [ { "code": "curl \\\n -H 'apikey: YOUR_API_KEY' \\\n -H \"Content-Type: application/json\" \\\n -X POST -d '\n {\n \t\"slashtag\":\"burn10M\",\n \"title\":\"How to burn 10M\",\n \"domain\": {\t\n \t\"id\":\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n },\n \"destination\":\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\"\n }' \\\n 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] Or, without the domain part (because the domain is rebrand.ly, the default domain): [block:code] { "codes": [ { "code": "curl \n -H 'apikey: YOUR_API_KEY' \\\n -H \"Content-Type: application/json\" \\\n -X POST -d \\\n '{\n \t\"slashtag\":\"burn10M\",\n \"title\":\"How to burn 10M\",\n \"destination\":\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\"\n }' \\\n 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] If everything works properly, you will get back the Link entity you just created: [block:code] { "codes": [ { "code": " {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n ...\n }", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Testing your branded short link" } [/block] Just click on <a href="http://rebrand.ly/burn10M" target="_blank">http://rebrand.ly/burn10M</a> to test it: you should be redirected to the destination url within milliseconds. Weird, right?
[block:api-header] { "type": "basic", "title": "Prerequisites" } [/block] * You have already created a Rebrandly account If you have not, please read the [Signup to Rebrandly guide](doc:getting-started). * You already have an API KEY to authenticate your API requests If you don't know how to authenticate your API requests, please read the [Authentication guide](doc:request-api-access) documentation * You understood what a branded short link is and how it is represented as an API If you have not, please read [Branded short link model](doc:link-entity) * You understood what a branded domain is and how it is related to a branded short link If you have not, please read [Branded domain model](doc:branded-domain-model) [block:api-header] { "type": "basic", "title": "Creating a new branded short link" } [/block] In order to create a new Link entity, you should first decide what content to rebrand and how you want the final branded short link to look like. Quick example of rebranding a link with the 'rebrand.ly' default domain: every account can use the 'rebrand.ly' default. Let's say we want to shorten [https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/](https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/) to become [http://rebrand.ly/burn10M](http://rebrand.ly/burn10M). Well, the domain id of rebrand.ly is `8f104cc5b6ee4a4ba7897b06ac2ddcfb`, but since rebrand.ly is the default domain for every Rebrandly account, we can choose to not specify the domain while creating a new link. This is up to the user. [block:callout] { "type": "info", "title": "Where do I get that branded domain \"id\"?", "body": "Every time you add a new branded domain in Rebrandly, it is associated with a unique identifier. If you want to create a link with your own custom branded domain, instead of the default rebrand.ly domain, you should [list your domains](doc:listing-your-domains-collection) in order to get each domain's id." } [/block] Correspondent Link object is: [block:code] { "codes": [ { "code": "{\n \"title\": \"How to burn 10M\",\n \"slashtag\": \"burn10M\",\n\t\"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\n}", "language": "json" } ] } [/block] [block:callout] { "type": "warning", "title": "Test with a different slashtag!", "body": "**NOTE**: for your personal tests, you should choose another `slashtag`, because the one used for this demo is already used." } [/block] Now we have to send our Link entity to Rebrandly API. The endpoint to do this is `/links` (see [how to create a new link](doc:create-a-new-link)). An HTTP POST request to `https://api.rebrandly.com/v1/links` will create the link: [block:code] { "codes": [ { "code": "curl \\\n -H 'apikey: YOUR_API_KEY' \\\n -H \"Content-Type: application/json\" \\\n -X POST -d '\n {\n \t\"slashtag\":\"burn10M\",\n \"title\":\"How to burn 10M\",\n \"domain\": {\t\n \t\"id\":\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n },\n \"destination\":\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\"\n }' \\\n 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] Or, without the domain part (because the domain is rebrand.ly, the default domain): [block:code] { "codes": [ { "code": "curl \n -H 'apikey: YOUR_API_KEY' \\\n -H \"Content-Type: application/json\" \\\n -X POST -d \\\n '{\n \t\"slashtag\":\"burn10M\",\n \"title\":\"How to burn 10M\",\n \"destination\":\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\"\n }' \\\n 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] If everything works properly, you will get back the Link entity you just created: [block:code] { "codes": [ { "code": " {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"ref\": \"/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n ...\n }", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Testing your branded short link" } [/block] Just click on <a href="http://rebrand.ly/burn10M" target="_blank">http://rebrand.ly/burn10M</a> to test it: you should be redirected to the destination url within milliseconds. Weird, right?
{"_id":"5790e6d1f7ff000e004ba3e2","githubsync":"","hidden":false,"link_url":"","next":{"description":"","pages":[]},"parentDoc":null,"project":"577d1b8b74aea422007230c4","__v":2,"body":"Every time you create a new branded short link, it becomes part of your personal branded short links collection. This is only visible to you.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Prerequisites\"\n}\n[/block]\n * You have already created a Rebrandly account\n If you have not, please read [Signup to Rebrandly guide](doc:getting-started).\n\n *  You already have a valid API Key or an OAuth token to authenticate your API requests\n  If you don't know how to authenticate your API requests, please read the [Authentication](doc:request-api-access) guide\n\n * You have added at least one branded short link to your collection.\nIf you have not, please read the [Rebrand your first link](doc:create-your-first-link) guide.\n\n * You understood how Rebrandly manages pagination and sortings for a collection of branded short links.\nIf you have not, please read the [Paginating](doc:understanding-pagination) and the [Sorting](doc:understanding-sorting)  guide.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Simple Use Case\"\n}\n[/block]\nExample: How to render the first page of your branded short links collection.\nDefault values for pagination and sorting parameters in branded short links collection listing, are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter name\",\n    \"h-1\": \"Parameter default value\",\n    \"0-0\": \"orderBy\",\n    \"0-1\": \"\\\"createdAt\\\"\",\n    \"1-0\": \"orderDir\",\n    \"1-1\": \"\\\"desc\\\"\",\n    \"2-0\": \"limit\",\n    \"2-1\": \"100\",\n    \"3-0\": \"offset\",\n    \"3-1\": \"0\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\nEndpoint to list your collection of branded short links is `http://api.rebrandly.com/v1/links`.\nYou should perform a GET API call to this endpoint to get the first page of branded short links:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl \\\\\\n  -H 'apikey: YOUR_API_KEY' \\\\\\n  -X GET 'https://api.rebrandly.com/v1/links'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nIf everything works properly, you will get the first 100-resources page of your branded short links collection:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"id\\\": \\\"ffs24cc5b6ee4a5gh7897b06ac2d16d4\\\",\\n    \\\"title\\\": \\\"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\\\",\\n    \\\"slashtag\\\": \\\"burn10M\\\",\\n    \\\"destination\\\": \\\"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\\\",\\n    \\\"createdAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-13T10:54:12.000Z\\\",\\n    \\\"shortUrl\\\": \\\"rebrand.ly/burn10M\\\",\\n    \\\"domain\\\": {\\n      \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\",\\n      \\\"fullName\\\": \\\"rebrand.ly\\\"\\n    },\\n    ...\\n    // other details\\n  },\\n  {\\n    \\\"id\\\": \\\"22ff9c5c9c9441229d29524c63c9ff22\\\",\\n    \\\"title\\\": \\\"Dropbox - myvid.mp4\\\",\\n    \\\"slashtag\\\": \\\"myvid\\\",\\n    \\\"destination\\\": \\\"https://www.dropbox.com/s/0ywz1qo9ss4ss6x/myvid.mp4?dl=0\\\",\\n    \\\"createdAt\\\": \\\"2016-07-06T18:06:49.000Z\\\",\\n    \\\"updatedAt\\\": \\\"2016-07-06T18:06:49.000Z\\\",\\n    \\\"shortUrl\\\": \\\"fake.link/myvid\\\",\\n    \\\"domain\\\": {\\n      \\\"id\\\": \\\"65649c5c9c94411e9d29524c63c9aa13\\\",\\n      \\\"fullName\\\": \\\"fake.link\\\"\\n    },\\n    ...\\n    // other details\\n  },\\n  ...\\n  //  up to 100 results\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","sync_unique":"","title":"Manage your branded links","category":"577d22a35fd4de0e00cc3ddd","isReference":false,"slug":"list-your-links","updates":["5794071910cd740e004f59d0"],"api":{"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[]},"createdAt":"2016-07-21T15:14:25.882Z","excerpt":"How to manage and organize your branded short links","link_external":false,"order":2,"type":"basic","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

Manage your branded links

How to manage and organize your branded short links

Every time you create a new branded short link, it becomes part of your personal branded short links collection. This is only visible to you. [block:api-header] { "type": "basic", "title": "Prerequisites" } [/block] * You have already created a Rebrandly account If you have not, please read [Signup to Rebrandly guide](doc:getting-started). * You already have a valid API Key or an OAuth token to authenticate your API requests If you don't know how to authenticate your API requests, please read the [Authentication](doc:request-api-access) guide * You have added at least one branded short link to your collection. If you have not, please read the [Rebrand your first link](doc:create-your-first-link) guide. * You understood how Rebrandly manages pagination and sortings for a collection of branded short links. If you have not, please read the [Paginating](doc:understanding-pagination) and the [Sorting](doc:understanding-sorting) guide. [block:api-header] { "type": "basic", "title": "Simple Use Case" } [/block] Example: How to render the first page of your branded short links collection. Default values for pagination and sorting parameters in branded short links collection listing, are: [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Parameter default value", "0-0": "orderBy", "0-1": "\"createdAt\"", "1-0": "orderDir", "1-1": "\"desc\"", "2-0": "limit", "2-1": "100", "3-0": "offset", "3-1": "0" }, "cols": 2, "rows": 4 } [/block] Endpoint to list your collection of branded short links is `http://api.rebrandly.com/v1/links`. You should perform a GET API call to this endpoint to get the first page of branded short links: [block:code] { "codes": [ { "code": "curl \\\n -H 'apikey: YOUR_API_KEY' \\\n -X GET 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] If everything works properly, you will get the first 100-resources page of your branded short links collection: [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n ...\n // other details\n },\n {\n \"id\": \"22ff9c5c9c9441229d29524c63c9ff22\",\n \"title\": \"Dropbox - myvid.mp4\",\n \"slashtag\": \"myvid\",\n \"destination\": \"https://www.dropbox.com/s/0ywz1qo9ss4ss6x/myvid.mp4?dl=0\",\n \"createdAt\": \"2016-07-06T18:06:49.000Z\",\n \"updatedAt\": \"2016-07-06T18:06:49.000Z\",\n \"shortUrl\": \"fake.link/myvid\",\n \"domain\": {\n \"id\": \"65649c5c9c94411e9d29524c63c9aa13\",\n \"fullName\": \"fake.link\"\n },\n ...\n // other details\n },\n ...\n // up to 100 results\n]", "language": "json" } ] } [/block]
Every time you create a new branded short link, it becomes part of your personal branded short links collection. This is only visible to you. [block:api-header] { "type": "basic", "title": "Prerequisites" } [/block] * You have already created a Rebrandly account If you have not, please read [Signup to Rebrandly guide](doc:getting-started). * You already have a valid API Key or an OAuth token to authenticate your API requests If you don't know how to authenticate your API requests, please read the [Authentication](doc:request-api-access) guide * You have added at least one branded short link to your collection. If you have not, please read the [Rebrand your first link](doc:create-your-first-link) guide. * You understood how Rebrandly manages pagination and sortings for a collection of branded short links. If you have not, please read the [Paginating](doc:understanding-pagination) and the [Sorting](doc:understanding-sorting) guide. [block:api-header] { "type": "basic", "title": "Simple Use Case" } [/block] Example: How to render the first page of your branded short links collection. Default values for pagination and sorting parameters in branded short links collection listing, are: [block:parameters] { "data": { "h-0": "Parameter name", "h-1": "Parameter default value", "0-0": "orderBy", "0-1": "\"createdAt\"", "1-0": "orderDir", "1-1": "\"desc\"", "2-0": "limit", "2-1": "100", "3-0": "offset", "3-1": "0" }, "cols": 2, "rows": 4 } [/block] Endpoint to list your collection of branded short links is `http://api.rebrandly.com/v1/links`. You should perform a GET API call to this endpoint to get the first page of branded short links: [block:code] { "codes": [ { "code": "curl \\\n -H 'apikey: YOUR_API_KEY' \\\n -X GET 'https://api.rebrandly.com/v1/links'", "language": "curl" } ] } [/block] If everything works properly, you will get the first 100-resources page of your branded short links collection: [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"ffs24cc5b6ee4a5gh7897b06ac2d16d4\",\n \"title\": \"The LaFerrari Supercar Convertible Is the New Best Way to Burn $1M | WIRED\",\n \"slashtag\": \"burn10M\",\n \"destination\": \"https://www.wired.com/2016/07/ferrari-laferrari-spider-convertible-photos-specs/\",\n \"createdAt\": \"2016-07-13T10:54:12.000Z\",\n \"updatedAt\": \"2016-07-13T10:54:12.000Z\",\n \"shortUrl\": \"rebrand.ly/burn10M\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n \"fullName\": \"rebrand.ly\"\n },\n ...\n // other details\n },\n {\n \"id\": \"22ff9c5c9c9441229d29524c63c9ff22\",\n \"title\": \"Dropbox - myvid.mp4\",\n \"slashtag\": \"myvid\",\n \"destination\": \"https://www.dropbox.com/s/0ywz1qo9ss4ss6x/myvid.mp4?dl=0\",\n \"createdAt\": \"2016-07-06T18:06:49.000Z\",\n \"updatedAt\": \"2016-07-06T18:06:49.000Z\",\n \"shortUrl\": \"fake.link/myvid\",\n \"domain\": {\n \"id\": \"65649c5c9c94411e9d29524c63c9aa13\",\n \"fullName\": \"fake.link\"\n },\n ...\n // other details\n },\n ...\n // up to 100 results\n]", "language": "json" } ] } [/block]
{"_id":"57ea5f1666130b1700056ec0","excerpt":"","title":"Use Rebrandly within Tweetbot","type":"basic","version":"577d1b8b74aea422007230c7","sync_unique":"","updates":[],"user":"56b22f582d96461700599230","api":{"auth":"required","params":[],"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"createdAt":"2016-09-27T11:59:18.961Z","githubsync":"","slug":"use-rebrandly-within-tweetbot","__v":0,"body":"<a href=\"http://tapbots.com/tweetbot/\" target=\"_blank\">Tweetbot</a> iOS and Mac applications enable users to integrate with their own custom URL shortener: instead of using the Twitter's anonymous `t.co` domain, you can tweet using your own custom domain by integrating Tweetbot with <a href=\"https://www.rebrandly.com\" target=\"_blank\">Rebrandly</a>. \n\nIntegration is very straightforward, as Rebrandly allows to short URLs with a specially crafted URL ([see it in action in API explorer](https://developers.rebrandly.com/docs/create-link-url)) and Tweetbot's custom URL shortener configuration works great with URLs.\n\n## CRAFT YOUR URL\n\nTo get a special URL for Tweetbot, replace `YOUR_API_KEY` with your own API key ([How to get an API key?](doc:api-key-authentication)) in the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&domain[fullName]=rebrand.ly&destination=%@\",\n      \"language\": \"text\",\n      \"name\": \"Configuration URL for Tweetbot\"\n    }\n  ]\n}\n[/block]\nThis will shorten all URLs in your next tweets with `rebrand.ly` domain.\nWant to use your own custom domain you activated in Rebrandly? Just replace `rebrand.ly` with your domain name in the URL.\n\n## SAVE YOUR SETTINGS\n\nOnce you crafted your own configuration URL for Tweetbot, just write it down into your `URL shortening` section (within your account settings), choosing the `Custom...` option.\n\nMore info on <a href=\"https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-shortening-for-Tweetbot-iOS-and-MAC\" target=\"_blank\">Rebrandly knowledge base</a>.\n\n## TEST IT\n\nTweet something which includes an URL: it will be rebranded using your own custom domain from Rebrandly and you'll even get insights on your visitors from your Rebrandly dashboard.\n\n## TWEET IT\nDon't forget to tweet about how much cool Rebrandly+Tweetbot is.","hidden":false,"order":3,"project":"577d1b8b74aea422007230c4","category":"577d22a35fd4de0e00cc3ddd","isReference":false,"link_external":false,"link_url":"","parentDoc":null,"childrenPages":[]}

Use Rebrandly within Tweetbot


<a href="http://tapbots.com/tweetbot/" target="_blank">Tweetbot</a> iOS and Mac applications enable users to integrate with their own custom URL shortener: instead of using the Twitter's anonymous `t.co` domain, you can tweet using your own custom domain by integrating Tweetbot with <a href="https://www.rebrandly.com" target="_blank">Rebrandly</a>. Integration is very straightforward, as Rebrandly allows to short URLs with a specially crafted URL ([see it in action in API explorer](https://developers.rebrandly.com/docs/create-link-url)) and Tweetbot's custom URL shortener configuration works great with URLs. ## CRAFT YOUR URL To get a special URL for Tweetbot, replace `YOUR_API_KEY` with your own API key ([How to get an API key?](doc:api-key-authentication)) in the following: [block:code] { "codes": [ { "code": "https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&domain[fullName]=rebrand.ly&destination=%@", "language": "text", "name": "Configuration URL for Tweetbot" } ] } [/block] This will shorten all URLs in your next tweets with `rebrand.ly` domain. Want to use your own custom domain you activated in Rebrandly? Just replace `rebrand.ly` with your domain name in the URL. ## SAVE YOUR SETTINGS Once you crafted your own configuration URL for Tweetbot, just write it down into your `URL shortening` section (within your account settings), choosing the `Custom...` option. More info on <a href="https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-shortening-for-Tweetbot-iOS-and-MAC" target="_blank">Rebrandly knowledge base</a>. ## TEST IT Tweet something which includes an URL: it will be rebranded using your own custom domain from Rebrandly and you'll even get insights on your visitors from your Rebrandly dashboard. ## TWEET IT Don't forget to tweet about how much cool Rebrandly+Tweetbot is.
<a href="http://tapbots.com/tweetbot/" target="_blank">Tweetbot</a> iOS and Mac applications enable users to integrate with their own custom URL shortener: instead of using the Twitter's anonymous `t.co` domain, you can tweet using your own custom domain by integrating Tweetbot with <a href="https://www.rebrandly.com" target="_blank">Rebrandly</a>. Integration is very straightforward, as Rebrandly allows to short URLs with a specially crafted URL ([see it in action in API explorer](https://developers.rebrandly.com/docs/create-link-url)) and Tweetbot's custom URL shortener configuration works great with URLs. ## CRAFT YOUR URL To get a special URL for Tweetbot, replace `YOUR_API_KEY` with your own API key ([How to get an API key?](doc:api-key-authentication)) in the following: [block:code] { "codes": [ { "code": "https://api.rebrandly.com/v1/links/new?apikey=YOUR_API_KEY&domain[fullName]=rebrand.ly&destination=%@", "language": "text", "name": "Configuration URL for Tweetbot" } ] } [/block] This will shorten all URLs in your next tweets with `rebrand.ly` domain. Want to use your own custom domain you activated in Rebrandly? Just replace `rebrand.ly` with your domain name in the URL. ## SAVE YOUR SETTINGS Once you crafted your own configuration URL for Tweetbot, just write it down into your `URL shortening` section (within your account settings), choosing the `Custom...` option. More info on <a href="https://support.rebrandly.com/hc/en-us/articles/229596467-Custom-URL-shortening-for-Tweetbot-iOS-and-MAC" target="_blank">Rebrandly knowledge base</a>. ## TEST IT Tweet something which includes an URL: it will be rebranded using your own custom domain from Rebrandly and you'll even get insights on your visitors from your Rebrandly dashboard. ## TWEET IT Don't forget to tweet about how much cool Rebrandly+Tweetbot is.
{"_id":"57ea7ed87728c8220022bfef","title":"Frequently Asked Questions","updates":[],"category":"579742da50804820005ec90a","excerpt":"","hidden":false,"isReference":false,"link_external":false,"sync_unique":"","user":"56b22f582d96461700599230","__v":0,"link_url":"","project":"577d1b8b74aea422007230c4","slug":"frequently-asked-question","api":{"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[]},"body":"","createdAt":"2016-09-27T14:14:48.071Z","order":0,"parentDoc":null,"version":"577d1b8b74aea422007230c7","githubsync":"","type":"basic","childrenPages":[]}

Frequently Asked Questions


{"_id":"592c52729bc0980f0027719d","order":1,"project":"577d1b8b74aea422007230c4","title":"Migrate links over teams","updates":["592e99873f1cc5002f665ce3"],"user":"577d1b6d87acf617003c421d","createdAt":"2017-05-29T16:55:14.096Z","next":{"pages":[],"description":""},"link_external":false,"parentDoc":null,"sync_unique":"","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"category":"579742da50804820005ec90a","excerpt":"","version":"577d1b8b74aea422007230c7","__v":1,"slug":"migrate-links-over-teams","type":"basic","isReference":false,"link_url":"","body":"## How to migrate a link to or from a specific team?\n\nThere is no specific endpoint to migrate a link, whether it's to or from your personal account to a team or to or from different teams you own.\nA workaround is that it can be done programmatically by deleting and recreating the links.\n\n**IMPORTANT**: In this case, you will lose the click stats and all tags/information associated with the link.\n\nThis workaround is only possible if you are the team owner (this means you must have created the team from your personal Rebrandly dashboard). Here is a procedure to do that:\n\n1. Load from API a set of links you want to migrate.\nDepending on where the links have been created, you may need to include the team header (see [Get started](doc:get-started) for more info). \nDouble check how to filter your Rebrandly links in [Listing your links](doc:list-links). \n*E.g. you may want to select all links with a given domain.*\n\n2. For each of the links, perform the following:\n  - DELETE the link from its current context (be sure to include team header if the link is visible only within a team context).\n  - CREATE the link into your final context. If you are moving the link into a team, attach the team header (see [Creating a new link](doc:create-a-new-link) for more info).\nRemember that you need to specify the branded domain in the request, as no default domain is defined for a team.","githubsync":"","hidden":false,"childrenPages":[]}

Migrate links over teams


## How to migrate a link to or from a specific team? There is no specific endpoint to migrate a link, whether it's to or from your personal account to a team or to or from different teams you own. A workaround is that it can be done programmatically by deleting and recreating the links. **IMPORTANT**: In this case, you will lose the click stats and all tags/information associated with the link. This workaround is only possible if you are the team owner (this means you must have created the team from your personal Rebrandly dashboard). Here is a procedure to do that: 1. Load from API a set of links you want to migrate. Depending on where the links have been created, you may need to include the team header (see [Get started](doc:get-started) for more info). Double check how to filter your Rebrandly links in [Listing your links](doc:list-links). *E.g. you may want to select all links with a given domain.* 2. For each of the links, perform the following: - DELETE the link from its current context (be sure to include team header if the link is visible only within a team context). - CREATE the link into your final context. If you are moving the link into a team, attach the team header (see [Creating a new link](doc:create-a-new-link) for more info). Remember that you need to specify the branded domain in the request, as no default domain is defined for a team.
## How to migrate a link to or from a specific team? There is no specific endpoint to migrate a link, whether it's to or from your personal account to a team or to or from different teams you own. A workaround is that it can be done programmatically by deleting and recreating the links. **IMPORTANT**: In this case, you will lose the click stats and all tags/information associated with the link. This workaround is only possible if you are the team owner (this means you must have created the team from your personal Rebrandly dashboard). Here is a procedure to do that: 1. Load from API a set of links you want to migrate. Depending on where the links have been created, you may need to include the team header (see [Get started](doc:get-started) for more info). Double check how to filter your Rebrandly links in [Listing your links](doc:list-links). *E.g. you may want to select all links with a given domain.* 2. For each of the links, perform the following: - DELETE the link from its current context (be sure to include team header if the link is visible only within a team context). - CREATE the link into your final context. If you are moving the link into a team, attach the team header (see [Creating a new link](doc:create-a-new-link) for more info). Remember that you need to specify the branded domain in the request, as no default domain is defined for a team.
{"_id":"579742eafa1ff60e006a1314","user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","category":"579742da50804820005ec90a","githubsync":"","parentDoc":null,"title":"Authentication","__v":1,"body":"## How to receive the OAuth token via `POST`?\n\nIn default mode (see [Authentication](doc:request-api-access)), Rebrandly OAuth server reaches the user `redirect_url` using a `GET` request, passing the token as a query parameter.\nIn some cases, it would be the choice of preference to have the OAuth token returned within a `POST` body.\nIn order to get back the token wrapped into the body of a `POST` request, a further query parameter is required in the OAuth URL (`https://oauth.rebrandly.com/connect/oauth`):\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"client_id\",\n    \"0-1\": \"The unique Client ID associated with your app.\",\n    \"1-0\": \"redirect_uri\",\n    \"1-1\": \"This is the callback to your app you asked to be authorized in your request.\",\n    \"4-0\": \"<span style='color:green'>**response_mode**</span>\",\n    \"4-1\": \"Leave it empty if you want the OAuth server to use `GET` HTTP method when redirecting to your `redirect_uri`. Use \\\"form_post\\\" value if you want the OAuth server to use `POST` HTTP method, instead.\",\n    \"2-0\": \"response_type\",\n    \"2-1\": \"This should be always `token`.\",\n    \"3-0\": \"scope\",\n    \"3-1\": \"This should be always `rbapi`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]","excerpt":"","updates":["5797aa376b0a1b19006decae"],"api":{"params":[],"url":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"order":2,"sync_unique":"","type":"basic","project":"577d1b8b74aea422007230c4","slug":"authentication","createdAt":"2016-07-26T11:00:58.597Z","hidden":false,"isReference":false,"link_external":false,"link_url":"","childrenPages":[]}

Authentication


## How to receive the OAuth token via `POST`? In default mode (see [Authentication](doc:request-api-access)), Rebrandly OAuth server reaches the user `redirect_url` using a `GET` request, passing the token as a query parameter. In some cases, it would be the choice of preference to have the OAuth token returned within a `POST` body. In order to get back the token wrapped into the body of a `POST` request, a further query parameter is required in the OAuth URL (`https://oauth.rebrandly.com/connect/oauth`): [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "client_id", "0-1": "The unique Client ID associated with your app.", "1-0": "redirect_uri", "1-1": "This is the callback to your app you asked to be authorized in your request.", "4-0": "<span style='color:green'>**response_mode**</span>", "4-1": "Leave it empty if you want the OAuth server to use `GET` HTTP method when redirecting to your `redirect_uri`. Use \"form_post\" value if you want the OAuth server to use `POST` HTTP method, instead.", "2-0": "response_type", "2-1": "This should be always `token`.", "3-0": "scope", "3-1": "This should be always `rbapi`." }, "cols": 2, "rows": 5 } [/block]
## How to receive the OAuth token via `POST`? In default mode (see [Authentication](doc:request-api-access)), Rebrandly OAuth server reaches the user `redirect_url` using a `GET` request, passing the token as a query parameter. In some cases, it would be the choice of preference to have the OAuth token returned within a `POST` body. In order to get back the token wrapped into the body of a `POST` request, a further query parameter is required in the OAuth URL (`https://oauth.rebrandly.com/connect/oauth`): [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "client_id", "0-1": "The unique Client ID associated with your app.", "1-0": "redirect_uri", "1-1": "This is the callback to your app you asked to be authorized in your request.", "4-0": "<span style='color:green'>**response_mode**</span>", "4-1": "Leave it empty if you want the OAuth server to use `GET` HTTP method when redirecting to your `redirect_uri`. Use \"form_post\" value if you want the OAuth server to use `POST` HTTP method, instead.", "2-0": "response_type", "2-1": "This should be always `token`.", "3-0": "scope", "3-1": "This should be always `rbapi`." }, "cols": 2, "rows": 5 } [/block]