Geliştiriciler için API Referansı v3

Başlarken

İsteklerin sistem tarafından işlenmesi için bir API anahtarı gereklidir. Bir kullanıcı kaydolduğunda, bu kullanıcı için otomatik olarak bir API anahtarı oluşturulur. API anahtarı, her istekle birlikte gönderilmelidir (aşağıdaki tam örneğe bakın). API anahtarı gönderilmezse veya süresi dolmuşsa bir hata oluşur. Kötüye kullanımı önlemek için lütfen API anahtarınızı gizli tuttuğunuzdan emin olun.

kimlik doğrulama

API sistemiyle kimlik doğrulaması yapmak için API anahtarınızı her istekle birlikte bir yetkilendirme belirteci olarak göndermeniz gerekir. Aşağıda örnek kodu görebilirsiniz.

curl --location --request POST 'https://miniurl.ws/api/url/add' \ 
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \ 
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/url/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer YOURAPIKEY",
    "Content-Type: application/json",
    ),
));

$response = curl_exec($curl);
Oran Sınırı

API'miz, kararlılığını en üst düzeye çıkarmak için isteklerdeki ani artışlara karşı koruma sağlayan bir hız sınırlayıcıya sahiptir. Hız sınırlayıcımız şu anda 1 dakika başına 30 istekle sınırlandırılmıştır.

Yanıtın yanında birkaç başlık gönderilir ve bunlar istekle ilgili çeşitli bilgileri belirlemek için incelenebilir.

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: TIMESTAMP
Yanıt İşleme

Tüm API yanıtı, varsayılan olarak JSON biçiminde döndürülür. Bunu kullanılabilir verilere dönüştürmek için dile göre uygun işlevin kullanılması gerekecektir. PHP'de, json_decode() işlevi, verileri bir nesneye (varsayılan) veya bir diziye (ikinci parametreyi true olarak ayarlayın) dönüştürmek için kullanılabilir. Hata anahtarının kontrol edilmesi bir hata olup olmadığı hakkında bilgi verdiği için çok önemlidir. Başlık kodunu da kontrol edebilirsiniz.

{
    "error": 1,
    "message": "An error ocurred"
}

Hesap

Hesap Al
GET https://miniurl.ws/api/account

Hesapla ilgili bilgi almak için bu uç noktaya bir istek gönderebilirsiniz ve bu, hesapla ilgili verileri döndürür.

curl --location --request GET 'https://miniurl.ws/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/account",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "data": {
        "id": 1,
        "email": "[email protected]",
        "username": "sampleuser",
        "avatar": "https:\/\/domain.com\/content\/avatar.png",
        "status": "pro",
        "expires": "2022-11-15 15:00:00",
        "registered": "2020-11-10 18:01:43"
    }
}
Hesabı güncelle
PUT https://miniurl.ws/api/account/update

Hesapla ilgili bilgileri güncellemek için bu uç noktaya bir istek gönderebilirsiniz; bu, hesaptaki verileri güncelleyecektir.

curl --location --request PUT 'https://miniurl.ws/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "newpassword"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/account/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "email": "[email protected]",
    "password": "newpassword"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "Account has been successfully updated."
}

Kayıtlı Alan Adları

List all branded domains
GET https://miniurl.ws/api/domains?limit=2&page=1

To get your branded domains codes via the API, you can use this endpoint. You can also filter data (See table for more info).

ParametreTanım
limit (optional) Per page data result
page (optional) Current page request
curl --location --request GET 'https://miniurl.ws/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/domains?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "domains": [
            {
                "id": 1,
                "domain": "https:\/\/domain1.com",
                "redirectroot": "https:\/\/rootdomain.com",
                "redirect404": "https:\/\/rootdomain.com\/404"
            },
            {
                "id": 2,
                "domain": "https:\/\/domain2.com",
                "redirectroot": "https:\/\/rootdomain2.com",
                "redirect404": "https:\/\/rootdomain2.com\/404"
            }
        ]
    }
}
Create a Branded Domain
POST https://miniurl.ws/api/domain/add

A domain can be added using this endpoint. You need to send the pixel type and the tag.

ParametreTanım
domain (required) Branded domain including http or https
redirectroot (optional) Root redirect when someone visits your domain
redirect404 (optional) Custom 404 redirect
curl --location --request POST 'https://miniurl.ws/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/domain/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "id": 1
}
Update a Domain
PUT https://miniurl.ws/api/domain/:id/update

