GET
/api/v2/clients/{client_id}/portfoliosGet client portfolios
Code samples
# You can also use wget
curl -X GET /api/v2/clients/{client_id}/portfolios \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v2/clients/{client_id}/portfolios HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v2/clients/{client_id}/portfolios',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/api/v2/clients/{client_id}/portfolios',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v2/clients/{client_id}/portfolios', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/clients/{client_id}/portfolios', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/clients/{client_id}/portfolios");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/clients/{client_id}/portfolios", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/clients/{client_id}/portfolios
Retrieves portfolios for a specific client with optional filtering
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| client_id | path | integer | true | ID of the client |
| portfolio_id | query | integer | false | Filter by specific portfolio ID |
| only_combine | query | boolean | false | Filter only combined portfolios |
Example responses
200 Response
{
"status": "success",
"code": 200,
"message": "Portfolios retrieved successfully",
"details": [
{
"id": 1,
"name": "Main Portfolio",
"isCombine": true,
"folderIds": "1,2,3",
"projectIds": "4,5,6",
"projects": [
{
"id": 123,
"versionId": 5,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "Project X",
"description": "Project description notes",
"start": "2023-01-15T09:00:00",
"finish": "2023-12-31T17:00:00",
"code": "PRJ-X-2023",
"customer": "Acme Corporation",
"category": "Construction",
"priority": 1.5,
"status": "In Progress",
"path": "/Projects/2023/Project X",
"folderId": 42,
"createdAt": "2022-12-01T08:30:00",
"createdUserId": 7,
"createdUserName": "John Doe",
"lockAt": "2023-02-01T10:15:00",
"lockUserId": 8,
"lockUserName": "Jane Smith",
"notes": "Special handling required",
"isTemplate": false,
"isReadOnly": true
}
],
"lockEnable": true,
"projectCount": 3
}
]
}
400 Response
{
"status": "error",
"code": 400,
"message": "Invalid request",
"details": "Validation error"
}
401 Response
{
"status": "error",
"code": 401,
"message": "Authentication failed",
"details": "JWT token not found"
}
403 Response
{
"status": "error",
"code": 403,
"message": "Access denied",
"details": "Insufficient permissions"
}
500 Response
{
"status": "error",
"code": 500,
"message": "Internal server error",
"details": "An internal server error occurred"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Invalid request or missing required parameters | ErrorResponse |
| 401 | Unauthorized | Authentication error (JWT token missing/invalid) | ErrorResponse |
| 403 | Forbidden | Access denied (insufficient permissions) | ErrorResponse |
| 500 | Internal Server Error | Internal server error | ErrorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | false | none | none |
| » code | integer | false | none | none |
| » message | string | false | none | none |
| » details | [PortfolioItem] | false | none | none |
| »» id | integer | true | none | Unique portfolio ID |
| »» name | string | true | none | Portfolio name |
| »» isCombine | boolean | true | none | Whether the portfolio is combined |
| »» folderIds | string | true | none | Comma-separated list of folder IDs in the portfolio |
| »» projectIds | string | true | none | Comma-separated list of project IDs in the portfolio |
| »» projects | [ProjectItem] | false | none | List of included projects |
| »»» id | integer | true | none | Unique project ID |
| »»» versionId | integer | true | none | Version identifier |
| »»» uuid | string(uuid) | true | none | Unique universal identifier |
| »»» name | string | true | none | Project name |
| »»» description | string¦null | false | none | Detailed project description |
| »»» start | string(date-time) | false | none | Project start date/time |
| »»» finish | string(date-time) | false | none | Project end date/time |
| »»» code | string¦null | false | none | Project code/short identifier |
| »»» customer | string¦null | false | none | Customer name |
| »»» category | string¦null | false | none | Project category |
| »»» priority | number(float) | false | none | Project priority level |
| »»» status | string | false | none | Current project status |
| »»» path | string | true | none | Full virtual path of the project |
| »»» folderId | integer | true | none | Parent folder ID |
| »»» createdAt | string(date-time) | true | none | Creation timestamp |
| »»» createdUserId | integer | true | none | ID of the creating user (-1 if unknown) |
| »»» createdUserName | string | true | none | Name of the creating user |
| »»» lockAt | string(date-time)¦null | false | none | Timestamp when project was locked (empty if not locked) |
| »»» lockUserId | integer | false | none | ID of the user who locked the project (-1 if not locked) |
| »»» lockUserName | string | false | none | Name of the user who locked the project |
| »»» notes | string¦null | false | none | Additional project notes |
| »»» isTemplate | boolean | true | none | Whether this is a template project |
| »»» isReadOnly | boolean | true | none | Whether the project is read-only for current user |
| »» lockEnable | boolean | true | none | Indicates whether the portfolio can be locked |
| »» projectCount | integer | true | none | Number of projects in the portfolio |
