لینک ها

یادداشت ها
Expert level
The API key should be sent as a Bearer token in the Authorization header of the request. Get your API key.
لیست

API endpoint:

GET
https://links.pkso.ir/api/v1/links

درخواست نمونه:

curl --location --request GET 'https://links.pkso.ir/api/v1/links' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Parameter
نوع
توضیحات
search
اختیاری string
The search query.
search_by
اختیاری string
جستجو. مقادیر ممکن عبارتند از: title for عنوان, alias for Alias, url for URL. Defaults to: title.
status
اختیاری integer
Filter by status. مقادیر ممکن عبارتند از: 0 for همه, 1 for فعال, 2 for منقضی, 3 for غیرفعال. Defaults to: 0.
space_id
اختیاری integer
Filter by space ID.
domain_id
اختیاری integer
Filter by domain ID.
pixel_id
اختیاری integer
Filter by pixel ID.
sort_by
اختیاری string
ترتیب . مقادیر ممکن عبارتند از: id for تاریخ ایجاد, clicks for کلیک ها, title for عنوان, alias for Alias, url for URL. Defaults to: id.
sort
اختیاری string
مرتب سازی. مقادیر ممکن عبارتند از: desc for نزولی, asc for صعودی. Defaults to: desc.
per_page
اختیاری int
نتایج در هر صفحه. مقادیر ممکن عبارتند از: 10, 25, 50, 100. Defaults to: 10.
نمایش

API endpoint:

GET
https://links.pkso.ir/api/v1/links/{id}

درخواست نمونه:

curl --location --request GET 'https://links.pkso.ir/api/v1/links/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
فروشگاه

API endpoint:

POST
https://links.pkso.ir/api/v1/links

درخواست نمونه:

curl --location --request POST 'https://links.pkso.ir/api/v1/links' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}' \
--data-urlencode 'domain={id}'
Parameter
نوع
توضیحات
url
ضروری string
The link to be shortened.
domain_id
ضروری integer
The domain ID the link to be saved under.
alias
اختیاری string
The link alias.
password
اختیاری string
The link password.
space_id
اختیاری integer
The space ID the link to be saved under.
pixel_ids
اختیاری array
The pixel IDs to be integrated in the link.
disabled
اختیاری integer
Whether the link is disabled or not. مقادیر ممکن عبارتند از: 0 for فعال, 1 for غیرفعال. Defaults to: 0.
privacy
اختیاری integer
Whether the link stats are public or not. مقادیر ممکن عبارتند از: 0 for عمومی, 1 for خصوصی, 2 for رمز عبور. Defaults to: 0.
privacy_password
اختیاری string
The password for the statistics page. Only works with privacy set to 2.
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. مقادیر ممکن عبارتند از: 0 for هیچ, 1 for جغرافیایی, 2 for پلتفرم, 4 for چرخش.
country[index][key]
اختیاری string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
country[index][value]
اختیاری string
The link where the user will be redirected to.
platform[index][key]
اختیاری string
The name of the targeted platform. مقادیر ممکن عبارتند از: iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
اختیاری string
The link where the user will be redirected to.
language[index][key]
اختیاری string
The code of the targeted language. The code must be in ISO 639-1 alpha-2 standard.
language[index][value]
اختیاری string
The link where the user will be redirected to.
rotation[index][value]
اختیاری string
The link where the user will be redirected to.
بروزرسانی

API endpoint:

PUT PATCH
https://links.pkso.ir/api/v1/links/{id}

درخواست نمونه:

curl --location --request PUT 'https://links.pkso.ir/api/v1/links/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
نوع
توضیحات
url
اختیاری string
The link to be shortened.
alias
اختیاری string
The link alias.
password
اختیاری string
The link password.
space_id
اختیاری integer
The space ID the link to be saved under.
pixel_ids
اختیاری array
The pixel IDs to be integrated in the link.
disabled
اختیاری integer
Whether the link is disabled or not. مقادیر ممکن عبارتند از: 0 for فعال, 1 for غیرفعال.
privacy
اختیاری integer
Whether the link stats are public or not. مقادیر ممکن عبارتند از: 0 for عمومی, 1 for خصوصی, 2 for رمز عبور.
privacy_password
اختیاری string
The password for the statistics page. Only works with privacy set to 2.
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. مقادیر ممکن عبارتند از: 0 for هیچ, 1 for جغرافیایی, 2 for پلتفرم, 4 for چرخش.
country[index][key]
اختیاری string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
country[index][value]
اختیاری string
The link where the user will be redirected to.
platform[index][key]
اختیاری string
The name of the targeted platform. مقادیر ممکن عبارتند از: iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
اختیاری string
The link where the user will be redirected to.
language[index][key]
اختیاری string
The code of the targeted language. The code must be in ISO 639-1 alpha-2 standard.
language[index][value]
اختیاری string
The link where the user will be redirected to.
rotation[index][value]
اختیاری string
The link where the user will be redirected to.
حذف

API endpoint:

DELETE
https://links.pkso.ir/api/v1/links/{id}

درخواست نمونه:

curl --location --request DELETE 'https://links.pkso.ir/api/v1/links/{id}' \
--header 'Authorization: Bearer {api_key}'