{"__v":2,"_id":"57cd6946873de50e00724a18","api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"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  $post_data[\\\"destination\\\"] = \\\"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\\\";\\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]","category":"577d1b8b74aea422007230c8","createdAt":"2016-09-05T12:47:02.660Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"api-custom-url-shortener","sync_unique":"","title":"API for custom short URLs - Code snippet","type":"basic","updates":["5801bc3b5a601b190081b9cb"],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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 $post_data[\"destination\"] = \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\";\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 $post_data[\"destination\"] = \"https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g\";\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]
{"__v":1,"_id":"57973b66559b402b0044e5ee","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\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[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`)\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","createdAt":"2016-07-26T10:28:54.276Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"get-started","sync_unique":"","title":"Get started","type":"basic","updates":["5797b1c29eaa220e006128e6"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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` 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. [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`) - 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` 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. [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`) - 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]
{"__v":20,"_id":"577d28c487acf617003c4257","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What the API supports\"\n}\n[/block]\n- Manage your branded shorts links\n- Manage your branded domains\n- Manage your account info\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","category":"577d1b8b74aea422007230c8","createdAt":"2016-07-06T15:50:28.127Z","excerpt":"What you can do with the Rebrandly API","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"identify-your-credentials","sync_unique":"","title":"API features","type":"basic","updates":["5792b79c23106419009c4314"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

API features

What you can do with the Rebrandly API

[block:api-header] { "type": "basic", "title": "What the API supports" } [/block] - Manage your branded shorts links - Manage your branded domains - Manage your account info [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
[block:api-header] { "type": "basic", "title": "What the API supports" } [/block] - Manage your branded shorts links - Manage your branded domains - Manage your account info [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
{"__v":0,"_id":"58f6088e914540250034e97f","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"In your Rebrandly account, you can have up to:\n- 10000 links\n- 100 domains \n- 50 tags\n- 50 retargeting scripts\n- 10 API keys\n\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","createdAt":"2017-04-18T12:37:34.561Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"pages":[],"description":""},"order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"api-limits","sync_unique":"","title":"API limits","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

API limits


In your Rebrandly account, you can have up to: - 10000 links - 100 domains - 50 tags - 50 retargeting scripts - 10 API keys 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.
In your Rebrandly account, you can have up to: - 10000 links - 100 domains - 50 tags - 50 retargeting scripts - 10 API keys 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.
{"__v":3,"_id":"57a217455220910e002a1759","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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): How to 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- [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!","category":"577d1b8b74aea422007230c8","createdAt":"2016-08-03T16:09:41.097Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":4,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"live-apps","sync_unique":"","title":"Live APPS","type":"basic","updates":["582ae5997a96051b0070b0e5","58ef82c2de2a332300c9d675"],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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): How to 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. - [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): How to 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. - [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!
{"__v":0,"_id":"57cd8a2a1e75f217006dce2e","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T15:07:22.323Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"api-explorer","sync_unique":"","title":"API Explorer","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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.
{"__v":9,"_id":"57cd7ce2873de50e00724a3b","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57cd7fb567e1be1700c28570","ref":"","in":"query","required":false,"desc":"Filter branded short links which refer to a specific branded domain id","default":"","type":"string","name":"domain.id"},{"_id":"57cd7f9e67e1be1700c2856f","ref":"","in":"query","required":false,"desc":"Filter branded short links according to their status among `active` and `trashed`.","default":"","type":"string","name":"status"},{"_id":"57cd7f7c33cbfb2200e6cd4e","ref":"","in":"query","required":false,"desc":"Filter branded short links depending on favourite (loved) property","default":"","type":"boolean","name":"favourite"},{"_id":"57cd7faa873de50e00724a3f","ref":"","in":"query","required":false,"desc":"Whether to include or not include click statistics in results","default":"false","type":"boolean","name":"withStats"},{"_id":"57cd7f134b5a7f1900899379","ref":"","in":"query","required":false,"desc":"Sorting criteria to apply to your branded short links collection among `createdAt`, `updatedAt`, `title` and `slashtag`.","default":"createdAt","type":"string","name":"orderBy"},{"_id":"57cd7f134b5a7f1900899378","ref":"","in":"query","required":false,"desc":"Sorting direction to apply to your branded short links collection","default":"desc","type":"string","name":"orderDir"},{"_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  \"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    \"fullName\": \"rebrand.ly\"\n  }\n  \"forwardParameters\": true\n},\n ...\n]","name":""},{"status":404,"language":"json","code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","url":"/v1/links"},"body":"More details in [Listing your links](doc:list-links).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:10:42.560Z","excerpt":"Get a list of links","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"links-list-endpoint","sync_unique":"","title":"/v1/links","type":"get","updates":[],"user":"56b22f582d96461700599230","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
withStats:
booleanfalse
Whether to include or not include click statistics in results
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
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).
{"__v":2,"_id":"57cd8278873de50e00724a41","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57cd82955f5adc0e0075c5d8","default":"","desc":"Unique identifier of the branded short link you want to get details for","in":"path","name":"id","ref":"","required":true,"type":"string"}],"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":""},{"status":404,"language":"json","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":""}]},"settings":"","url":"/v1/links/:id"},"body":"More details in [Getting link details](doc:get-link-details).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:34:32.004Z","excerpt":"Get details about a specific link","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"links-detail-endpoint","sync_unique":"","title":"/v1/links/:id","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
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).
{"__v":2,"_id":"57cd85701e75f217006dce2b","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57ce8ad9065d9a0e00d47c8a","ref":"","in":"query","required":false,"desc":"Filter branded short links depnding on the favourite (loved) property","default":"","type":"boolean","name":"favourite"},{"_id":"57ce8ad9065d9a0e00d47c89","ref":"","in":"query","required":false,"desc":"Filter branded short links depending on their status among `active` and `trashed`","default":"","type":"string","name":"status"},{"_id":"57ce8af75f5adc0e0075c683","ref":"","in":"query","required":false,"desc":"Filter branded short links which refer to a specific branded domain id","default":"","type":"string","name":"domain.id"}],"results":{"codes":[{"name":"","code":"{\n    \"count\": 42\n}","language":"json","status":200}]},"settings":"","url":"/v1/links/count"},"body":"More details at [Counting your links](doc:counting-your-links).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:47:12.753Z","excerpt":"Get how many links with given filtering conditions","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"counting-links-endpoint","sync_unique":"","title":"/v1/links/count","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
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).
{"__v":5,"_id":"57ea648566130b1700056ec5","api":{"auth":"required","examples":{"codes":[{"name":"Paste in your browser","language":"text","code":"https://api.rebrandly.com/v1/links?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":"57ea650474088b17002237d8","ref":"","in":"query","required":false,"desc":"A description/note you associate to the branded short link.","default":"","type":"string","name":"description"},{"_id":"57ea65e174088b17002237de","ref":"","in":"query","required":false,"desc":"Whether this branded short link should be set as favourite (loved) or not","default":"false","type":"boolean","name":"favourite"},{"_id":"57ea65e174088b17002237dc","ref":"","in":"query","required":false,"desc":"The unique id of the branded domain. If not specified, http://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]"}],"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}\n","name":""},{"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"},"body":"","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-27T12:22:29.674Z","excerpt":"Create a new link","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":4,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"create-link-url","sync_unique":"","title":"/v1/links/new","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
description:
string
A description/note you associate to the branded short link.
favourite:
booleanfalse
Whether this branded short link should be set as favourite (loved) or not
domain[id]:
string
The unique id of the branded domain. If not specified, http://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.

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



{"__v":5,"_id":"57cd88c667e1be1700c28579","api":{"auth":"required","examples":{"codes":[]},"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":"57cd88c667e1be1700c2857b","ref":"","in":"body","required":false,"desc":"A description/note you associate to the branded short link.","default":"","type":"string","name":"description"},{"_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":"57cd8b4c67e1be1700c28581","ref":"","in":"body","required":false,"desc":"Whether this branded short link should be set as favourite (loved) or not","default":"false","type":"boolean","name":"favourite"}],"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}"},{"code":"{\n  \"property\": \"domain.id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","language":"json","status":404}]},"settings":"","url":"/v1/links"},"body":"","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T15:01:26.470Z","excerpt":"Create a new link","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":5,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"create-link-endpoint","sync_unique":"","title":"/v1/links","type":"post","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
description:
string
A description/note you associate to the branded short link.
domain:
object
A reference to the branded domain resource for this branded short link. If not set, http://rebrand.ly is used
favourite:
booleanfalse
Whether this branded short link should be set as favourite (loved) or not

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



