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
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the related portfolio object |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results to return per page |
| offset | integer | 0 | Number of results to skip before returning results |
| search | string | — | Search term to lookup results by `id`, `name`, `url` |
| ordering | string | order, -created_at | Order results by (`id`, `name`, `created_at`, `updated_at`) |
| id_min | integer | — | Minimum ID filter |
| id_max | integer | — | Maximum ID filter |
| created_date | string | — | Filter by creation date (e.g., 2023-01-01) |
| updated_date | string | — | Filter by last updated date (e.g., 2023-01-01) |
| created_from | string | — | Filter by creation date range start |
| created_to | string | — | Filter by creation date range end |
| updated_from | string | — | Filter by last updated date range start |
| updated_to | string | — | Filter by last updated date range end |
| has_image | boolean | — | Filter links with/without image |
| has_description | boolean | - | Filter links with/without description |
| has_url | boolean | - | Filter links with/without url |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1# List all links
2curl "http://www.example.com/api/portfolios/2/links/" -H "Authorization: Token <your_api_key>"
3
4# Search with filters
5curl "http://www.example.com/api/portfolios/2/links?search=github&has_image=true&limit=20" \
6-H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of PortfolioLink objects |
PortfolioLink Object Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the portfolio link |
| name | String | Portfolio link name (not unique) |
| url | URLField | URL related to the link(nullable) |
| image_data | Object | Portfolio link image details (nullable) |
| description | String | The description of the link (nullable) |
| created_at | String (ISO 8601) | Timestamp when link was created |
| updated_at | String (ISO 8601) | Timestamp when link was last updated |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File 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"
}
]
}