Trendsic Platform Service

<back to all web services

PmProjectsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/pm/projects
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmProjectRow:
    project_i_d: int = 0
    project_u_i_d: Optional[str] = None
    name: Optional[str] = None
    client: Optional[str] = None
    project_type: Optional[str] = None
    status: Optional[str] = None
    branch: Optional[str] = None
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    budget: float = 0.0
    spent: float = 0.0
    estimated_cost: float = 0.0
    health_pct: int = 0
    job_count: int = 0
    open_jobs: int = 0
    gap_count: int = 0
    over_budget: bool = False
    progress_pct: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmPortfolioTotals:
    projects: int = 0
    budget: float = 0.0
    spent: float = 0.0
    over_budget: int = 0
    with_gaps: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmProjectsResponse:
    projects: List[PmProjectRow] = field(default_factory=list)
    totals: Optional[PmPortfolioTotals] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmProjectsRequest:
    search: Optional[str] = None

Python PmProjectsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/pm/projects HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Projects":[{"ProjectID":0,"ProjectUID":"String","Name":"String","Client":"String","ProjectType":"String","Status":"String","Branch":"String","StartDate":"String","EndDate":"String","Budget":0,"Spent":0,"EstimatedCost":0,"HealthPct":0,"JobCount":0,"OpenJobs":0,"GapCount":0,"OverBudget":false,"ProgressPct":0}],"Totals":{"Projects":0,"Budget":0,"Spent":0,"OverBudget":0,"WithGaps":0},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}