{"__v":9,"_id":"57cd8c0d873de50e00724a55","api":{"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":"57cd8c8a873de50e00724a56","ref":"","in":"body","required":true,"desc":"New slashtag you want to assign to a branded short link","default":"","type":"string","name":"slashtag"},{"_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":"57cd8ca85f5adc0e0075c5eb","ref":"","in":"body","required":true,"desc":"New domain you want to assign to a branded short link","default":"","type":"object","name":"domain"},{"_id":"57cd8cbb1e75f217006dce36","ref":"","in":"body","required":true,"desc":"Whether a link should be marked as favourite (loved) or not","default":"false","type":"boolean","name":"favourite"},{"_id":"57cd8cc95f5adc0e0075c5ec","ref":"","in":"body","required":false,"desc":"A description/note you associate to the branded short link","default":"","type":"string","name":"description"}],"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-15T10:05:22.000Z\",\n  \"shortUrl\": \"rebrand.ly/video\",\n  \"domain\": {\n    \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\",\n    \"fullName\": \"rebrand.ly\"\n  },\n  \"forwardParameters\": true\n}","name":""},{"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":"","url":"/v1/links/:id"},"body":"More details at [Updating a link](doc:update-a-link).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T15:15:25.180Z","excerpt":"Update a specific link","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":6,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"update-link-endpoint","sync_unique":"","title":"/v1/links/:id","type":"post","updates":[],"user":"56b22f582d96461700599230","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
slashtag:
required
string
New slashtag you want to assign to a branded short link
destination:
required
string
New destination URL you want to assign to a branded short link
domain:
required
object
New domain you want to assign to a branded short link
favourite:
required
booleanfalse
Whether a link should be marked as favourite (loved) or not
description:
string
A description/note you associate to the branded short link
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).
{"__v":2,"_id":"57cd8db567e1be1700c28582","api":{"auth":"required","examples":{"codes":[]},"method":"delete","params":[{"_id":"57cd8db567e1be1700c28583","ref":"","in":"path","required":true,"desc":"Unique identifier of the branded short link you want to trash or delete","default":"","type":"string","name":"id"},{"_id":"57cd8dc64b5a7f1900899389","ref":"","in":"query","required":false,"desc":"Set to true if you want the branded short link to be recoverable in the future","default":"false","type":"boolean","name":"trash"}],"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  },\n  \"status\": \"trashed\",\n  \"favourite\": false,\n  \"forwardParameters\": true\n}","language":"json","status":200},{"status":404,"language":"text","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}"}]},"settings":"","url":"/v1/links/:id"},"body":"More details at [Deleting a link](doc:delete-a-link).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T15:22:29.991Z","excerpt":"Delete a specific link","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":7,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"v1linksid","sync_unique":"","title":"/v1/links/:id","type":"delete","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","childrenPages":[]}

