Discussions

Ask a Question

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?

Import bulk shorturl

Please suggest me a solution i have to import 50,000 destination url & export shorturl & qr code against imported data in csv format.

Method to get link by destination

I am just getting started using the rebrandly API, and I was looking for a method to help me avoid re-creating short links that point to the same destination. i.e. either the ability to search my links by destination URL or if I try to create a link for a destination URL that already exists, return the previously created link instead of creating a new one. I saw another post that is a few years old that had responses indicating this might be a coming feature. Was this functionality added to the API somewhere and I'm just not seeing it? Thanks.

link works on PC but not in Mobile SMS

I have this link https://graphic.biz/reviewsa that works perfectly on PC and redirects to https://g.page/r/CdyU0ZJnwdahEAE/review But when I send it via SMS in android with Google stock message app, it only redirect to my home page of https://graphicsignhire.com.au/. Not https://g.page/r/CdyU0ZJnwdahEAE/review

Target already exist

We are using rebrand.ly via an external tool where weh can specify the target and the slashtag. If we don't enter a slashtag, we get a generated one. If we use the api with the same target twice, we will get two different slashtags via the api. is it possible to give back the existing slashtag, if a target which already exists is entered via the api? bit.ly does this.