To update a branded domain, you need to send a valid data in JSON via a PUT request. The data must be sent as the raw body of your request as shown below. The example below shows all the parameters you can send but you are not required to send all (See table for more info).

ParametreTanım
redirectroot (optional) Root redirect when someone visits your domain
redirect404 (optional) Custom 404 redirect
curl --location --request PUT 'https://miniurl.ws/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/domain/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "Domain has been updated successfully."
}
Delete Domain
DELETE https://miniurl.ws/api/domain/:id/delete

To delete a domain, you need to send a DELETE request.

curl --location --request DELETE 'https://miniurl.ws/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/domain/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "Domain has been deleted successfully."
}

Özel Reklam

List all custom splash
GET https://miniurl.ws/api/splash?limit=2&page=1

To get custom splash pages via the API, you can use this endpoint. You can also filter data (See table for more info).

ParametreTanım
limit (optional) Per page data result
page (optional) Current page request
curl --location --request GET 'https://miniurl.ws/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/splash?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "splash": [
            {
                "id": 1,
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "name": "Product 2 Promo",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

CTA Yer Paylaşımları

List all cta overlays
GET https://miniurl.ws/api/overlay?limit=2&page=1

To get cta overlays via the API, you can use this endpoint. You can also filter data (See table for more info).

ParametreTanım
limit (optional) Per page data result
page (optional) Current page request
curl --location --request GET 'https://miniurl.ws/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/overlay?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "cta": [
            {
                "id": 1,
                "type": "message",
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "contact",
                "name": "Contact Page",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

Bağlantılar


piksel

List all pixels
GET https://miniurl.ws/api/pixels?limit=2&page=1

To get your pixels codes via the API, you can use this endpoint. You can also filter data (See table for more info).

ParametreTanım
limit (optional) Per page data result
page (optional) Current page request
curl --location --request GET 'https://miniurl.ws/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/pixels?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "pixels": [
            {
                "id": 1,
                "type": "gtmpixel",
                "name": "GTM Pixel",
                "tag": "GA-123456789",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "twitterpixel",
                "name": "Twitter Pixel",
                "tag": "1234567",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}
Create a Pixel
POST https://miniurl.ws/api/pixel/add

A pixel can be created using this endpoint. You need to send the pixel type and the tag.

ParametreTanım
type (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit
name (required) Custom name for your pixel
tag (required) The tag for the pixel
curl --location --request POST 'https://miniurl.ws/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/pixel/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "id": 1
}
Update a Pixel
PUT https://miniurl.ws/api/pixel/:id/update

To update a pixel, you need to send a valid data in JSON via a PUT request. The data must be sent as the raw body of your request as shown below. The example below shows all the parameters you can send but you are not required to send all (See table for more info).

ParametreTanım
name (optional) Custom name for your pixel
tag (required) The tag for the pixel
curl --location --request PUT 'https://miniurl.ws/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/pixel/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "Pixel has been updated successfully."
}
Delete Pixel
DELETE https://miniurl.ws/api/pixel/:id/delete

To delete a pixel, you need to send a DELETE request.

curl --location --request DELETE 'https://miniurl.ws/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/pixel/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "Pixel has been deleted successfully."
}

QR Kodları

Tüm QR kodlarını listele
GET https://miniurl.ws/api/qr?limit=2&page=1

API üzerinden QR kodlarınızı almak için bu uç noktayı kullanabilirsiniz. Ayrıca verileri filtreleyebilirsiniz (Daha fazla bilgi için tabloya bakın).

ParametreTanım
limit (optional) Per page data result
page (optional) Current page request
curl --location --request GET 'https://miniurl.ws/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/qr?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "qrs": [
            {
                "id": 2,
                "link": "https:\/\/miniurl.ws\/qr\/a2d5e",
                "scans": 0,
                "name": "Google",
                "date": "2020-11-10 18:01:43"
            },
            {
                "id": 1,
                "link": "https:\/\/miniurl.ws\/qr\/b9edfe",
                "scans": 5,
                "name": "Google Canada",
                "date": "2020-11-10 18:00:25"
            }
        ]
    }
}
Tek bir QR Kodu alın
GET https://miniurl.ws/api/qr/:id

API aracılığıyla tek bir QR kodunun ayrıntılarını almak için bu uç noktayı kullanabilirsiniz.