delete/v1/links/:id

Delete a specific link

Path Params

id:
required
string
Unique identifier of the branded short link you want to trash or delete

Query Params

trash:
booleanfalse
Set to true if you want the branded short link to be recoverable in the future
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).
{"__v":7,"_id":"57cd83b7873de50e00724a42","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57cd84411e75f217006dce1f","ref":"","in":"query","required":false,"desc":"Filter branded domains depending on whether they can be used to brand short links or not","default":"","type":"boolean","name":"active"},{"_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"},{"_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","name":"orderDir"},{"_id":"57cd842967e1be1700c28573","ref":"","in":"query","required":false,"desc":"How many branded domains to skip","default":"0","type":"int","name":"offset"},{"_id":"57cd84345f5adc0e0075c5dd","ref":"","in":"query","required":false,"desc":"How many branded domains to load, starting from offset on","default":"100","type":"int","name":"limit"}],"results":{"codes":[{"name":"","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}]},"settings":"","url":"/v1/domains"},"body":"More details at [Listing your domains](doc:listing-your-domains-collection).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:39:51.819Z","excerpt":"Get a list of domains","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":8,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"domains-list-endpoint","sync_unique":"","title":"/v1/domains","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
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).
{"__v":0,"_id":"57cd85425f5adc0e0075c5e1","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57cd85425f5adc0e0075c5e2","default":"","desc":"Unique identifier of the branded domain you want to get details about","in":"path","name":"id","ref":"","required":true,"type":"string"}],"results":{"codes":[{"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}","name":""},{"status":404,"language":"json","code":"{\n  \"property\": \"id\",\n  \"message\": \"Not found\",\n  \"code\": \"NotFound\"\n}","name":""}]},"settings":"","url":"/v1/domains/:id"},"body":"More details at [Getting domain details](doc:getting-single-domain-details).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:46:26.073Z","excerpt":"Get details about a specific domain","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":9,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"domain-details-endpoint","sync_unique":"","title":"/v1/domains/:id","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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
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).
{"__v":1,"_id":"57cd86495f5adc0e0075c5e5","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"57ce8b2a07d7ea0e00e43884","ref":"","in":"query","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":"57ce8b2a07d7ea0e00e43883","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"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"count\": 42\n}","name":""}]},"settings":"","url":"/v1/domains/count"},"body":"More details at [Counting your domains](doc:counting-your-domains).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:50:49.333Z","excerpt":"Get how many domains with given filtering conditions","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":10,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"count-domains-endpoint","sync_unique":"","title":"/v1/domains/count","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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)
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).
{"__v":0,"_id":"57cd86934b5a7f1900899383","api":{"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":"","url":"/v1/account"},"body":"More details at [Getting account details](doc:getting-account-details).","category":"57cd7c3267e1be1700c2856d","createdAt":"2016-09-05T14:52:03.995Z","excerpt":"Get account details","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":11,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"account-details-endpoint","sync_unique":"","title":"/v1/account","type":"get","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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).
{"__v":1,"_id":"5791f3704973f50e00f07687","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\": \"Create and update branded short links. Use filters to get lists of links, or access link details individually.\",\n    \"1-0\": \"Domain\",\n    \"1-1\": \"/domains\",\n    \"1-2\": \"Use filters to get lists of branded domains.\",\n    \"2-0\": \"Account\",\n    \"2-1\": \"/account\",\n    \"2-2\": \"Get account info.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\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\": \"200 responses returning JSON objects\",\n    \"4-0\": \"Invalid operation\",\n    \"4-1\": \"403 responses with JSON validation info\\nSee []\",\n    \"5-0\": \"Unauthorized operation\",\n    \"5-1\": \"401 response\",\n    \"6-0\": \"Server error\",\n    \"6-1\": \"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  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]","category":"5791e88c4973f50e00f07683","createdAt":"2016-07-22T10:20:32.173Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"model-overview","sync_unique":"","title":"Model overview","type":"basic","updates":["5793ebf87d1e4a0e00346080"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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": "Create and update branded short links. Use filters to get lists of links, or access link details individually.", "1-0": "Domain", "1-1": "/domains", "1-2": "Use filters to get lists of branded domains.", "2-0": "Account", "2-1": "/account", "2-2": "Get account info." }, "cols": 3, "rows": 3 } [/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": "200 responses returning JSON objects", "4-0": "Invalid operation", "4-1": "403 responses with JSON validation info\nSee []", "5-0": "Unauthorized operation", "5-1": "401 response", "6-0": "Server error", "6-1": "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." }, "cols": 2, "rows": 7 } [/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": "Create and update branded short links. Use filters to get lists of links, or access link details individually.", "1-0": "Domain", "1-1": "/domains", "1-2": "Use filters to get lists of branded domains.", "2-0": "Account", "2-1": "/account", "2-2": "Get account info." }, "cols": 3, "rows": 3 } [/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": "200 responses returning JSON objects", "4-0": "Invalid operation", "4-1": "403 responses with JSON validation info\nSee []", "5-0": "Unauthorized operation", "5-1": "401 response", "6-0": "Server error", "6-1": "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." }, "cols": 2, "rows": 7 } [/block]
{"__v":2,"_id":"5790f8a2affd0429005fedfc","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    \\\"forwardParameters\\\": true\\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 10000 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 url, slashtag or domain 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]","category":"5791e88c4973f50e00f07683","createdAt":"2016-07-21T16:30:26.552Z","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.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"link-entity","sync_unique":"","title":"Branded short links","type":"basic","updates":["5793efedf7ffa30e00431770"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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 \"forwardParameters\": true\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 10000 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 url, slashtag or domain 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 \"forwardParameters\": true\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 10000 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 url, slashtag or domain 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]
{"__v":1,"_id":"5790f9ff8242580e00fc2b61","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"5791e88c4973f50e00f07683","createdAt":"2016-07-21T16:36:15.460Z","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.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"branded-domain-model","sync_unique":"","title":"Branded domains","type":"basic","updates":["5793f12f10cd740e004f59ca"],"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]
{"__v":1,"_id":"5790fccf8242580e00fc2b65","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\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}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"5791e88c4973f50e00f07683","createdAt":"2016-07-21T16:48:15.559Z","excerpt":"Accounts are designed to provide your application with an identity.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"account-model","sync_unique":"","title":"Accounts","type":"basic","updates":["5793f338514c7b0e00e17c40"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

Accounts

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" }, "cols": 3, "rows": 6 } [/block] [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}", "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" }, "cols": 3, "rows": 6 } [/block] [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}", "language": "json" } ], "sidebar": true } [/block]
{"__v":1,"_id":"579252cf69c5120e00efded4","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"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]","category":"5791e88c4973f50e00f07683","createdAt":"2016-07-22T17:07:27.098Z","excerpt":"Resource References are objects used to link resources together, in order to allow navigation between them.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"resource-objects","sync_unique":"","title":"Resource references","type":"basic","updates":["5793f4a00b4ca20e00beaa34"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":0,"_id":"5796078ef7d5760e006ee5aa","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-25T12:35:26.232Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"links-overview","sync_unique":"","title":"Branded short links","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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.
{"__v":1,"_id":"5791f79ddaa64a0e008bc274","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\": \"A description/note you associate to the branded short link\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\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]","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:38:21.309Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"create-a-new-link","sync_unique":"","title":"Creating a new link","type":"basic","updates":["5794089e7d1e4a0e00346086"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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": "A description/note you associate to the branded short link" }, "cols": 4, "rows": 5 } [/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": "A description/note you associate to the branded short link" }, "cols": 4, "rows": 5 } [/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]
{"__v":2,"_id":"5791f7ab08d7110e0085f62d","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\": \"slashtag\",\n    \"1-1\": \"string\",\n    \"1-2\": \"**required**\\nAllowed character set:\\n`A-Z`, `a-z`, `0-9`, `_`, `-`\\nMin 1 chars\\nMax 40 chars\",\n    \"1-3\": \"New slashtag you want to assign to a branded short link\",\n    \"2-0\": \"title\",\n    \"2-1\": \"string\",\n    \"2-2\": \"**required**\\nUTF8\\nMin 2 chars\\nMax 300 chars\",\n    \"2-3\": \"New title you want to assign to a branded short link\",\n    \"3-0\": \"domain\",\n    \"3-1\": \"object\",\n    \"3-2\": \"**required**\\n[Domain Reference](doc:entity-references)\",\n    \"3-3\": \"New domain you want to assign to a branded short link\",\n    \"4-0\": \"favourite\",\n    \"4-1\": \"boolean\",\n    \"4-2\": \"**required**\",\n    \"4-3\": \"Whether a link should be marked as favourite (loved) or not\",\n    \"5-0\": \"description\",\n    \"5-1\": \"string\",\n    \"5-2\": \"*optional*\",\n    \"5-3\": \"A description/note you associate to the branded short link\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\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  \\\"slashtag\\\": \\\"video\\\",\\n  \\\"destination\\\": \\\"https://www.youtube.com/watch?v=3VmtibKpmXI\\\",\\n  \\\"shortUrl\\\": \\\"rebrand.ly/video\\\",\\n  \\\"domain\\\": {\\n    \\\"id\\\": \\\"8f104cc5b6ee4a4ba7897b06ac2ddcfb\\\"\\n  }\\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]","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:38:35.213Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"update-a-link","sync_unique":"","title":"Updating a link","type":"basic","updates":["57940b0e7d1e4a0e00346087"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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": "slashtag", "1-1": "string", "1-2": "**required**\nAllowed character set:\n`A-Z`, `a-z`, `0-9`, `_`, `-`\nMin 1 chars\nMax 40 chars", "1-3": "New slashtag you want to assign to a branded short link", "2-0": "title", "2-1": "string", "2-2": "**required**\nUTF8\nMin 2 chars\nMax 300 chars", "2-3": "New title you want to assign to a branded short link", "3-0": "domain", "3-1": "object", "3-2": "**required**\n[Domain Reference](doc:entity-references)", "3-3": "New domain you want to assign to a branded short link", "4-0": "favourite", "4-1": "boolean", "4-2": "**required**", "4-3": "Whether a link should be marked as favourite (loved) or not", "5-0": "description", "5-1": "string", "5-2": "*optional*", "5-3": "A description/note you associate to the branded short link" }, "cols": 4, "rows": 6 } [/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 \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\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": "slashtag", "1-1": "string", "1-2": "**required**\nAllowed character set:\n`A-Z`, `a-z`, `0-9`, `_`, `-`\nMin 1 chars\nMax 40 chars", "1-3": "New slashtag you want to assign to a branded short link", "2-0": "title", "2-1": "string", "2-2": "**required**\nUTF8\nMin 2 chars\nMax 300 chars", "2-3": "New title you want to assign to a branded short link", "3-0": "domain", "3-1": "object", "3-2": "**required**\n[Domain Reference](doc:entity-references)", "3-3": "New domain you want to assign to a branded short link", "4-0": "favourite", "4-1": "boolean", "4-2": "**required**", "4-3": "Whether a link should be marked as favourite (loved) or not", "5-0": "description", "5-1": "string", "5-2": "*optional*", "5-3": "A description/note you associate to the branded short link" }, "cols": 4, "rows": 6 } [/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 \"slashtag\": \"video\",\n \"destination\": \"https://www.youtube.com/watch?v=3VmtibKpmXI\",\n \"shortUrl\": \"rebrand.ly/video\",\n \"domain\": {\n \"id\": \"8f104cc5b6ee4a4ba7897b06ac2ddcfb\"\n }\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]
{"__v":2,"_id":"5791f7d24973f50e00f0768c","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:39:14.857Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"get-link-details","sync_unique":"","title":"Getting link details","type":"basic","updates":["57940b817d1e4a0e00346088"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":2,"_id":"5791f7b608d7110e0085f62e","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\": \"withStats\",\n    \"6-1\": \"boolean\\n*default is false*\",\n    \"6-2\": \"*optional*\",\n    \"6-3\": \"Whether to include or not include click statistics in results\",\n    \"7-0\": \"domain.id\",\n    \"7-1\": \"string\",\n    \"7-2\": \"*optional*\",\n    \"7-3\": \"Filter branded short links which refer to a specific branded domain id\"\n  },\n  \"cols\": 4,\n  \"rows\": 8\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&withStats=false&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]","category":"5791f02edaa64a0e008bc261","createdAt":"2016-07-22T10:38:46.725Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":4,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"list-links","sync_unique":"","title":"Listing your links","type":"basic","updates":["57940ccaf7ffa30e00431774"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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": "withStats", "6-1": "boolean\n*default is false*", "6-2": "*optional*", "6-3": "Whether to include or not include click statistics in results", "7-0": "domain.id", "7-1": "string", "7-2": "*optional*", "7-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 8 } [/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&withStats=false&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": "withStats", "6-1": "boolean\n*default is false*", "6-2": "*optional*", "6-3": "Whether to include or not include click statistics in results", "7-0": "domain.id", "7-1": "string", "7-2": "*optional*", "7-3": "Filter branded short links which refer to a specific branded domain id" }, "cols": 4, "rows": 8 } [/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&withStats=false&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]
{"__v":1,"_id":"57924b35310cb22200f6e179","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"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","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"counting-your-links","sync_unique":"","title":"Counting your links","type":"basic","updates":["57940dfa0b4ca20e00beaa43"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":1,"_id":"5791f7c608d7110e0085f62f","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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","createdAt":"2016-07-22T10:39:02.221Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":6,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"delete-a-link","sync_unique":"","title":"Deleting a link","type":"basic","updates":["5794106f10cd740e004f59d2"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":0,"_id":"57960a31cf84ae1700244f0b","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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)","category":"5792332d90ad641700d46b75","createdAt":"2016-07-25T12:46:41.997Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"branded-domains","sync_unique":"","title":"Branded domains","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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)
{"__v":1,"_id":"579235f17feea81700e5abed","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"5792332d90ad641700d46b75","createdAt":"2016-07-22T15:04:17.214Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"getting-single-domain-details","sync_unique":"","title":"Getting domain details","type":"basic","updates":["5792b917f967f617000d9e81"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":2,"_id":"5792333c310cb22200f6e162","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"5792332d90ad641700d46b75","createdAt":"2016-07-22T14:52:44.134Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"listing-your-domains-collection","sync_unique":"","title":"Listing your domains","type":"basic","updates":["5792baac23106419009c4315"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":1,"_id":"57924cb57feea81700e5ac15","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"5792332d90ad641700d46b75","createdAt":"2016-07-22T16:41:25.478Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"counting-your-domains","sync_unique":"","title":"Counting your domains","type":"basic","updates":["5792bcd479215d1900324382"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":0,"_id":"579634e73fedf00e0067acdc","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"Accounts are designed to provide your application with an identity.\nYou can [get](doc:getting-account-details) account details at any time.","category":"579242d1310cb22200f6e172","createdAt":"2016-07-25T15:48:55.820Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"account-identity","sync_unique":"","title":"Account identity","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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.
{"__v":1,"_id":"5792432108d7110e0085f69a","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"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}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"579242d1310cb22200f6e172","createdAt":"2016-07-22T16:00:33.978Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"getting-account-details","sync_unique":"","title":"Getting account details","type":"basic","updates":["5793f6957d1e4a0e00346082"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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}", "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}", "language": "json" } ], "sidebar": true } [/block]
{"__v":0,"_id":"57971ad2acc0bb0e0033358b","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"577d2b505fd4de0e00cc3e09","createdAt":"2016-07-26T08:09:54.900Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"resource-collections","sync_unique":"","title":"Resource collections","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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.
{"__v":2,"_id":"5790ea9af7ff000e004ba3e6","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"577d2b505fd4de0e00cc3e09","createdAt":"2016-07-21T15:30:34.698Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"understanding-pagination","sync_unique":"","title":"Paginating collections","type":"basic","updates":["5793e4e90b4ca20e00beaa2e","5793e590514c7b0e00e17c3e"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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.
{"__v":1,"_id":"5790f0f2f7ff000e004ba3ec","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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`.","category":"577d2b505fd4de0e00cc3e09","createdAt":"2016-07-21T15:57:38.895Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"understanding-sorting","sync_unique":"","title":"Sorting collections","type":"basic","updates":["5793eaf87d1e4a0e0034607f"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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`.
{"__v":2,"_id":"579228ea310cb22200f6e153","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"Each API endpoint has its own response model.","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-22T14:08:42.111Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"understanding-responses","sync_unique":"","title":"Handling errors","type":"basic","updates":["5793e112514c7b0e00e17c3c","579653a75fe9610e00d8a8bd"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

Handling errors


Each API endpoint has its own response model.
Each API endpoint has its own response model.
{"__v":1,"_id":"57961a20769c3a0e001cd421","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"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    \"5-0\": \"500 Internal Error\",\n    \"1-0\": \"400 Bad Request\",\n    \"5-1\": \"- Internal API error\",\n    \"8-0\": \"504 Gateway Timeout\",\n    \"8-1\": \"- Timeout on operation\",\n    \"6-0\": \"502 Bad Gateway\",\n    \"6-1\": \"- Failure in our upstream providers\",\n    \"7-0\": \"503 Service Unavailable\",\n    \"7-1\": \"- API maintenance\",\n    \"1-1\": \"- Invalid JSON request\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T13:54:40.354Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"http-responses","sync_unique":"","title":"HTTP responses","type":"basic","updates":["579653f9f64c9f0e007cd732"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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", "5-0": "500 Internal Error", "1-0": "400 Bad Request", "5-1": "- Internal API error", "8-0": "504 Gateway Timeout", "8-1": "- Timeout on operation", "6-0": "502 Bad Gateway", "6-1": "- Failure in our upstream providers", "7-0": "503 Service Unavailable", "7-1": "- API maintenance", "1-1": "- Invalid JSON request" }, "cols": 2, "rows": 9 } [/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", "5-0": "500 Internal Error", "1-0": "400 Bad Request", "5-1": "- Internal API error", "8-0": "504 Gateway Timeout", "8-1": "- Timeout on operation", "6-0": "502 Bad Gateway", "6-1": "- Failure in our upstream providers", "7-0": "503 Service Unavailable", "7-1": "- API maintenance", "1-1": "- Invalid JSON request" }, "cols": 2, "rows": 9 } [/block]
{"__v":0,"_id":"579629dd4913990e001a58fb","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T15:01:49.239Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"401-unauthorized","sync_unique":"","title":"401 - Unauthorized","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":1,"_id":"57961a3bf7d5760e006ee5bb","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T13:55:07.290Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"validation-errors","sync_unique":"","title":"403 - Invalid format","type":"basic","updates":["579655c65fe9610e00d8a8bf"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":1,"_id":"579629a5f7d5760e006ee5d7","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T15:00:53.291Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"403-already-exists-errors","sync_unique":"","title":"403 - Already exists","type":"basic","updates":["579656392cd23b0e00283bc5"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]
{"__v":0,"_id":"579627c83fedf00e0067acbf","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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\": \"property\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Request property which originated the error\",\n    \"2-2\": \"Always \\\"NotFound\\\"\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\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  \\\"property\\\": \\\"id\\\",\\n  \\\"message\\\": \\\"Not found\\\",\\n\\t\\\"code\\\": \\\"NotFound\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T14:52:56.328Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"404-not-found-errors","sync_unique":"","title":"404 - Not found","type":"basic","updates":[],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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": "property", "0-1": "string", "0-2": "Request property which originated the error", "2-2": "Always \"NotFound\"" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example Not Found error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 404\n{\n \"property\": \"id\",\n \"message\": \"Not found\",\n\t\"code\": \"NotFound\"\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": "property", "0-1": "string", "0-2": "Request property which originated the error", "2-2": "Always \"NotFound\"" }, "cols": 3, "rows": 3 } [/block] [block:textarea] { "text": "Example Not Found error", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// HTTP status 404\n{\n \"property\": \"id\",\n \"message\": \"Not found\",\n\t\"code\": \"NotFound\"\n}", "language": "json" } ], "sidebar": true } [/block]
{"__v":1,"_id":"579632003fedf00e0067acd2","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"A 500 - Server 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]","category":"579619c5cf84ae1700244f1c","createdAt":"2016-07-25T15:36:32.752Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":6,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"500-server-error","sync_unique":"","title":"500 - Server error","type":"basic","updates":["579656c25fe9610e00d8a8c0"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","childrenPages":[]}

500 - Server error


A 500 - Server 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 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]
{"__v":0,"_id":"57bdd4bf342bcf0e00d5afbc","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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)","category":"57bdd4aa0fe3a00e003e2d22","createdAt":"2016-08-24T17:09:19.883Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"authentication-overview","sync_unique":"","title":"Authentication overview","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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)
{"__v":0,"_id":"57bdd47add496f0e0004c006","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"57bdd4aa0fe3a00e003e2d22","createdAt":"2016-08-24T17:08:10.057Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"api-key-authentication","sync_unique":"","title":"API Key","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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.
{"__v":95,"_id":"577e6147c7b5c50e00a70a63","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"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?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 `http://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'http://api.rebrandly.com/v1/account'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","category":"57bdd4aa0fe3a00e003e2d22","createdAt":"2016-07-07T14:03:51.224Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"request-api-access","sync_unique":"","title":"OAuth flow","type":"basic","updates":["57925cbb4973f50e00f0770e","5792b6b390ad641700d46bd2"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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?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 `http://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'http://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?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 `http://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'http://api.rebrandly.com/v1/account'", "language": "curl" } ] } [/block]
{"__v":0,"_id":"57ea7f0f7728c8220022bff0","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"","category":"577d22a35fd4de0e00cc3ddd","createdAt":"2016-09-27T14:15:43.254Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"examples","sync_unique":"","title":"Examples","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","childrenPages":[]}
{"__v":36,"_id":"577d23925fd4de0e00cc3de5","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"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?","category":"577d22a35fd4de0e00cc3ddd","createdAt":"2016-07-06T15:28:18.091Z","excerpt":"How to rebrand your first link with API","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"create-your-first-link","sync_unique":"","title":"Rebrand your first link","type":"basic","updates":["579404ce514c7b0e00e17c4a"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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?
{"__v":2,"_id":"5790e6d1f7ff000e004ba3e2","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"577d22a35fd4de0e00cc3ddd","createdAt":"2016-07-21T15:14:25.882Z","excerpt":"How to manage and organize your branded short links","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":2,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"list-your-links","sync_unique":"","title":"Manage your branded links","type":"basic","updates":["5794071910cd740e004f59d0"],"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]
{"__v":0,"_id":"57ea5f1666130b1700056ec0","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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.","category":"577d22a35fd4de0e00cc3ddd","createdAt":"2016-09-27T11:59:18.961Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"use-rebrandly-within-tweetbot","sync_unique":"","title":"Use Rebrandly within Tweetbot","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","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.
{"__v":0,"_id":"57ea7ed87728c8220022bfef","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"","category":"579742da50804820005ec90a","createdAt":"2016-09-27T14:14:48.071Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"frequently-asked-question","sync_unique":"","title":"Frequently Asked Questions","type":"basic","updates":[],"user":"56b22f582d96461700599230","version":"577d1b8b74aea422007230c7","childrenPages":[]}

Frequently Asked Questions


{"__v":1,"_id":"579742eafa1ff60e006a1314","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"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]","category":"579742da50804820005ec90a","createdAt":"2016-07-26T11:00:58.597Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"577d1b8b74aea422007230c4","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":["5797aa376b0a1b19006decae"],"user":"577d1b6d87acf617003c421d","version":"577d1b8b74aea422007230c7","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]