Trendsic Platform Service

<back to all web services

ProjectRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/Project/GetSingle/{ProjectUID}
GET,POST,PUT,DELETE,OPTIONS/v1/Project
GET,POST,PUT,DELETE,OPTIONS/v1/Project/{ProjectID}
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 Location:
    id: Optional[str] = None
    client_id: Optional[str] = None
    name: Optional[str] = None
    address1: Optional[str] = None
    address2: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    zip: Optional[str] = None
    phone: Optional[str] = None
    fax: Optional[str] = None
    url: Optional[str] = None
    email: Optional[str] = None
    time_zone: Optional[str] = None
    active: bool = False
    ent_date: datetime.datetime = datetime.datetime(1, 1, 1)
    mod_date: datetime.datetime = datetime.datetime(1, 1, 1)
    location_image: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Project:
    project_i_d: int = 0
    project_u_i_d: Optional[str] = None
    project_name: Optional[str] = None
    image_u_r_l: Optional[str] = None
    image_key: Optional[str] = None
    client_name: Optional[str] = None
    client_phone: Optional[str] = None
    client_email: Optional[str] = None
    notify_customer_on_visit_completion: bool = False
    client_contact_i_d: Optional[int] = None
    project_manager_i_d: int = 0
    project_manager_name: Optional[str] = None
    start_date: Optional[datetime.datetime] = None
    end_date: Optional[datetime.datetime] = None
    actual_start_date: Optional[datetime.datetime] = None
    actual_end_date: Optional[datetime.datetime] = None
    job_count: int = 0
    crew_member_count: int = 0
    crew_avatars_json: Optional[str] = None
    crew_names_search: Optional[str] = None
    equipment_count: int = 0
    material_count: int = 0
    project_status_i_d: int = 0
    project_status_description: Optional[str] = None
    budget: Decimal = decimal.Decimal(0)
    cost_to_date: Decimal = decimal.Decimal(0)
    project_location: Optional[str] = None
    project_type: Optional[str] = None
    project_sponsor: Optional[str] = None
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None
    project_description: Optional[str] = None
    scope: Optional[str] = None
    status_id: int = 0
    branch_id: Optional[str] = None
    branch_name: Optional[str] = None
    location: Optional[Location] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProjectResponse:
    response_status: Optional[ResponseStatus] = None
    project: List[Project] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProjectRequest:
    project_u_i_d: Optional[str] = None
    project_i_d: int = 0
    project: List[Project] = field(default_factory=list)

Python ProjectRequest DTOs

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

HTTP + XML

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

POST /v1/Project HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ProjectRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Project>
    <Project>
      <ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
      <ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
      <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
      <BranchName>String</BranchName>
      <Budget>0</Budget>
      <ClientContactID>0</ClientContactID>
      <ClientEmail>String</ClientEmail>
      <ClientName>String</ClientName>
      <ClientPhone>String</ClientPhone>
      <CostToDate>0</CostToDate>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <CrewAvatarsJson>String</CrewAvatarsJson>
      <CrewMemberCount>0</CrewMemberCount>
      <CrewNamesSearch>String</CrewNamesSearch>
      <EndDate>0001-01-01T00:00:00</EndDate>
      <EquipmentCount>0</EquipmentCount>
      <ImageKey>String</ImageKey>
      <ImageURL>String</ImageURL>
      <JobCount>0</JobCount>
      <Location>
        <Active>false</Active>
        <Address1>String</Address1>
        <Address2>String</Address2>
        <City>String</City>
        <ClientId>00000000-0000-0000-0000-000000000000</ClientId>
        <Email>String</Email>
        <EntDate>0001-01-01T00:00:00</EntDate>
        <Fax>String</Fax>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <LocationImage>String</LocationImage>
        <ModDate>0001-01-01T00:00:00</ModDate>
        <Name>String</Name>
        <Phone>String</Phone>
        <State>String</State>
        <TimeZone>String</TimeZone>
        <URL>String</URL>
        <Zip>String</Zip>
      </Location>
      <MaterialCount>0</MaterialCount>
      <NotifyCustomerOnVisitCompletion>false</NotifyCustomerOnVisitCompletion>
      <ProjectDescription>String</ProjectDescription>
      <ProjectID>0</ProjectID>
      <ProjectLocation>String</ProjectLocation>
      <ProjectManagerID>0</ProjectManagerID>
      <ProjectManagerName>String</ProjectManagerName>
      <ProjectName>String</ProjectName>
      <ProjectSponsor>String</ProjectSponsor>
      <ProjectStatusDescription>String</ProjectStatusDescription>
      <ProjectStatusID>0</ProjectStatusID>
      <ProjectType>String</ProjectType>
      <ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
      <Scope>String</Scope>
      <StartDate>0001-01-01T00:00:00</StartDate>
      <StatusId>0</StatusId>
      <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    </Project>
  </Project>
  <ProjectID>0</ProjectID>
  <ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
</ProjectRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProjectResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Project>
    <Project>
      <ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
      <ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
      <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
      <BranchName>String</BranchName>
      <Budget>0</Budget>
      <ClientContactID>0</ClientContactID>
      <ClientEmail>String</ClientEmail>
      <ClientName>String</ClientName>
      <ClientPhone>String</ClientPhone>
      <CostToDate>0</CostToDate>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <CrewAvatarsJson>String</CrewAvatarsJson>
      <CrewMemberCount>0</CrewMemberCount>
      <CrewNamesSearch>String</CrewNamesSearch>
      <EndDate>0001-01-01T00:00:00</EndDate>
      <EquipmentCount>0</EquipmentCount>
      <ImageKey>String</ImageKey>
      <ImageURL>String</ImageURL>
      <JobCount>0</JobCount>
      <Location>
        <Active>false</Active>
        <Address1>String</Address1>
        <Address2>String</Address2>
        <City>String</City>
        <ClientId>00000000-0000-0000-0000-000000000000</ClientId>
        <Email>String</Email>
        <EntDate>0001-01-01T00:00:00</EntDate>
        <Fax>String</Fax>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <LocationImage>String</LocationImage>
        <ModDate>0001-01-01T00:00:00</ModDate>
        <Name>String</Name>
        <Phone>String</Phone>
        <State>String</State>
        <TimeZone>String</TimeZone>
        <URL>String</URL>
        <Zip>String</Zip>
      </Location>
      <MaterialCount>0</MaterialCount>
      <NotifyCustomerOnVisitCompletion>false</NotifyCustomerOnVisitCompletion>
      <ProjectDescription>String</ProjectDescription>
      <ProjectID>0</ProjectID>
      <ProjectLocation>String</ProjectLocation>
      <ProjectManagerID>0</ProjectManagerID>
      <ProjectManagerName>String</ProjectManagerName>
      <ProjectName>String</ProjectName>
      <ProjectSponsor>String</ProjectSponsor>
      <ProjectStatusDescription>String</ProjectStatusDescription>
      <ProjectStatusID>0</ProjectStatusID>
      <ProjectType>String</ProjectType>
      <ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
      <Scope>String</Scope>
      <StartDate>0001-01-01T00:00:00</StartDate>
      <StatusId>0</StatusId>
      <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    </Project>
  </Project>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</ProjectResponse>