Discussions

Ask a Question
ANSWERED

API requests links but not getting all of them

Hello, when i request API with /count, i get 214k links. But when i request 25 per 25 with a loop on Talend and the last parameter, i get 200299 links exactly, and it finishes by the right link (the last one of them all). I do an orderBy updatedAt, and sometimes i notice that some links are bypassed, when for example they have the same updateDate exactly. Do you have some solutions ? Thanks, Nathan

404 Error

Hello, I was working the API and I am trying to set up some error messages. When the domain name is not correct, the api should return a code of 404, which it does but inside the response. The http code is in fact 200 which is not correct. Here is my code: $slash_tag = $user.'/vehicle/'.$vehicle_id; echo console_log($slash_tag); $domain_data["fullName"] = "renntapasdas.com"; // messed up domain name $post_data["destination"] = $destination; $post_data["domain"] = $domain_data; $post_data["slashtag"] = $slash_tag; $post_data["title"] = $title; $ch = curl_init("https://api.rebrandly.com/v1/links"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "apikey: NO!", // Do in fact have this but not showing it "Content-Type: application/json" )); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data)); $result = curl_exec($ch); $response = json_decode($result, true); /* returns { "message": "Not found", "httpCode": 404, "code": "NotFound", "source": "domain", "id": "renntapasdas.com" } */ echo console_log("Link: ", $response); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // Should return a 404 but returns a 200 echo console_log("HTTP Code: ", $httpcode); curl_close($ch); if ($httpcode==403) { if ($response['errors'][0]['code'] == 'AlreadyExists') { return 'renntap.com/'.$slash_tag; } else { return ''; } } else if($httpcode==200) { // therefore this if statement is true when it shouldn't be return $response['shortUrl']; } else { return ''; } Any suggested work arounds?
ANSWERED

Any change with Google Analytics 4?

Hi, will Rebrandly change how it processes IP address when Google Analytics 4 becomes standard in 2023? We currently use the API to get the click stream data. Rebrandly removes the IP address but provides other information about the clicker's location, device, OS, platform, etc. What changes can we expect?
ANSWERED

What is the Page Number for end point https://api.rebrandly.com/v1/links

hi support, I am getting very limited data for this API endpoint https://api.rebrandly.com/v1/links. Just wondering what is the page count, page number or page size for this API? Thanks
ANSWERED

Number of clicks returned from API differs from web.

Hey, team - I ran some analysis of our company's link inventory, querying the API. For some of the links, the API returns either zero or thousands of clicks. When I look at the links using the web app, their number of clicks is different and closer to what I would expect. Has anybody else observed this? Am I using the API wrong, or am I missing something? Any hints or pointers are highly appreciated! Best, Chris
ANSWERED

Update recipe for stale/old link

The recipe given to delete links older than a certain amount of time is not optimized as by default it retrieves all links ordered by creation time descending. Which means we start by iterating over link that are valid for nothing. Wouldn't it be wiser to set the corresponding code querystring = urlencode({ "limit": MAX_PAGE_SIZE, "last": lastLink["id"] if lastLink else "", "orderBy": "createdAt", "orderDir": "desc" }) to querystring = urlencode({ "limit": MAX_PAGE_SIZE, "last": lastLink["id"] if lastLink else "", "orderBy": "createdAt", "orderDir": "asc" })
ANSWERED

My Links are not working

My launch is on Monday and I am freaking out because my links are not working. My Speakers are saying that they are being asked to pay for something and another person it takes you to your home page and asks you to get started. After that it wants you t buy the platform. Can you help me please!! summit.healyourhurtingheart.com
ANSWERED

Use API with Mautic

Hi, Mautic application supports URL shorteners. It displays the following text: --- The full URL (including access key) to your url shortener that, when queried, returns a plain text shortened url. For bit.ly users, use `https://api-ssl.bitly.com/v3/shorten?access_token=[ACCESS_TOKEN]&format=txt&longUrl=`, replacing [ACCESS_TOKEN] with your bit.ly access token. --- How can I do the same with Rebrandly? Thanks Alex
ANSWERED

Create multiple links

How can I create a hundred links at the same time, without having to make 1000 requests to the api?
ANSWERED

Node.js Snipped for Axios

Can someone edit the - Node.js - "API for custom short URLs - Code snippet", that I can use it with axios? let request = require("request"); let linkRequest = { destination: "https://www.youtube.com/channel/UCHK4HD0ltu1-I212icLPt3g", domain: { fullName: "rebrand.ly" } //, slashtag: "A_NEW_SLASHTAG" //, title: "Rebrandly YouTube channel" } let requestHeaders = { "Content-Type": "application/json", "apikey": "YOUR_API_KEY", "workspace": "YOUR_WORKSPACE_ID" } request({ uri: "https://api.rebrandly.com/v1/links", method: "POST", body: JSON.stringify(linkRequest), headers: requestHeaders }, (err, response, body) => { let link = JSON.parse(body); console.log(`Long URL was ${link.destination}, short URL is ${link.shortUrl}`); });