curl --location --request GET 'https://miniurl.ws/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/qr/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "details": {
        "id": 1,
        "link": "https:\/\/miniurl.ws\/qr\/b9edfe",
        "scans": 5,
        "name": "Google Canada",
        "date": "2020-11-10 18:00:25"
    },
    "data": {
        "clicks": 1,
        "uniqueClicks": 1,
        "topCountries": {
            "Unknown": "1"
        },
        "topReferrers": {
            "Direct, email and other": "1"
        },
        "topBrowsers": {
            "Chrome": "1"
        },
        "topOs": {
            "Windows 10": "1"
        },
        "socialCount": {
            "facebook": 0,
            "twitter": 0,
            "instagram": 0
        }
    }
}
QR Kodu Oluşturun
POST https://miniurl.ws/api/qr/add

To create a QR Code, you need to send a valid data in JSON via a POST request. The data must be sent as the raw body of your request as shown below. The example below shows all the parameters you can send but you are not required to send all (See table for more info).

ParametreTanım
type (required) text | vcard | link | email | phone | sms | wifi
data (required) Data to be embedded inside the QR code. The data can be string or array depending on the type
background (optional) RGB color e.g. rgb(255,255,255)
foreground (optional) RGB color e.g. rgb(0,0,0)
logo (optional) Path to the logo either png or jpg
curl --location --request POST 'https://miniurl.ws/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/qr/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "id": 3,
    "link": "https:\/\/miniurl.ws\/qr\/a58f79"
}
QR Kodunu Güncelle
PUT https://miniurl.ws/api/qr/:id/update

Bir QR Kodunu güncellemek için, bir PUT isteği aracılığıyla JSON'da geçerli bir veri göndermeniz gerekir. Veriler, aşağıda gösterildiği gibi talebinizin ham gövdesi olarak gönderilmelidir. Aşağıdaki örnek, gönderebileceğiniz tüm parametreleri gösterir, ancak hepsini göndermeniz gerekmez (Daha fazla bilgi için tabloya bakın).

ParametreTanım
data (required) Data to be embedded inside the QR code. The data can be string or array depending on the type
background (optional) RGB color e.g. rgb(255,255,255)
foreground (optional) RGB color e.g. rgb(0,0,0)
logo (optional) Path to the logo either png or jpg
curl --location --request PUT 'https://miniurl.ws/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/qr/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "QR has been updated successfully."
}
QR Kodunu Sil
DELETE https://miniurl.ws/api/qr/:id/delete

Bir QR kodunu silmek için bir DELETE isteği göndermeniz gerekir.

curl --location --request DELETE 'https://miniurl.ws/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/qr/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "QR Code has been deleted successfully."
}

Planlar

Bu uç noktaya yalnızca yönetici ayrıcalıklarına sahip kullanıcılar erişebilir.

Tüm planları listele
GET https://miniurl.ws/api/plans

Platformdaki tüm planların bir listesini alın.

curl --location --request GET 'https://miniurl.ws/api/plans' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/plans",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "data": [
        {
            "id": 2,
            "name": "Business",
            "free": false,
            "prices": {
                "monthly": 9.9900000000000002131628207280300557613372802734375,
                "yearly": 99.9899999999999948840923025272786617279052734375,
                "lifetime": 999.990000000000009094947017729282379150390625
            },
            "limits": {
                "links": 100,
                "clicks": 100000,
                "retention": 60,
                "custom": {
                    "enabled": "0"
                },
                "team": {
                    "enabled": "0",
                    "count": "0"
                },
                "splash": {
                    "enabled": "1",
                    "count": "5"
                },
                "overlay": {
                    "enabled": "1",
                    "count": "10"
                },
                "pixels": {
                    "enabled": "1",
                    "count": "10"
                },
                "domain": {
                    "enabled": "1",
                    "count": "1"
                },
                "multiple": {
                    "enabled": "0"
                },
                "alias": {
                    "enabled": "1"
                },
                "device": {
                    "enabled": "0"
                },
                "geo": {
                    "enabled": "0"
                },
                "bundle": {
                    "enabled": "0"
                },
                "parameters": {
                    "enabled": "0"
                },
                "export": {
                    "enabled": "0"
                },
                "api": {
                    "enabled": "0"
                }
            }
        },
        {
            "id": 1,
            "name": "Starter",
            "free": true,
            "prices": null,
            "limits": {
                "links": 10,
                "clicks": 1000,
                "retention": 7,
                "custom": {
                    "enabled": "0"
                },
                "team": {
                    "enabled": "0",
                    "count": "0"
                },
                "splash": {
                    "enabled": "0",
                    "count": "0"
                },
                "overlay": {
                    "enabled": "0",
                    "count": "10"
                },
                "pixels": {
                    "enabled": "0",
                    "count": "10"
                },
                "domain": {
                    "enabled": "0",
                    "count": "0"
                },
                "multiple": {
                    "enabled": "0"
                },
                "alias": {
                    "enabled": "0"
                },
                "device": {
                    "enabled": "0"
                },
                "geo": {
                    "enabled": "0"
                },
                "bundle": {
                    "enabled": "0"
                },
                "parameters": {
                    "enabled": "0"
                },
                "export": {
                    "enabled": "0"
                },
                "api": {
                    "enabled": "0"
                }
            }
        }
    ]
}
Bir kullanıcıyı bir plana abone olma
PUT https://miniurl.ws/api/plan/:planid/user/:userid

