المطورين

ملاحظات
The API key should be sent as a Bearer token in the Authorization header of the request. احصل على مفتاح API .
List

List all links.

API endpoint:

GET
http://url.clever.ps/api/v1/links

Request example:

curl --location --request GET 'http://url.clever.ps/api/v1/links' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Show

Get a link's details.

API endpoint:

GET
http://url.clever.ps/api/v1/links/{id}

Request example:

curl --location --request GET 'http://url.clever.ps/api/v1/links/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Store

إنشاء رابط.

API endpoint:

POST
http://url.clever.ps/api/v1/links

Request example:

curl --location --request POST 'http://url.clever.ps/api/v1/links' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
النوع
الوصف
url
مطلوب string
الرابط المطلوب اختصاره.
alias
اختياري string
The link alias.
password
اختياري string
كلمة مرور لرابط.
space
اختياري integer
The space id the link to be saved under.
domain
اختياري integer
The domain id the link to be saved under.
disabled
اختياري integer
Whether the link is disabled or not, defaults to 0.
public
اختياري integer
Whether the link stats are public or not, defaults to 0.
expiration_url
اختياري string
The link where the user will be redirected once the link has expired.
expiration_date
اختياري string
The link expiration date in YYYY-MM-DD format.
expiration_time
اختياري string
The link expiration time in HH:MM format.
expiration_clicks
اختياري integer
The number of clicks after which the link should expire.
target_type
اختياري integer
The type of targeting, the possible values are: 0 لـ لا شيء, 1 لـ المنطقة الجغرافية, 2 لـ المنصة, 3 لـ Rotation.
geo[index][key]
اختياري string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
geo[index][value]
اختياري string
The country link where the user will be redirected to.
platform[index][key]
اختياري string
The name of the targeted platform. Possible values are iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
اختياري string
The platform link where the user will be redirected to.
rotation[index][value]
اختياري string
The rotation link where the user will be redirected to.
Update

تحديث الرابط.

API endpoint:

PUT PATCH
http://url.clever.ps/api/v1/links/{id}

Request example:

curl --location --request PUT 'http://url.clever.ps/api/v1/links/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
النوع
الوصف
url
اختياري string
الرابط المطلوب اختصاره.
alias
اختياري string
The link alias.
password
اختياري string
كلمة مرور لرابط.
space
اختياري integer
The space id the link to be saved under.
domain
اختياري integer
The domain id the link to be saved under.
disabled
اختياري integer
Whether the link is disabled or not, defaults to 0.
public
اختياري integer
Whether the link stats are public or not, defaults to 0.
expiration_url
اختياري string
The link where the user will be redirected once the link has expired.
expiration_date
اختياري string
The link expiration date in YYYY-MM-DD format.
expiration_time
اختياري string
The link expiration time in HH:MM format.
expiration_clicks
اختياري integer
The number of clicks after which the link should expire.
target_type
اختياري integer
The type of targeting, the possible values are: 0 لـ لا شيء, 1 لـ المنطقة الجغرافية, 2 لـ المنصة, 3 لـ Rotation.
geo[index][key]
اختياري string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
geo[index][value]
اختياري string
The country link where the user will be redirected to.
platform[index][key]
اختياري string
The name of the targeted platform. Possible values are iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
اختياري string
The platform link where the user will be redirected to.
rotation[index][value]
اختياري string
The rotation link where the user will be redirected to.
حذف

حذف الرابط.

API endpoint:

DELETE
http://url.clever.ps/api/v1/links/{id}

Request example:

curl --location --request DELETE 'http://url.clever.ps/api/v1/links/{id}' \
--header 'Authorization: Bearer {api_key}'