Ein API-Schlüssel ist erforderlich, damit Anfragen vom System verarbeitet werden. Sobald sich ein Nutzer registriert, wird automatisch ein API-Schlüssel generiert. Der API-Schlüssel muss mit jeder Anfrage gesendet werden (siehe vollständiges Beispiel unten). Wenn der API-Schlüssel nicht gesendet wird oder abgelaufen ist, tritt ein Fehler auf. Bitte halten Sie Ihren API-Schlüssel geheim, um Missbrauch zu verhindern.
Zur Authentifizierung mit dem API-System müssen Sie Ihren API-Schlüssel als Autorisierungstoken mit jeder Anfrage senden. Unten finden Sie Beispielcode.
curl --location --request POST 'https://linktw.in/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/account',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: ''
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Unsere API hat eine Ratenbegrenzung zum Schutz vor Anfragespitzen, um maximale Stabilität zu gewährleisten. Unsere Ratenbegrenzung ist derzeit auf 120 Anfragen pro 1 Minute begrenzt.
Mehrere Header werden zusammen mit der Antwort gesendet und können untersucht werden, um verschiedene Informationen über die Anfrage zu ermitteln.
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 119
X-RateLimit-Reset: TIMESTAMP
Alle API-Antworten werden standardmäßig im JSON-Format zurückgegeben. Um diese in nutzbare Daten umzuwandeln, muss je nach Programmiersprache die entsprechende Funktion verwendet werden. In PHP kann die Funktion json_decode() verwendet werden, um die Daten in ein Objekt (Standard) oder Array (zweiten Parameter auf true setzen) umzuwandeln. Es ist sehr wichtig, den Error-Schlüssel zu prüfen, da dieser Informationen darüber liefert, ob ein Fehler aufgetreten ist oder nicht. Sie können auch den Header-Code überprüfen.
{
"error": 1,
"message": "An error occurred"
}
Alle Datums- und Zeitfelder in API-Antworten werden in der für Ihr Konto konfigurierten Zeitzone zurückgegeben. Sie können Ihre Zeitzone in Ihren Kontoeinstellungen festlegen. Wenn keine Zeitzone konfiguriert ist, werden Daten standardmäßig in UTC angezeigt.
Sie koennen auch die Zeitzone Ihres Kontos pro Anfrage ueberschreiben, indem Sie ein ?timezone= Query-Parameter für die meisten Endpunkte (z. B. ?timezone=America/New_York).
Datumsfelder sind formatiert als YYYY-MM-DD HH:MM:SS (z. B. 2024-01-15 14:30:00).
Der Konto-Endpunkt gibt zurück timezone_offset was der aktuelle UTC-Offset in Minuten für Ihre konfigurierte Zeitzone ist. Dies berücksichtigt die Sommerzeit und kann zur Umrechnung von Daten in andere Zeitzonen verwendet werden. Zum Beispiel bedeutet -300 UTC-5 (Eastern Standard Time), 60 bedeutet UTC+1 (Mitteleuropäische Zeit).
{
"settings": {
"timezone": "America/New_York",
"timezone_offset": -300
},
"date": "2024-01-15 14:30:00"
}
Das Feld location im Array geotarget muss den exakten, vollständigen Ländernamen verwenden, wie unten angezeigt. Bei Ländernamen wird zwischen Groß- und Kleinschreibung unterschieden. Klicken Sie auf ein Land, um die verfügbaren Bundesstaaten/Regionen für das optionale Feld state zu sehen.
| Code | Ländername (in location verwenden) | |
|---|---|---|
AD |
Andorra | |
AF |
Afghanistan | |
AG |
Antigua and Barbuda | |
AI |
Anguilla | |
AL |
Albania | |
AM |
Armenia | |
AN |
Netherlands Antilles | |
AO |
Angola | |
AQ |
Antarctica | |
AR |
Argentina | |
AS |
American Samoa | |
AT |
Austria | |
AU |
Australia | |
AW |
Aruba | |
AX |
Åland | |
AZ |
Azerbaijan | |
BA |
Bosnia and Herzegovina | |
BB |
Barbados | |
BD |
Bangladesh | |
BE |
Belgium | |
BF |
Burkina Faso | |
BG |
Bulgaria | |
BH |
Bahrain | |
BI |
Burundi | |
BJ |
Benin | |
BL |
Saint Barthélemy | |
BM |
Bermuda | |
BN |
Brunei | |
BO |
Bolivia | |
BQ |
Bonaire, Sint Eustatius and Saba | |
BR |
Brazil | |
BS |
Bahamas | |
BT |
Bhutan | |
BV |
Bouvet Island | |
BW |
Botswana | |
BY |
Belarus | |
BZ |
Belize | |
CA |
Canada | |
CC |
Cocos [Keeling] Islands | |
CD |
DR Congo | |
CF |
Central African Republic | |
CG |
Congo Republic | |
CH |
Switzerland | |
CI |
Ivory Coast | |
CK |
Cook Islands | |
CL |
Chile | |
CM |
Cameroon | |
CN |
China | |
CO |
Colombia | |
CR |
Costa Rica | |
CS |
Serbia and Montenegro | |
CU |
Cuba | |
CV |
Cabo Verde | |
CW |
Curaçao | |
CX |
Christmas Island | |
CY |
Cyprus | |
CZ |
Czechia | |
DE |
Germany | |
DJ |
Djibouti | |
DK |
Denmark | |
DM |
Dominica | |
DO |
Dominican Republic | |
DZ |
Algeria | |
EC |
Ecuador | |
EE |
Estonia | |
EG |
Egypt | |
EH |
Western Sahara | |
ER |
Eritrea | |
ES |
Spain | |
ET |
Ethiopia | |
FI |
Finland | |
FJ |
Fiji | |
FK |
Falkland Islands | |
FM |
Micronesia | |
FO |
Faroe Islands | |
FR |
France | |
GA |
Gabon | |
GB |
United Kingdom | |
GD |
Grenada | |
GE |
Georgia | |
GF |
French Guiana | |
GG |
Guernsey | |
GH |
Ghana | |
GI |
Gibraltar | |
GL |
Greenland | |
GM |
Gambia | |
GN |
Guinea | |
GP |
Guadeloupe | |
GQ |
Equatorial Guinea | |
GR |
Greece | |
GS |
South Georgia and South Sandwich Islands | |
GT |
Guatemala | |
GU |
Guam | |
GW |
Guinea-Bissau | |
GY |
Guyana | |
HK |
Hong Kong | |
HM |
Heard Island and McDonald Islands | |
HN |
Honduras | |
HR |
Croatia | |
HT |
Haiti | |
HU |
Hungary | |
ID |
Indonesia | |
IE |
Ireland | |
IL |
Israel | |
IM |
Isle of Man | |
IN |
India | |
IO |
British Indian Ocean Territory | |
IQ |
Iraq | |
IR |
Iran | |
IS |
Iceland | |
IT |
Italy | |
JE |
Jersey | |
JM |
Jamaica | |
JO |
Jordan | |
JP |
Japan | |
KE |
Kenya | |
KG |
Kyrgyzstan | |
KH |
Cambodia | |
KI |
Kiribati | |
KM |
Comoros | |
KN |
St Kitts and Nevis | |
KP |
North Korea | |
KR |
South Korea | |
KW |
Kuwait | |
KY |
Cayman Islands | |
KZ |
Kazakhstan | |
LA |
Laos | |
LB |
Lebanon | |
LC |
Saint Lucia | |
LI |
Liechtenstein | |
LK |
Sri Lanka | |
LR |
Liberia | |
LS |
Lesotho | |
LT |
Lithuania | |
LU |
Luxembourg | |
LV |
Latvia | |
LY |
Libya | |
MA |
Morocco | |
MC |
Monaco | |
MD |
Moldova | |
ME |
Montenegro | |
MF |
Saint Martin | |
MG |
Madagascar | |
MH |
Marshall Islands | |
MK |
North Macedonia | |
ML |
Mali | |
MM |
Myanmar | |
MN |
Mongolia | |
MO |
Macao | |
MP |
Northern Mariana Islands | |
MQ |
Martinique | |
MR |
Mauritania | |
MS |
Montserrat | |
MT |
Malta | |
MU |
Mauritius | |
MV |
Maldives | |
MW |
Malawi | |
MX |
Mexico | |
MY |
Malaysia | |
MZ |
Mozambique | |
NA |
Namibia | |
NC |
New Caledonia | |
NE |
Niger | |
NF |
Norfolk Island | |
NG |
Nigeria | |
NI |
Nicaragua | |
NL |
Netherlands | |
NO |
Norway | |
NP |
Nepal | |
NR |
Nauru | |
NU |
Niue | |
NZ |
New Zealand | |
OM |
Oman | |
PA |
Panama | |
PE |
Peru | |
PF |
French Polynesia | |
PG |
Papua New Guinea | |
PH |
Philippines | |
PK |
Pakistan | |
PL |
Poland | |
PM |
Saint Pierre and Miquelon | |
PN |
Pitcairn Islands | |
PR |
Puerto Rico | |
PS |
Palestine | |
PT |
Portugal | |
PW |
Palau | |
PY |
Paraguay | |
QA |
Qatar | |
RE |
Réunion | |
RO |
Romania | |
RS |
Serbia | |
RU |
Russia | |
RW |
Rwanda | |
SA |
Saudi Arabia | |
SB |
Solomon Islands | |
SC |
Seychelles | |
SD |
Sudan | |
SE |
Sweden | |
SG |
Singapore | |
SH |
Saint Helena | |
SI |
Slovenia | |
SJ |
Svalbard and Jan Mayen | |
SK |
Slovakia | |
SL |
Sierra Leone | |
SM |
San Marino | |
SN |
Senegal | |
SO |
Somalia | |
SR |
Suriname | |
SS |
South Sudan | |
ST |
São Tomé and Príncipe | |
SV |
El Salvador | |
SX |
Sint Maarten | |
SY |
Syria | |
SZ |
Eswatini | |
TC |
Turks and Caicos Islands | |
TD |
Chad | |
TF |
French Southern Territories | |
TG |
Togo | |
TH |
Thailand | |
TJ |
Tajikistan | |
TK |
Tokelau | |
TL |
Timor-Leste | |
TM |
Turkmenistan | |
TN |
Tunisia | |
TO |
Tonga | |
TR |
Turkey | |
TT |
Trinidad and Tobago | |
TV |
Tuvalu | |
TW |
Taiwan | |
TZ |
Tanzania | |
AE |
United Arab Emirates | |
UA |
Ukraine | |
UG |
Uganda | |
UM |
U.S. Minor Outlying Islands | |
US |
United States | |
UY |
Uruguay | |
UZ |
Uzbekistan | |
VA |
Vatican City | |
VC |
St Vincent and Grenadines | |
VE |
Venezuela | |
VG |
British Virgin Islands | |
VI |
U.S. Virgin Islands | |
VN |
Vietnam | |
VU |
Vanuatu | |
WF |
Wallis and Futuna | |
WS |
Samoa | |
XK |
Kosovo | |
YE |
Yemen | |
YT |
Mayotte | |
ZA |
South Africa | |
ZM |
Zambia | |
ZW |
Zimbabwe |
"geotarget": [
{"location": "Canada", "link": "https://example.ca"},
{"location": "United States", "link": "https://example.us", "state": "California"},
{"location": "United Kingdom", "link": "https://example.co.uk"}
]
https://linktw.in/api/urls?limit=2&page=1&order=date&collections=%5B1%2C2%5D
To get your links via the API, you can use this endpoint. You can also filter data (See table for more info). If your plan has a click limit, the response includes a usage object with your current click count, limit, and days until the billing period resets. This field is omitted for unlimited plans.
Missed clicks: The missedclicks field per link and missed_clicks in the usage object are only returned for free plan users (who have click limits).
Link status: status is active, upgrade_required (free plan, destination not on the approved list: upgrade to switch it on), needs_domain (switched off for adult, gambling or high-risk content, or a restricted destination, on a shared domain: it works on your own domain, see restriction and Move a Link to Your Domain) or disabled. restriction is null unless the status is needs_domain: reason (adult, gambling, high_risk, restricted_domain), offer (move: you have a branded domain, add: your plan includes branded domains, upgrade: it does not) and domains (your branded domains). type is the redirect mode as stored (direct, frame, splash, overlay-…), null when not set.
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
| order | (optional) Daten sortieren: date, date_desc, date_asc, clicks_desc, clicks_asc, name_asc, name_desc |
| search | (optional) Links nach Alias, benutzerdefiniertem Alias, URL, Meta-Titel, benutzerdefiniertem Titel oder Beschreibung suchen. Unterstützt die Erweiterung von Domänen-Aliasen (z. B. passt "youtube" zu youtube.com und youtu.be) |
| date_from | (optional) Nach Startdatum filtern (Format Y-m-d oder ISO 8601, z. B. 2025-01-01 oder 2025-01-01T00:00:00.000Z) |
| date_to | (optional) Nach Enddatum filtern (Format Y-m-d oder ISO 8601, z. B. 2025-01-31 oder 2025-01-31T23:59:59.999Z) |
| collections | (optional) Array von Collection-IDs oder -Namen zum Filtern von Links. Verwenden Sie entweder nur IDs oder nur Namen, nicht gemischt. Beispiel: [1,2,3] oder ["Marketing","Social Media"] |
| timezone | (optional) Zeitzone für Datumsfelder in der Antwort (z. B. America/New_York, Europe/London). Überschreibt die Zeitzoneneinstellung des Kontos. Standardmäßig UTC, wenn nicht angegeben. |
curl --location --request GET 'https://linktw.in/api/urls?limit=2&page=1&order=date&collections=%5B1%2C2%5D' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/urls?limit=2&page=1&order=date&collections=%5B1%2C2%5D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/urls?limit=2&page=1&order=date&collections=%5B1%2C2%5D',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"urls": [
{
"id": 2,
"alias": "google",
"shorturl": "https:\/\/linktw.in\/google",
"longurl": "https:\/\/google.com",
"clicks": 0,
"uniqueclicks": 0,
"title": "Google",
"description": "",
"display_title": "My Dashboard Title",
"custom_title": "My Custom Google Title",
"custom_description": "This is my custom description for Google",
"metaimage": "https:\/\/linktw.in\/content\/images\/AbCdEf_ai_GhIjKl.jpg",
"custom_preview": true,
"type": "direct",
"status": "active",
"restriction": null,
"collections": [
{
"id": 1,
"name": "Marketing",
"description": "All marketing campaign links",
"color": "#1E88E5"
},
{
"id": 3,
"name": "Social Media",
"description": "Social media platform links",
"color": "#43A047"
}
],
"pixels": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GTM-XXXXX"
},
{
"id": 2,
"type": "fbpixel",
"name": "Facebook Pixel",
"tag": "1234567890"
}
],
"date": "2023-11-10 18:01:43"
},
{
"id": 1,
"alias": "googlecanada",
"shorturl": "https:\/\/linktw.in\/googlecanada",
"longurl": "https:\/\/google.ca",
"clicks": 0,
"uniqueclicks": 0,
"title": "Google Canada",
"description": "",
"display_title": null,
"custom_title": null,
"custom_description": null,
"metaimage": null,
"custom_preview": false,
"type": null,
"status": "needs_domain",
"restriction": {
"reason": "adult",
"offer": "move",
"domains": [
"https:\/\/go.example.com"
]
},
"collections": [],
"pixels": [],
"date": "2023-11-10 18:00:25"
}
],
"usage": {
"clicks": 1250,
"clicks_limit": 50000,
"clicks_reset_days": 22
}
}
}
https://linktw.in/api/url/:id
To get details for a single link via the API, you can use this endpoint. You can pass either the link ID or the full short URL.kind is what the link does on click, the type the dashboard shows: music, podcast, store, sms, email, phone, whatsapp, deeplink or direct. type is the redirect mode as stored (direct, frame, splash, overlay-…), null when not set. music and store show the Smart Music Link and App Store Link settings; available says whether the link can use them (see Update Link). param_forwarding is the link's own parameter forwarding ({mode, names, tracking}), null when it follows the account setting. stock_monitor shows the Amazon Stock Monitor settings. available is true for an Amazon product link when the plan includes Stock Monitor and the account switch is on; otherwise the other fields are empty (null / 0). monitored says whether the link is checked right now, last_checked when it was last checked, used / cap how many products the account monitors out of its plan limit. action and suppressed_oos are the values in effect (the link's own, else the account's); account holds the account defaults, and account.enroll_mode manual means only links with monitor on are monitored.
Link status: status is active, upgrade_required (free plan, destination not on the approved list: upgrade to switch it on), needs_domain (switched off for adult, gambling or high-risk content, or a restricted destination, on a shared domain: it works on your own domain, see restriction and Move a Link to Your Domain) or disabled. restriction is null unless the status is needs_domain: reason (adult, gambling, high_risk, restricted_domain), offer (move: you have a branded domain, add: your plan includes branded domains, upgrade: it does not) and domains (your branded domains).
| Parameter | Beschreibung |
|---|---|
| :id | (erforderlich) Die Link-ID (z. B. 123) oder die vollständige Kurz-URL (z. B. https://linktw.in/abc123) |
| timezone | (optional) Zeitzone für Datumsfelder in der Antwort (z. B. America/New_York, Europe/London). Überschreibt die Zeitzoneneinstellung des Kontos. Standardmäßig UTC, wenn nicht angegeben. |
curl --location --request GET 'https://linktw.in/api/url/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/url/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/url/:id',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1,
"details": {
"id": 1,
"alias": "googlecanada",
"shorturl": "https:\/\/linktw.in\/googlecanada",
"longurl": "https:\/\/google.com",
"domain": "https:\/\/linktw.in",
"title": "Google",
"description": "",
"display_title": "My Dashboard Title",
"custom_title": "My Custom Title",
"custom_description": "My Custom Description",
"note": "Internal note for this link",
"pass": false,
"location": {
"canada": {
"all": "https:\/\/google.ca"
},
"united states": {
"CA": "https:\/\/google.us\/california",
"NY": "https:\/\/google.us\/newyork",
"all": "https:\/\/google.us"
}
},
"device": {
"iphone": "https:\/\/google.com",
"android": "https:\/\/google.com"
},
"languagetarget": {
"en": "https:\/\/google.com",
"fr": "https:\/\/google.ca"
},
"utmtarget": [
{
"param": "utm_source",
"value": "facebook",
"link": "https:\/\/example.com\/facebook-offer"
}
],
"parameters": {
"utm_source": "api",
"utm_medium": "link"
},
"expiry": "2025-12-31 23:59:59",
"clicklimit": 1000,
"expirationredirect": "https:\/\/example.com\/expired",
"abtesting": [
{
"percent": 50,
"link": "https:\/\/variant-a.com",
"count": 125
},
{
"percent": 50,
"link": "https:\/\/variant-b.com",
"count": 130
}
],
"metaimage": "https:\/\/linktw.in\/content\/images\/AbCdEf_ai_GhIjKl.jpg",
"date": "2023-11-10 18:01:43",
"kind": "deeplink",
"type": "direct",
"custom_preview": true,
"param_forwarding": null,
"stock_monitor": {
"available": false,
"monitored": false,
"monitor": "auto",
"action": null,
"alternatives": [],
"suppressed_oos": null,
"last_checked": null,
"used": 0,
"cap": 0,
"account": null
},
"music": {
"available": false,
"enabled": false,
"services": [],
"auto_open": null,
"title": null,
"artist": null,
"style": "list"
},
"store": {
"available": false,
"enabled": false,
"ios": null,
"android": null,
"huawei": null,
"mac": null,
"windows": null,
"chrome": null,
"fallback": null
},
"status": "active",
"restriction": null,
"collections": [
{
"id": 1,
"name": "Marketing",
"description": "All marketing campaign links",
"color": "#FF6B6B"
},
{
"id": 3,
"name": "Social Media",
"description": "Social media platform links",
"color": "#4ECDC4"
}
],
"pixels": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GTM-ABCDE"
},
{
"id": 2,
"type": "fbpixel",
"name": "Facebook Pixel",
"tag": "123456789012345"
}
]
},
"data": {
"clicks": 0,
"uniqueClicks": 0,
"missedClicks": 0,
"topCountries": 0,
"topReferrers": 0,
"topBrowsers": 0,
"topOs": 0,
"socialCount": {
"facebook": 0,
"twitter": 0,
"google": 0
}
}
}
https://linktw.in/api/url/add
To create a link, send your data as JSON (raw body, Content-Type: application/json) or as multipart/form-data (required when uploading an image file directly). The example below shows all available parameters — only url is required.
Restricted destinations: a link to a restricted destination (e.g. adult content platforms) on a shared domain fails with error_code: restricted_domain, plus offer (move, add or upgrade) and domains (your branded domains): use one of them as domain.
| Parameter | Beschreibung |
|---|---|
| url | (erforderlich) Lange URL zum Kürzen. |
| custom | (optional) Benutzerdefinierter Alias anstelle eines zufälligen Alias. |
| password | (optional) Passwortschutz |
| domain | (optional) Benutzerdefinierte Domäne (muss einer bereits hinzugefügten Branded-Domäne entsprechen) |
| expiry | (optional) Ablauf des Links, Beispiel: 2024-09-28 23:11:16 |
| clicklimit | (optional) Maximale Anzahl von Klicks, bevor der Link abläuft (Ganzzahl) |
| expirationredirect | (optional) URL, zu der nach Ablauf des Links weitergeleitet wird (nach Datum oder Klick-Limit) |
| note | (optional) Interne Notiz/Beschreibung für diesen Link (für Besucher nicht sichtbar) |
| display_title | (optional) Benutzerdefinierter Titel zur Organisation dieses Links in Ihrem Dashboard. Dieser dient nur als Referenz und hat keinen Einfluss auf og:title oder die Link-Vorschau. |
| geotarget | (optional) Geo-Targeting-Daten. Array von Objekten mit den Feldern location, link und optionalem state. Das Feld location muss ein vollständiger Ländername sein (z. B. "United States", "Canada"). Das optionale Feld state ermöglicht das Targeting eines bestimmten Bundesstaates/einer Region innerhalb des Landes (z. B. "California"). Vollständige Länder- und Bundesstaatenliste anzeigen. |
| devicetarget | (optional) Geräte-Targeting-Daten. Array von Objekten mit den Feldern device und link. |
| languagetarget | (optional) Sprach-Targeting-Daten. Array von Objekten mit den Feldern language und link. |
| utmtarget | (optional) UTM targeting data. Array of objects with param, value and link fields, checked in order: the first rule whose query parameter matches wins. |
| abtesting | (optional) A/B-Test-Varianten. Array von Objekten mit den Feldern link und optionalem percent. |
| parameters | (optional) Anzuhängende URL-Parameter. Array von Objekten mit den Feldern name und value. |
| metatitle | (optional) Meta-Titel |
| metadescription | (optional) Meta-Beschreibung |
| metaimage | (optional) Vorschaubild beim Teilen in sozialen Netzwerken (og:image). Zwei Formate werden akzeptiert: (1) JSON: Geben Sie eine öffentlich zugängliche URL an, die auf .jpg, .jpeg oder .png endet, z. B. "metaimage": "https://example.com/image.jpg"; (2) Datei-Upload: Senden Sie die Anfrage als multipart/form-data und fügen Sie die Bilddatei in einem Feld namens metaimage hinzu. Beide Formate erfordern JPG/JPEG oder PNG, max. 1 MB. |
| custompreview | (optional) Set to true to turn on the Social Media Preview switch without sending any custom title, description or image. The preview then uses the destination page's own title, description and image. Sending metatitle, metadescription or metaimage turns it on automatically. |
| pixels | (optional) Array von Pixel-IDs oder -Namen, die dem Link zugeordnet werden sollen. Verwenden Sie entweder nur IDs oder nur Namen, nicht gemischt. |
| collections | (optional) Array von Collection-IDs oder -Namen, zu denen der Link hinzugefügt werden soll. Verwenden Sie entweder nur IDs oder nur Namen, nicht gemischt. |
| bridge_override | (optional) Set to 1 to override the account-wide redirect (bridge) page settings for this link. When 0 or omitted, the link inherits your account defaults and the five fields below are ignored. Fields you leave out take your account default. |
| bridge_page | (optional, erfordert bridge_override=1) 1, um die Bridge-Seite ("Tap to Continue") anzuzeigen, 0, um sie auszublenden und schnell weiterzuleiten. |
| bridge_auto_redirect | (optional, erfordert bridge_override=1) 1 für eine automatische Weiterleitung nach einer Verzögerung, 0, damit der Besucher zum Fortfahren tippen muss. |
| bridge_redirect_delay | (optional, erfordert bridge_override=1) Verzögerung der automatischen Weiterleitung in Sekunden (1-30). |
| escape_inapp_browser | (optional, erfordert bridge_override=1) Wenn die Ziel-App nicht installiert ist: 1, um In-App-Browser (Facebook/Instagram/TikTok) zu verlassen und im externen Browser zu öffnen, 0, um im In-App-Browser zu bleiben. |
| bridge_lang | (optional, requires bridge_override=1) Language of the redirect page text ("Open in app" etc.): auto (each visitor's browser language, English if unsupported), en, es, de, fr, it, pt-BR, nl, sv, pl, tr, ru, id, vi, th, ja, zh, ko. Without an override the link follows the account setting in Link Settings (English unless changed). |
| param_forwarding | (optional) UTM / parameter forwarding for this link: which query parameters on the short link are passed on to the destination. Object: mode (all, off or custom), names (with custom: the parameter names to forward, a list or a comma-separated string; letters, digits, _ and -), tracking (with custom: true also forwards the common tracking parameters such as utm_*, gclid, fbclid). names and tracking only apply with mode custom. Left out, the link follows the account setting in Link Settings. custom with no usable name and tracking false is refused. |
curl --location --request POST 'https://linktw.in/api/url/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https:\/\/google.com",
"custom": "takeme-to-google",
"password": "mypass",
"expiry": "2023-11-11 12:00:00",
"clicklimit": 1000,
"expirationredirect": "https:\/\/example.com\/expired",
"note": "Internal campaign tracking note",
"display_title": "My Google Link",
"pixels": [
"My Facebook Pixel",
"My GTM Pixel"
],
"collections": [
"Marketing",
"Social Media"
],
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us",
"state": "California"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com\/iphone"
},
{
"device": "Android",
"link": "https:\/\/google.com\/android"
}
],
"languagetarget": [
{
"language": "en",
"link": "https:\/\/google.com"
},
{
"language": "fr",
"link": "https:\/\/google.ca"
}
],
"utmtarget": [
{
"param": "utm_source",
"value": "facebook",
"link": "https:\/\/example.com\/facebook-offer"
}
],
"abtesting": [
{
"link": "https:\/\/variant-a.example.com",
"percent": 50
},
{
"link": "https:\/\/variant-b.example.com",
"percent": 50
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"name": "gtm_source",
"value": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/url/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'url' => 'https://google.com',
'custom' => 'takeme-to-google',
'password' => 'mypass',
'expiry' => '2023-11-11 12:00:00',
'clicklimit' => 1000,
'expirationredirect' => 'https://example.com/expired',
'note' => 'Internal campaign tracking note',
'display_title' => 'My Google Link',
'pixels' =>
array(
0 => 'My Facebook Pixel',
1 => 'My GTM Pixel',
),
'collections' =>
array(
0 => 'Marketing',
1 => 'Social Media',
),
'metatitle' => 'Not Google',
'metadescription' => 'Not Google description',
'metaimage' => 'https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png',
'geotarget' =>
array(
0 =>
array(
'location' => 'Canada',
'link' => 'https://google.ca',
),
1 =>
array(
'location' => 'United States',
'link' => 'https://google.us',
'state' => 'California',
),
),
'devicetarget' =>
array(
0 =>
array(
'device' => 'iPhone',
'link' => 'https://google.com/iphone',
),
1 =>
array(
'device' => 'Android',
'link' => 'https://google.com/android',
),
),
'languagetarget' =>
array(
0 =>
array(
'language' => 'en',
'link' => 'https://google.com',
),
1 =>
array(
'language' => 'fr',
'link' => 'https://google.ca',
),
),
'utmtarget' =>
array(
0 =>
array(
'param' => 'utm_source',
'value' => 'facebook',
'link' => 'https://example.com/facebook-offer',
),
),
'abtesting' =>
array(
0 =>
array(
'link' => 'https://variant-a.example.com',
'percent' => 50,
),
1 =>
array(
'link' => 'https://variant-b.example.com',
'percent' => 50,
),
),
'parameters' =>
array(
0 =>
array(
'name' => 'aff',
'value' => '3',
),
1 =>
array(
'name' => 'gtm_source',
'value' => 'api',
),
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/url/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https:\/\/google.com",
"custom": "takeme-to-google",
"password": "mypass",
"expiry": "2023-11-11 12:00:00",
"clicklimit": 1000,
"expirationredirect": "https:\/\/example.com\/expired",
"note": "Internal campaign tracking note",
"display_title": "My Google Link",
"pixels": [
"My Facebook Pixel",
"My GTM Pixel"
],
"collections": [
"Marketing",
"Social Media"
],
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us",
"state": "California"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com\/iphone"
},
{
"device": "Android",
"link": "https:\/\/google.com\/android"
}
],
"languagetarget": [
{
"language": "en",
"link": "https:\/\/google.com"
},
{
"language": "fr",
"link": "https:\/\/google.ca"
}
],
"utmtarget": [
{
"param": "utm_source",
"value": "facebook",
"link": "https:\/\/example.com\/facebook-offer"
}
],
"abtesting": [
{
"link": "https:\/\/variant-a.example.com",
"percent": 50
},
{
"link": "https:\/\/variant-b.example.com",
"percent": 50
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"name": "gtm_source",
"value": "api"
}
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"shorturl": "https:\/\/linktw.in\/google",
"title": "Google",
"description": "Search the world's information..."
}
https://linktw.in/api/url/:id/update
PUT is the normal update method and must use application/json. POST is required only when you upload an actual image file: use multipart/form-data and attach it as metaimage. You may include the other update fields in that same multipart request; array fields must be JSON-encoded strings. Both methods support /api/url/:id/update for a numeric ID and /api/url/update/:id for a full short URL such as https://linktw.in/abc123. Only send fields you want to change — omitted fields remain unchanged. For array fields, sending the field replaces all existing values. Send null to clear a field, [] to remove all items from an array field; in a multipart request every value is a string, so send the literal text null or [].
Restricted destinations: a link to a restricted destination (e.g. adult content platforms) on a shared domain fails with error_code: restricted_domain, plus offer (move, add or upgrade) and domains (your branded domains): use one of them as domain. When an update makes an existing link restricted, the link is switched off and its status becomes needs_domain.
Die unten generierten Beispiele verwenden PUT + JSON. Für einen direkten Datei-Upload ändern Sie die Methode in POST, entfernen den JSON-Header Content-Type und verwenden multipart/form-data (zum Beispiel: -F "[email protected]").
| Parameter | Beschreibung |
|---|---|
| url | (optional) Lange URL, auf die aktualisiert werden soll |
| custom | (optional) Benutzerdefinierter Alias |
| password | (optional) Passwortschutz. Senden Sie null zum Entfernen. |
| domain | (optional) Benutzerdefinierte Domäne (muss einer bereits hinzugefügten Branded-Domäne entsprechen) |
| expiry | (optional) Ablauf des Links (z. B. 2024-09-28 23:11:16). Senden Sie null zum Entfernen. |
| clicklimit | (optional) Maximale Anzahl von Klicks, bevor der Link abläuft. Senden Sie null zum Entfernen. |
| expirationredirect | (optional) URL, zu der nach Ablauf des Links weitergeleitet wird. Senden Sie null zum Entfernen. |
| note | (optional) Interne Notiz/Beschreibung. Senden Sie null zum Entfernen. |
| display_title | (optional) Benutzerdefinierter Titel zur Dashboard-Organisation. Senden Sie null zum Entfernen. |
| geotarget | (optional) Geo-Targeting-Daten (vollständige Ersetzung). Array von Objekten mit den Feldern location, link und optionalem state. Senden Sie [], um alle zu löschen. Das Feld location muss ein vollständiger Ländername sein (z. B. "United States", "Canada"). Das optionale Feld state ermöglicht das Targeting eines bestimmten Bundesstaates/einer Region innerhalb des Landes (z. B. "California"). Vollständige Länder- und Bundesstaatenliste anzeigen. |
| devicetarget | (optional) Geräte-Targeting-Daten (vollständige Ersetzung). Array von Objekten mit den Feldern device und link. Senden Sie [], um alle zu löschen. |
| languagetarget | (optional) Sprach-Targeting-Daten (vollständige Ersetzung). Array von Objekten mit den Feldern language und link. Senden Sie [], um alle zu löschen. |
| utmtarget | (optional) UTM targeting data (full replacement, order kept). Array of objects with param, value and link fields. Omit to keep, send [] to clear all. |
| abtesting | (optional) A/B-Test-Varianten (vollständige Ersetzung). Array von Objekten mit den Feldern link und optionalem percent. Senden Sie [], um alle zu löschen. |
| parameters | (optional) URL-Parameter (vollständige Ersetzung). Array von Objekten mit den Feldern name und value. Senden Sie [], um alle zu löschen. |
| metatitle | (optional) Meta-Titel. Senden Sie null zum Entfernen. |
| metadescription | (optional) Meta-Beschreibung. Senden Sie null zum Entfernen. |
| metaimage | (optional) Social share preview image (og:image). With PUT + JSON, provide a publicly accessible .jpg, .jpeg, or .png URL, or send null to remove the uploaded image (with a custom title or description still set, the preview then uses the destination page's own image, as "Page image" does on the website). To upload image bytes directly, use POST + multipart/form-data and include the JPG/PNG file in the metaimage field (max 1MB). |
| custompreview | (optional) true turns the Social Media Preview switch on (the preview uses the destination page's own image when no custom image is set). false turns it off and removes the custom title, description and image. |
| pixels | (optional) Array von Pixel-IDs oder -Namen (vollständige Ersetzung). Senden Sie [], um alle Pixel zu entfernen. |
| collections | (optional) Array von Collection-IDs oder -Namen (vollständige Ersetzung). Senden Sie [], um aus allen Collections zu entfernen. |
| bridge_override | (optional) 1 to override the account-wide redirect (bridge) page settings for this link, 0 to go back to the account defaults. Omit to keep the current settings. With 1, the five fields below that you omit keep their current value. |
| bridge_page | (optional, with bridge_override=1) 1 to show the bridge page ("Tap to Continue"), 0 to hide it and redirect fast. |
| bridge_auto_redirect | (optional, with bridge_override=1) 1 to auto-redirect after a delay, 0 to require the visitor to tap to continue. |
| bridge_redirect_delay | (optional, with bridge_override=1) Auto-redirect delay in seconds (1-30). |
| escape_inapp_browser | (optional, with bridge_override=1) 1 to escape in-app browsers and open the external browser when the app is not installed, 0 to stay in the in-app browser. |
| bridge_lang | (optional, with bridge_override=1) Redirect page language: auto, en, es, de, fr, it, pt-BR, nl, sv, pl, tr, ru, id, vi, th, ja, zh, ko. |
| music | (optional) Smart Music Link, for links to a music or podcast platform (music.available in Get a Single Link). Object: services (list of platform URLs, e.g. Spotify, Apple Music, YouTube Music; first URL per platform, in display order), auto_open (a service key such as spotify, or null for the picker only), title, artist, style (list or icons). Keys left out keep their values; services left out keep the current platforms, or the link's own URL. null or {"enabled": false} switches it off. Fails when the plan does not include Music Link or its limit is reached. |
| store | (optional) App Store Link, for links to an app store listing (store.available in Get a Single Link): routes each visitor to their device's store. Object: ios, android, huawei (needs android), mac, windows, chrome (each a listing URL on that store), fallback (any URL, for other devices; dropped if it fails the security checks). Keys left out keep their values. null or {"enabled": false} switches it off. The store routing appears in device with source store; it is not part of devicetarget. |
| param_forwarding | (optional) UTM / parameter forwarding for this link: which query parameters on the short link are passed on to the destination. Object: mode (all, off or custom), names (with custom: the parameter names to forward, a list or a comma-separated string; letters, digits, _ and -), tracking (with custom: true also forwards the common tracking parameters such as utm_*, gclid, fbclid). names and tracking only apply with mode custom. Keys left out keep their values. null makes the link follow the account setting in Link Settings again. custom with no usable name and tracking false is refused. |
| stock_monitor | (optional) Amazon Stock Monitor for this link (stock_monitor.available in Get a Single Link: an Amazon product link, a plan with Stock Monitor and the account switch on in the affiliate settings). Object: monitor (auto: follows the account, newest links first; on: always monitored, pinned; off: never), action (if out of stock: none = dashboard dot only, notify = daily summary email, product = switch to a replacement from alternatives, auto = switch to a related product; null = account default), alternatives (Amazon product links, in order of preference; product needs at least one), suppressed_oos (true: "See All Buying Options" counts as out of stock; null = account default). Keys left out keep their values. null puts the link back on the account defaults. The plan sets how many products can be monitored; pinned links go first. A pin past that limit is saved but not monitored. When stock_monitor is sent, the response includes it (as in Get a Single Link), so monitored, used and cap show the result. |
curl --location --request PUT 'https://linktw.in/api/url/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"expiry": "2024-12-31 23:59:59",
"clicklimit": 500,
"expirationredirect": "https:\/\/example.com\/link-expired",
"note": "Updated campaign note",
"display_title": "Updated Dashboard Title",
"pixels": [
"My Facebook Pixel",
"My GTM Pixel"
],
"collections": [
"Marketing",
"Q4 Campaign"
],
"metatitle": "Updated Title",
"metadescription": "Updated description",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us",
"state": "New York"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com\/iphone"
},
{
"device": "Android",
"link": "https:\/\/google.com\/android"
}
],
"languagetarget": [
{
"language": "en",
"link": "https:\/\/google.com"
},
{
"language": "es",
"link": "https:\/\/google.es"
}
],
"abtesting": [
{
"link": "https:\/\/variant-a.example.com",
"percent": 70
},
{
"link": "https:\/\/variant-b.example.com",
"percent": 30
}
],
"parameters": [
{
"name": "utm_source",
"value": "api"
},
{
"name": "utm_campaign",
"value": "winter2024"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/url/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'url' => 'https://google.com',
'custom' => 'google',
'password' => 'mypass',
'expiry' => '2024-12-31 23:59:59',
'clicklimit' => 500,
'expirationredirect' => 'https://example.com/link-expired',
'note' => 'Updated campaign note',
'display_title' => 'Updated Dashboard Title',
'pixels' =>
array(
0 => 'My Facebook Pixel',
1 => 'My GTM Pixel',
),
'collections' =>
array(
0 => 'Marketing',
1 => 'Q4 Campaign',
),
'metatitle' => 'Updated Title',
'metadescription' => 'Updated description',
'geotarget' =>
array(
0 =>
array(
'location' => 'Canada',
'link' => 'https://google.ca',
),
1 =>
array(
'location' => 'United States',
'link' => 'https://google.us',
'state' => 'New York',
),
),
'devicetarget' =>
array(
0 =>
array(
'device' => 'iPhone',
'link' => 'https://google.com/iphone',
),
1 =>
array(
'device' => 'Android',
'link' => 'https://google.com/android',
),
),
'languagetarget' =>
array(
0 =>
array(
'language' => 'en',
'link' => 'https://google.com',
),
1 =>
array(
'language' => 'es',
'link' => 'https://google.es',
),
),
'abtesting' =>
array(
0 =>
array(
'link' => 'https://variant-a.example.com',
'percent' => 70,
),
1 =>
array(
'link' => 'https://variant-b.example.com',
'percent' => 30,
),
),
'parameters' =>
array(
0 =>
array(
'name' => 'utm_source',
'value' => 'api',
),
1 =>
array(
'name' => 'utm_campaign',
'value' => 'winter2024',
),
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linktw.in/api/url/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"expiry": "2024-12-31 23:59:59",
"clicklimit": 500,
"expirationredirect": "https:\/\/example.com\/link-expired",
"note": "Updated campaign note",
"display_title": "Updated Dashboard Title",
"pixels": [
"My Facebook Pixel",
"My GTM Pixel"
],
"collections": [
"Marketing",
"Q4 Campaign"
],
"metatitle": "Updated Title",
"metadescription": "Updated description",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us",
"state": "New York"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com\/iphone"
},
{
"device": "Android",
"link": "https:\/\/google.com\/android"
}
],
"languagetarget": [
{
"language": "en",
"link": "https:\/\/google.com"
},
{
"language": "es",
"link": "https:\/\/google.es"
}
],
"abtesting": [
{
"link": "https:\/\/variant-a.example.com",
"percent": 70
},
{
"link": "https:\/\/variant-b.example.com",
"percent": 30
}
],
"parameters": [
{
"name": "utm_source",
"value": "api"
},
{
"name": "utm_campaign",
"value": "winter2024"
}
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"shorturl": "https:\/\/linktw.in\/google",
"title": "Google",
"description": "Search the world's information..."
}
https://linktw.in/api/url/:id/delete
Um einen Link zu löschen, müssen Sie eine DELETE-Anfrage senden. Sie können entweder DELETE /api/url/:id/delete (für numerische IDs) oder DELETE /api/url/delete/:id (für numerische IDs und vollständige Kurz-URLs wie https://linktw.in/abc123) verwenden.
curl --location --request DELETE 'https://linktw.in/api/url/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/url/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linktw.in/api/url/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Link has been successfully deleted."
}
https://linktw.in/api/url/:id/move-domain
For links with the status needs_domain: links with adult, gambling or high-risk content, or to a restricted destination, are switched off on our shared domains but work on your own. This moves the link to one of your branded domains (restriction.domains) and switches it back on, like the Move button in the dashboard: status becomes active, or upgrade_required on the free plan when the destination is not on the approved list. The destination is checked again first. Refused with error 1 when the link is not needs_domain, when domain is not one of yours, or when the destination is now flagged. The short code stays when it is free on that domain, otherwise the link gets a new one (new_code: true). The old short URL stops working. Creating or updating a link to a restricted destination on a shared domain fails with error_code: restricted_domain, plus offer and domains.
| Parameter | Beschreibung |
|---|---|
| :id | (required) The link ID |
| domain | (optional) One of your branded domains, exactly as given in restriction.domains. Defaults to the first one. |
curl --location --request POST 'https://linktw.in/api/url/:id/move-domain' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "https:\/\/go.example.com"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/url/:id/move-domain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'domain' => 'https://go.example.com',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/url/:id/move-domain',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"domain": "https:\/\/go.example.com"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1,
"shorturl": "https:\/\/go.example.com\/googlecanada",
"domain": "https:\/\/go.example.com",
"new_code": false,
"status": "active",
"restriction": null
}
https://linktw.in/api/urls/delete
Mehrere Links in einer einzigen Anfrage löschen. Senden Sie ein Array von Link-IDs zum Löschen.
| Parameter | Beschreibung |
|---|---|
| ids | (erforderlich) Array von Link-IDs zum Löschen |
curl --location --request POST 'https://linktw.in/api/urls/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"ids": [
101,
102,
103
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/urls/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'ids' =>
array(
0 => 101,
1 => 102,
2 => 103,
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/urls/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"ids": [
101,
102,
103
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"deleted": [
101,
102,
103
],
"errors": []
}
https://linktw.in/api/domains?limit=2&page=1
Alle verfügbaren Domänen zum Kürzen von Links abrufen. Dies umfasst Standard-Domänen (von der Plattform bereitgestellt) und Ihre Branded- (benutzerdefinierten) Domänen. Verwenden Sie das Feld isStandard, um zwischen ihnen zu unterscheiden.
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite für Branded-Domänen |
| page | (optional) Aktuelle Seitenanfrage für Branded-Domänen |
curl --location --request GET 'https://linktw.in/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://linktw.in/api/domains?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/domains?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 4,
"perpage": 15,
"currentpage": 1,
"nextpage": null,
"maxpage": 1,
"domains": [
{
"id": "default",
"domain": "https:\/\/linktw.in",
"redirectroot": null,
"redirect404": null,
"isStandard": true
},
{
"id": "standard_abc123",
"domain": "https:\/\/short.link",
"redirectroot": null,
"redirect404": null,
"isStandard": true
},
{
"id": 1,
"domain": "https:\/\/mybrand.com",
"redirectroot": "https:\/\/mybrand.com\/home",
"redirect404": "https:\/\/mybrand.com\/404",
"isStandard": false
},
{
"id": 2,
"domain": "https:\/\/mycompany.io",
"redirectroot": "https:\/\/mycompany.io",
"redirect404": "https:\/\/mycompany.io\/not-found",
"isStandard": false
}
]
}
}
https://linktw.in/api/domain/add
Eine Domäne kann über diesen Endpoint hinzugefügt werden. Bitte stellen Sie sicher, dass die Domäne korrekt auf unseren Server zeigt.
| Parameter | Beschreibung |
|---|---|
| domain | (erforderlich) Branded-Domäne einschließlich http oder https |
| redirectroot | (optional) Root-Weiterleitung, wenn jemand Ihre Domäne besucht |
| redirect404 | (optional) Benutzerdefinierte 404-Weiterleitung |
curl --location --request POST 'https://linktw.in/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://linktw.in/api/domain/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'domain' => 'https://domain1.com',
'redirectroot' => 'https://rootdomain.com',
'redirect404' => 'https://rootdomain.com/404',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/domain/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1
}
https://linktw.in/api/domain/:id/update
Um eine Branded-Domäne zu aktualisieren, müssen Sie gültige Daten als JSON über eine PUT-Anfrage senden. Die Daten müssen als roher Body Ihrer Anfrage gesendet werden, wie unten gezeigt. Das folgende Beispiel zeigt alle Parameter, die Sie senden können, aber Sie müssen nicht alle senden (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| redirectroot | (optional) Root-Weiterleitung, wenn jemand Ihre Domäne besucht |
| redirect404 | (optional) Benutzerdefinierte 404-Weiterleitung |
curl --location --request PUT 'https://linktw.in/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://linktw.in/api/domain/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'redirectroot' => 'https://rootdomain-new.com',
'redirect404' => 'https://rootdomain-new.com/404',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linktw.in/api/domain/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Domain has been updated successfully."
}
https://linktw.in/api/domain/:id/delete
Um eine Domäne zu löschen, müssen Sie eine DELETE-Anfrage senden.
curl --location --request DELETE 'https://linktw.in/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/domain/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linktw.in/api/domain/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Domain has been deleted successfully."
}
https://linktw.in/api/pixels?limit=2&page=1
Um Ihre Pixel-Codes über die API abzurufen, können Sie diesen Endpoint verwenden. Sie können auch Daten filtern (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
curl --location --request GET 'https://linktw.in/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://linktw.in/api/pixels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/pixels?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"pixels": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GA-123456789",
"event": null,
"date": "2023-11-10 18:00:00"
},
{
"id": 2,
"type": "fbpixel",
"name": "Facebook Pixel",
"tag": "1234567890123456",
"event": "Lead",
"date": "2023-11-10 18:10:00"
}
]
}
}
https://linktw.in/api/pixel/add
Ein Pixel kann über diesen Endpoint erstellt werden. Sie müssen den Pixel-Typ und den Tag senden.
| Parameter | Beschreibung |
|---|---|
| type | (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok |
| name | (erforderlich) Benutzerdefinierter Name für Ihren Pixel |
| tag | (erforderlich) Der Tag für den Pixel |
| event | (optional, nur Facebook) Standard-Event, das bei jedem Linkklick zusätzlich zu PageView ausgelöst wird. Einer der Werte: Lead, CompleteRegistration, ViewContent, Search, AddToCart, AddToWishlist, InitiateCheckout, AddPaymentInfo, Purchase, Subscribe, StartTrial, Contact, Schedule, SubmitApplication, Donate. Standard: nur PageView. |
curl --location --request POST 'https://linktw.in/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "fbpixel",
"name": "My Facebook Pixel",
"tag": "1234567890123456",
"event": "Lead"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/pixel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'type' => 'fbpixel',
'name' => 'My Facebook Pixel',
'tag' => '1234567890123456',
'event' => 'Lead',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/pixel/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "fbpixel",
"name": "My Facebook Pixel",
"tag": "1234567890123456",
"event": "Lead"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1
}
https://linktw.in/api/pixel/:id/update
Um einen Pixel zu aktualisieren, müssen Sie gültige Daten als JSON über eine PUT-Anfrage senden. Die Daten müssen als roher Body Ihrer Anfrage gesendet werden, wie unten gezeigt. Das folgende Beispiel zeigt alle Parameter, die Sie senden können, aber Sie müssen nicht alle senden (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| name | (optional) Benutzerdefinierter Name für Ihren Pixel |
| tag | (erforderlich) Der Tag für den Pixel |
| event | (optional, nur Facebook) Standard-Event, das zusätzlich zu PageView ausgelöst wird. Senden Sie PageView (oder lassen Sie das Feld weg), wenn nur PageView ausgelöst werden soll. Die vollständige Liste der erlaubten Werte finden Sie unter "Einen Pixel erstellen". |
curl --location --request PUT 'https://linktw.in/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "My Facebook Pixel",
"tag": "1234567890123456",
"event": "Lead"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/pixel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'name' => 'My Facebook Pixel',
'tag' => '1234567890123456',
'event' => 'Lead',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linktw.in/api/pixel/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My Facebook Pixel",
"tag": "1234567890123456",
"event": "Lead"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Pixel has been updated successfully."
}
https://linktw.in/api/pixel/:id/delete
Um einen Pixel zu löschen, müssen Sie eine DELETE-Anfrage senden.
curl --location --request DELETE 'https://linktw.in/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/pixel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linktw.in/api/pixel/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Pixel has been deleted successfully."
}
https://linktw.in/api/pixel/:id?limit=15&page=1
Um einen einzelnen Pixel mit seinen zugewiesenen Links über die API abzurufen, können Sie diesen Endpoint verwenden. Gibt die Pixel-Details und eine paginierte Liste der Links zurück, denen dieser Pixel zugewiesen ist.
| Parameter | Beschreibung |
|---|---|
| :id | (erforderlich) Pixel-ID |
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
curl --location --request GET 'https://linktw.in/api/pixel/:id?limit=15&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/pixel/:id?limit=15&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/pixel/:id?limit=15&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"data": {
"result": 15,
"perpage": 15,
"currentpage": 1,
"nextpage": 2,
"maxpage": 3,
"pixel": {
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GTM-XXXXX",
"event": null,
"date": "2024-01-15 12:00:00"
},
"links": [
{
"id": 101,
"title": "Example Link",
"shorturl": "https:\/\/linktw.in\/abc123",
"longurl": "https:\/\/example.com",
"clicks": 150,
"date": "2024-01-10"
}
]
}
}
https://linktw.in/api/pixel/:id/links
Mehrere Links in einer einzigen Anfrage einem Pixel hinzufügen oder daraus entfernen. Senden Sie ein Array von Link-IDs zum Hinzufügen und/oder Entfernen.
| Parameter | Beschreibung |
|---|---|
| :id | (erforderlich) Pixel-ID |
| add | (optional) Array von Link-IDs, denen dieser Pixel hinzugefügt werden soll |
| remove | (optional) Array von Link-IDs, aus denen dieser Pixel entfernt werden soll |
curl --location --request POST 'https://linktw.in/api/pixel/:id/links' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"add": [
101,
102,
103
],
"remove": [
50,
51
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/pixel/:id/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'add' =>
array(
0 => 101,
1 => 102,
2 => 103,
),
'remove' =>
array(
0 => 50,
1 => 51,
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/pixel/:id/links',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"add": [
101,
102,
103
],
"remove": [
50,
51
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"pixel_id": 1,
"added": [
101,
102,
103
],
"removed": [
50,
51
],
"errors": []
}
https://linktw.in/api/qr?limit=2&page=1
Um Ihre QR-Codes über die API abzurufen, können Sie diesen Endpoint verwenden. Sie können auch Daten filtern (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
curl --location --request GET 'https://linktw.in/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://linktw.in/api/qr?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/qr?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"qrs": [
{
"id": 2,
"link": "https:\/\/linktw.in\/qr\/a2d5e",
"scans": 0,
"name": "Google",
"date": "2023-11-10 18:01:43"
},
{
"id": 1,
"link": "https:\/\/linktw.in\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2023-11-10 18:00:25"
}
]
}
}
https://linktw.in/api/qr/:id
Um Details zu einem einzelnen QR-Code über die API abzurufen, können Sie diesen Endpoint verwenden.
curl --location --request GET 'https://linktw.in/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/qr/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/qr/:id',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"details": {
"id": 1,
"link": "https:\/\/linktw.in\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2023-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
}
}
}
https://linktw.in/api/qr/add
Um einen QR-Code zu erstellen, müssen Sie gültige Daten als JSON über eine POST-Anfrage senden. Die Daten müssen als roher Body Ihrer Anfrage gesendet werden, wie unten gezeigt. Das folgende Beispiel zeigt alle Parameter, die Sie senden können, aber Sie müssen nicht alle senden (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| type | (erforderlich) text | vcard | link | email | phone | sms | wifi |
| data | (erforderlich) In den QR-Code einzubettende Daten. Die Daten können je nach Typ eine Zeichenkette oder ein Array sein |
| background | (optional) RGB-Farbe, z. B. rgb(255,255,255) |
| foreground | (optional) RGB-Farbe, z. B. rgb(0,0,0) |
| logo | (optional) Pfad zum Logo im Format png oder jpg |
curl --location --request POST 'https://linktw.in/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://linktw.in/api/qr/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'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;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/qr/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"link": "https:\/\/linktw.in\/qr\/a58f79"
}
https://linktw.in/api/qr/:id/update
Um einen QR-Code zu aktualisieren, müssen Sie gültige Daten als JSON über eine PUT-Anfrage senden. Die Daten müssen als roher Body Ihrer Anfrage gesendet werden, wie unten gezeigt. Das folgende Beispiel zeigt alle Parameter, die Sie senden können, aber Sie müssen nicht alle senden (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| data | (erforderlich) In den QR-Code einzubettende Daten. Die Daten können je nach Typ eine Zeichenkette oder ein Array sein |
| background | (optional) RGB-Farbe, z. B. rgb(255,255,255) |
| foreground | (optional) RGB-Farbe, z. B. rgb(0,0,0) |
| logo | (optional) Pfad zum Logo im Format png oder jpg |
curl --location --request PUT 'https://linktw.in/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://linktw.in/api/qr/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'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;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linktw.in/api/qr/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "QR has been updated successfully."
}
https://linktw.in/api/qr/:id/delete
Um einen QR-Code zu löschen, müssen Sie eine DELETE-Anfrage senden.
curl --location --request DELETE 'https://linktw.in/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/qr/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linktw.in/api/qr/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "QR Code has been deleted successfully."
}
https://linktw.in/api/collections?limit=2&page=1
Um Ihre Collections über die API abzurufen, können Sie diesen Endpoint verwenden. Sie können auch Daten filtern (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
curl --location --request GET 'https://linktw.in/api/collections?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collections?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/collections?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"collections": [
{
"id": 1,
"name": "Social Media",
"description": "All social media links",
"color": "#1E88E5",
"public": false,
"rotator": false,
"list": "https:\/\/domain.com\/u\/admin\/social-media-1",
"starred": true,
"views": 150,
"clicks": 5420
},
{
"id": 2,
"name": "Marketing Campaign",
"description": "Q4 Marketing Campaign",
"color": "#00897B",
"public": true,
"rotator": "https:\/\/domain.com\/r\/marketing-campaign",
"list": "https:\/\/domain.com\/u\/admin\/marketing-campaign-2",
"starred": false,
"views": 300,
"clicks": 12580
}
]
}
}
https://linktw.in/api/collection/:id?limit=1&page=1
Um Elemente in einer ausgewählten Collection über die API abzurufen, können Sie diesen Endpoint verwenden. Sie können auch Daten filtern (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| limit | (optional) Ergebnisse pro Seite |
| page | (optional) Aktuelle Seitenanfrage |
curl --location --request GET 'https://linktw.in/api/collection/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/:id?limit=1&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linktw.in/api/collection/:id?limit=1&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"items": [
{
"type": "links",
"id": 1,
"title": "My Sample Link",
"preview": "https:\/\/google.com",
"link": "https:\/\/linktw.in\/google",
"date": "2024-05-12"
},
{
"type": "bio",
"id": 1,
"title": "My Sample Bio",
"preview": "https:\/\/linktw.in\/mybio",
"link": "https:\/\/linktw.in\/mybio",
"date": "2024-06-01"
},
{
"type": "qr",
"id": 1,
"title": "My QR Code",
"preview": "https:\/\/example.com",
"link": "https:\/\/linktw.in\/qr\/1",
"date": "2024-06-15"
}
]
}
}
https://linktw.in/api/collection/add
Eine Collection kann über diesen Endpoint hinzugefügt werden.
| Parameter | Beschreibung |
|---|---|
| name | (erforderlich) Collection-Name |
| slug | (optional) Rotator-Slug |
| description | (optional) Collection-Beschreibung |
| color | (optional) Badge-Farbe der Collection (HEX) |
| public | (optional) Zugriff (true oder false) |
| starred | (optional) Collection als Favorit markieren oder nicht (true oder false) |
curl --location --request POST 'https://linktw.in/api/collection/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "NewCollection",
"slug": "new-collection",
"description": "My new collection",
"color": "#1E88E5",
"public": true,
"starred": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'name' => 'NewCollection',
'slug' => 'new-collection',
'description' => 'My new collection',
'color' => '#1E88E5',
'public' => true,
'starred' => true,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/collection/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "NewCollection",
"slug": "new-collection",
"description": "My new collection",
"color": "#1E88E5",
"public": true,
"starred": true
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"name": "New Collection",
"public": true,
"rotator": "https:\/\/domain.com\/r\/new-collection",
"list": "https:\/\/domain.com\/u\/admin\/new-collection-3"
}
https://linktw.in/api/collection/:collectionid/assign/:itemid
Ein Link kann einer beliebigen Collection zugewiesen werden, indem eine Anfrage mit der Collection-ID und der Link-ID gesendet wird.
| Parameter | Beschreibung |
|---|---|
| :collectionid | (erforderlich) Collection-ID |
| :itemid | (erforderlich) Link-ID |
curl --location --request POST 'https://linktw.in/api/collection/:collectionid/assign/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/:collectionid/assign/:itemid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/collection/:collectionid/assign/:itemid',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Link successfully added to the collection."
}
https://linktw.in/api/collection/:id/links
Mehrere Links in einer einzigen Anfrage einer Collection hinzufügen oder daraus entfernen. Senden Sie ein Array von Link-IDs zum Hinzufügen und/oder Entfernen.
| Parameter | Beschreibung |
|---|---|
| :id | (erforderlich) Collection-ID |
| add | (optional) Array von Link-IDs, die der Collection hinzugefügt werden sollen |
| remove | (optional) Array von Link-IDs, die aus der Collection entfernt werden sollen |
curl --location --request POST 'https://linktw.in/api/collection/:id/links' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"add": [
101,
102,
103
],
"remove": [
50,
51
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/:id/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'add' =>
array(
0 => 101,
1 => 102,
2 => 103,
),
'remove' =>
array(
0 => 50,
1 => 51,
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linktw.in/api/collection/:id/links',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"add": [
101,
102,
103
],
"remove": [
50,
51
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"collection_id": 5,
"added": [
101,
102,
103
],
"removed": [
50,
51
],
"errors": []
}
https://linktw.in/api/collection/:id/update
Um eine Collection zu aktualisieren, müssen Sie gültige Daten als JSON über eine PUT-Anfrage senden. Die Daten müssen als roher Body Ihrer Anfrage gesendet werden, wie unten gezeigt. Das folgende Beispiel zeigt alle Parameter, die Sie senden können, aber Sie müssen nicht alle senden (siehe Tabelle für weitere Informationen).
| Parameter | Beschreibung |
|---|---|
| name | (optional) Collection-Name |
| slug | (optional) Rotator-Slug |
| description | (optional) Collection-Beschreibung |
| color | (optional) Badge-Farbe der Collection (HEX) |
| public | (optional) Zugriff (true oder false) |
| starred | (optional) Collection als Favorit markieren oder nicht (true oder false) |
curl --location --request PUT 'https://linktw.in/api/collection/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Updated Collection",
"description": "Updated collection description",
"color": "#FF5722",
"public": false,
"starred": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(array(
'name' => 'Updated Collection',
'description' => 'Updated collection description',
'color' => '#FF5722',
'public' => false,
'starred' => true,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linktw.in/api/collection/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Updated Collection",
"description": "Updated collection description",
"color": "#FF5722",
"public": false,
"starred": true
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Collection has been updated successfully."
}
https://linktw.in/api/collection/:id/delete
Um eine Collection zu löschen, müssen Sie eine DELETE-Anfrage senden. Alle Elemente werden ebenfalls aus der Zuweisung entfernt.
curl --location --request DELETE 'https://linktw.in/api/collection/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linktw.in/api/collection/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linktw.in/api/collection/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Collection has been deleted successfully."
}