Skip to main content

List Portfolio Links

Retrieves a list of all Portfolio links with filtering, searching, and ordering capabilities.

HTTP Request

GET/api/portfolios/:id/links/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO AN EXTRA REDIRECT WITH 301 STATUS

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with PorfolioLinkPermission or Admin
  • Permission Code: 4242
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the related portfolio object

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results to return per page
offsetinteger0Number of results to skip before returning results
searchstringSearch term to lookup results by `id`, `name`, `url`
orderingstringorder, -created_atOrder results by (`id`, `name`, `created_at`, `updated_at`)
id_minintegerMinimum ID filter
id_maxintegerMaximum ID filter
created_datestringFilter by creation date (e.g., 2023-01-01)
updated_datestringFilter by last updated date (e.g., 2023-01-01)
created_fromstringFilter by creation date range start
created_tostringFilter by creation date range end
updated_fromstringFilter by last updated date range start
updated_tostringFilter by last updated date range end
has_imagebooleanFilter links with/without image
has_descriptionboolean-Filter links with/without description
has_urlboolean-Filter links with/without url

Example Requests

1import requests
2
3# List all links
4response = requests.get('http://www.example.com/api/portfolios/2/links/', 
5  headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Search for links with filters
10response = requests.get('http://www.example.com/api/portfolios/2/links', params={
11  'search': 'github',
12  'has_image': True,
13  'limit': 20
14}, headers={'Authorization': 'Token <your_api_key>'})
15print(response.json())

Response Fields

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of PortfolioLink objects

PortfolioLink Object Structure

FieldTypeDescription
idIntegerUnique ID of the portfolio link
nameStringPortfolio link name (not unique)
urlURLFieldURL related to the link(nullable)
image_dataObjectPortfolio link image details (nullable)
descriptionStringThe description of the link (nullable)
created_atString (ISO 8601)Timestamp when link was created
updated_atString (ISO 8601)Timestamp when link was last updated

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)
thumbnailsList of thumbnail objectsImgae thumbnails

Thumbnail Data Structure

FieldTypeDescription
idIntegerUnique ID of the thumbnail (unique)
fStringURL to access the thumbnail file
sizeIntegerFile size in bytes (nullable)

Example Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"name": "github",
"url": "https://github.com/somewhere2",
"image_data": {
"id": 8,
"type": "image",
"name": "پیک موتوری",
"size": 808754,
"human_readable_size": "789.80 KB",
"f": "http://localhost:8000/media/core_media/2025/12/20/Fantasticheskie_kartinki_dlja_monitora_68_63.jpg",
"width": 1920,
"height": 1080,
"mode": "RGB",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
"description": "",
"created_at": "2026-01-12T16:43:37.941799Z",
"updated_at": "2026-01-12T16:43:37.941805Z"
},
{
"id": 1,
"name": "github",
"url": "https://github.com/somewhere",
"image_data": null,
"description": "این لینک پروژه است",
"created_at": "2026-01-12T15:36:59.697309Z",
"updated_at": "2026-01-12T15:46:16.971203Z"
}
]
}