A promise-based client for the Rebrandly API in Node.js.
npm install rebrandly --save
const Rebrandly = require("rebrandly");
const client = new Rebrandly({
apikey: "API_KEY_HERE",
// `workspace` is optional
workspace: "WORKSPACE_HERE"
});
// Output all shortlinks and the destinations they point to
client.links.list().then(res => {
for(const link of res) {
console.log(`${link.domainName}/${link.slashtag} -> ${link.destination}`);
}
});
Methods in this module wrap around the REST API specified here: https://developers.rebrandly.com
rebrandly.account.get()
rebrandly.account.getTeams(params)
rebrandly.account.getWorkspaces(params)
rebrandly.domains.count(params)
rebrandly.domains.get(id)
rebrandly.domains.list(params)
rebrandly.links.count(params)
rebrandly.links.create(params)
rebrandly.links.delete(id, params)
rebrandly.links.get(id)
rebrandly.links.getScripts(id, params)
rebrandly.links.getTags(id, params)
rebrandly.links.list(params)
rebrandly.links.update(id, params)
rebrandly.scripts.count()
rebrandly.scripts.create(params)
rebrandly.scripts.delete(id)
rebrandly.scripts.get(id)
rebrandly.scripts.list(params)
rebrandly.scripts.update(id, params)
rebrandly.tags.count()
rebrandly.tags.create(params)
rebrandly.tags.delete(id)
rebrandly.tags.get(id)
rebrandly.tags.list(params)
rebrandly.tags.update(id, params)