Bir kullanıcıyı plana abone olmak için, bu uç noktaya plan kimliği ve kullanıcı kimliği ile bir PUT isteği gönderin. Abonelik türü ve sona erme tarihi belirtilmelidir. Son kullanma tarihi belirtilmemişse, türe göre tarih ayarlanacaktır.

ParametreTanım
type monthly | yearly | lifetime
expiration (isteğe bağlı) Planın sona erme tarihi ör.2024-05-16 15:35:03
curl --location --request PUT 'https://miniurl.ws/api/plan/:planid/user/:userid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "monthly",
    "expiration": "2024-05-16 15:35:03"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/plan/:planid/user/:userid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "type": "monthly",
    "expiration": "2024-05-16 15:35:03"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "User has been subscribed to this plan."
}

Kullanıcılar

Bu uç noktaya yalnızca yönetici ayrıcalıklarına sahip kullanıcılar erişebilir.

Tüm kullanıcıları listele
GET https://miniurl.ws/api/users?filter=free

Platformdaki tüm kullanıcıların bir listesini alın. Veriler, url'de bir filtre parametresi gönderilerek filtrelenebilir.

ParametreTanım
filter admin | free | pro
curl --location --request GET 'https://miniurl.ws/api/users?filter=free' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/users?filter=free",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "data": [
        {
            "id": 2,
            "email": "[email protected]",
            "username": "sample2user",
            "avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
            "status": "free",
            "planid": 1,
            "expires": null,
            "registered": "2020-11-10 18:01:43",
            "apikey": "ABC123DEF456"
        },
        {
            "id": 1,
            "email": "[email protected]",
            "username": "sampleuser",
            "avatar": "https:\\\/\\\/domain.com\/content\/avatar.png",
            "status": "pro",
            "planid": 2,
            "expires": "2022-11-15 15:00:00",
            "registered": "2020-11-10 18:01:43",
            "apikey": "ABC123DEF456"
        }
    ]
}
List a single user
GET https://miniurl.ws/api/user/:id

Get data for a single user.

curl --location --request GET 'https://miniurl.ws/api/user/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/user/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "data": {
        "id": 2,
        "email": "[email protected]",
        "username": "sample2user",
        "avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
        "status": "free",
        "planid": 1,
        "expires": null,
        "registered": "2020-11-10 18:01:43",
        "apikey": "ABC123DEF456"
    }
}
Kullanıcı oluştur
POST https://miniurl.ws/api/user/add

Bir kullanıcı oluşturmak için bu uç noktayı kullanın ve aşağıdaki bilgileri JSON olarak gönderin.

ParametreTanım
username (required) User's username. Needs to be valid.
email (required) User's email. Needs to be valid.
password (required) User's password. Minimum 5 characters.
planid (optional) Premium plan. This can be found in the admin panel.
expiration (optional) Membership expiration example 2020-12-26 12:00:00
curl --location --request POST 'https://miniurl.ws/api/user/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "user",
    "password": "1234567891011",
    "email": "[email protected]",
    "planid": 1,
    "expiration": "2020-11-20 11:00:00"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/user/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => '{
    "username": "user",
    "password": "1234567891011",
    "email": "[email protected]",
    "planid": 1,
    "expiration": "2020-11-20 11:00:00"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "User has been registered.",
    "data": {
        "id": 3,
        "email": "[email protected]",
        "username": "user"
    }
}
Bir kullanıcıyı sil
DELETE https://miniurl.ws/api/user/:id/delete

Bir kullanıcıyı silmek için bu uç noktayı kullanın.

curl --location --request DELETE 'https://miniurl.ws/api/user/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://miniurl.ws/api/user/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Sunucu cevabı
{
    "error": 0,
    "message": "User has been deleted."
}