DigiOffice API Services Services

<back to all web services

GetProjectDetails

Requires Authentication
The following routes are available for this service:
GET/api/projects/{ID}
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class ProjectDetails implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var string */
        public string $GlobalID='',
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description1=null,
        /** @var string|null */
        public ?string $Description2=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $CorrespondenceInternalCompanyID=0,
        /** @var string|null */
        public ?string $CorrespondenceInternalCompanyName=null,
        /** @var string */
        public string $CorrespondenceInternalCompanyGlobalID='',
        /** @var string|null */
        public ?string $Postalcode=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var int */
        public int $CountryID=0,
        /** @var string */
        public string $CountryGlobalID='',
        /** @var string|null */
        public ?string $CountryName=null,
        /** @var string|null */
        public ?string $GeoLocation=null,
        /** @var string|null */
        public ?string $AddressComplete=null,
        /** @var int */
        public int $CategoryID=0,
        /** @var string|null */
        public ?string $CategoryDescription=null,
        /** @var string */
        public string $CategoryGlobalID=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['GlobalID'])) $this->GlobalID = $o['GlobalID'];
        if (isset($o['Number'])) $this->Number = $o['Number'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description1'])) $this->Description1 = $o['Description1'];
        if (isset($o['Description2'])) $this->Description2 = $o['Description2'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['CorrespondenceInternalCompanyID'])) $this->CorrespondenceInternalCompanyID = $o['CorrespondenceInternalCompanyID'];
        if (isset($o['CorrespondenceInternalCompanyName'])) $this->CorrespondenceInternalCompanyName = $o['CorrespondenceInternalCompanyName'];
        if (isset($o['CorrespondenceInternalCompanyGlobalID'])) $this->CorrespondenceInternalCompanyGlobalID = $o['CorrespondenceInternalCompanyGlobalID'];
        if (isset($o['Postalcode'])) $this->Postalcode = $o['Postalcode'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['CountryID'])) $this->CountryID = $o['CountryID'];
        if (isset($o['CountryGlobalID'])) $this->CountryGlobalID = $o['CountryGlobalID'];
        if (isset($o['CountryName'])) $this->CountryName = $o['CountryName'];
        if (isset($o['GeoLocation'])) $this->GeoLocation = $o['GeoLocation'];
        if (isset($o['AddressComplete'])) $this->AddressComplete = $o['AddressComplete'];
        if (isset($o['CategoryID'])) $this->CategoryID = $o['CategoryID'];
        if (isset($o['CategoryDescription'])) $this->CategoryDescription = $o['CategoryDescription'];
        if (isset($o['CategoryGlobalID'])) $this->CategoryGlobalID = $o['CategoryGlobalID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->GlobalID)) $o['GlobalID'] = $this->GlobalID;
        if (isset($this->Number)) $o['Number'] = $this->Number;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description1)) $o['Description1'] = $this->Description1;
        if (isset($this->Description2)) $o['Description2'] = $this->Description2;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->CorrespondenceInternalCompanyID)) $o['CorrespondenceInternalCompanyID'] = $this->CorrespondenceInternalCompanyID;
        if (isset($this->CorrespondenceInternalCompanyName)) $o['CorrespondenceInternalCompanyName'] = $this->CorrespondenceInternalCompanyName;
        if (isset($this->CorrespondenceInternalCompanyGlobalID)) $o['CorrespondenceInternalCompanyGlobalID'] = $this->CorrespondenceInternalCompanyGlobalID;
        if (isset($this->Postalcode)) $o['Postalcode'] = $this->Postalcode;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->CountryID)) $o['CountryID'] = $this->CountryID;
        if (isset($this->CountryGlobalID)) $o['CountryGlobalID'] = $this->CountryGlobalID;
        if (isset($this->CountryName)) $o['CountryName'] = $this->CountryName;
        if (isset($this->GeoLocation)) $o['GeoLocation'] = $this->GeoLocation;
        if (isset($this->AddressComplete)) $o['AddressComplete'] = $this->AddressComplete;
        if (isset($this->CategoryID)) $o['CategoryID'] = $this->CategoryID;
        if (isset($this->CategoryDescription)) $o['CategoryDescription'] = $this->CategoryDescription;
        if (isset($this->CategoryGlobalID)) $o['CategoryGlobalID'] = $this->CategoryGlobalID;
        return empty($o) ? new class(){} : $o;
    }
}

class GetProjectDetails implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetProjectDetails 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 /api/projects/{ID} HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ID":0,"GlobalID":"00000000-0000-0000-0000-000000000000","Number":"String","Name":"String","Description1":"String","Description2":"String","Active":false,"CorrespondenceInternalCompanyID":0,"CorrespondenceInternalCompanyName":"String","CorrespondenceInternalCompanyGlobalID":"00000000-0000-0000-0000-000000000000","Postalcode":"String","City":"String","CountryID":0,"CountryGlobalID":"00000000-0000-0000-0000-000000000000","CountryName":"String","GeoLocation":"String","AddressComplete":"String","CategoryID":0,"CategoryDescription":"String","CategoryGlobalID":"00000000-0000-0000-0000-000000000000"}