Trendsic Platform Service

<back to all web services

orgGetSingleRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET, OPTIONS/v1/Organization/GetSingleBySchoolID/{schoolID}
GET, OPTIONS/v1/Organization/GetSingleByDistrictID/{districtID}
<?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 Organization implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $OrganizationId=0,
        /** @var int */
        public int $OrganizationTypeId=0,
        /** @var int */
        public int $StateID=0,
        /** @var string|null */
        public ?string $StateName=null,
        /** @var int */
        public int $DistrictID=0,
        /** @var string|null */
        public ?string $DistrictName=null,
        /** @var int */
        public int $CountyID=0,
        /** @var string|null */
        public ?string $CountyName=null,
        /** @var int */
        public int $SchoolID=0,
        /** @var string|null */
        public ?string $SchoolName=null,
        /** @var string|null */
        public ?string $EntityName=null,
        /** @var string|null */
        public ?string $EntityId=null,
        /** @var string|null */
        public ?string $Source=null,
        /** @var int */
        public int $Pera_ListId=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['OrganizationId'])) $this->OrganizationId = $o['OrganizationId'];
        if (isset($o['OrganizationTypeId'])) $this->OrganizationTypeId = $o['OrganizationTypeId'];
        if (isset($o['StateID'])) $this->StateID = $o['StateID'];
        if (isset($o['StateName'])) $this->StateName = $o['StateName'];
        if (isset($o['DistrictID'])) $this->DistrictID = $o['DistrictID'];
        if (isset($o['DistrictName'])) $this->DistrictName = $o['DistrictName'];
        if (isset($o['CountyID'])) $this->CountyID = $o['CountyID'];
        if (isset($o['CountyName'])) $this->CountyName = $o['CountyName'];
        if (isset($o['SchoolID'])) $this->SchoolID = $o['SchoolID'];
        if (isset($o['SchoolName'])) $this->SchoolName = $o['SchoolName'];
        if (isset($o['EntityName'])) $this->EntityName = $o['EntityName'];
        if (isset($o['EntityId'])) $this->EntityId = $o['EntityId'];
        if (isset($o['Source'])) $this->Source = $o['Source'];
        if (isset($o['Pera_ListId'])) $this->Pera_ListId = $o['Pera_ListId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->OrganizationId)) $o['OrganizationId'] = $this->OrganizationId;
        if (isset($this->OrganizationTypeId)) $o['OrganizationTypeId'] = $this->OrganizationTypeId;
        if (isset($this->StateID)) $o['StateID'] = $this->StateID;
        if (isset($this->StateName)) $o['StateName'] = $this->StateName;
        if (isset($this->DistrictID)) $o['DistrictID'] = $this->DistrictID;
        if (isset($this->DistrictName)) $o['DistrictName'] = $this->DistrictName;
        if (isset($this->CountyID)) $o['CountyID'] = $this->CountyID;
        if (isset($this->CountyName)) $o['CountyName'] = $this->CountyName;
        if (isset($this->SchoolID)) $o['SchoolID'] = $this->SchoolID;
        if (isset($this->SchoolName)) $o['SchoolName'] = $this->SchoolName;
        if (isset($this->EntityName)) $o['EntityName'] = $this->EntityName;
        if (isset($this->EntityId)) $o['EntityId'] = $this->EntityId;
        if (isset($this->Source)) $o['Source'] = $this->Source;
        if (isset($this->Pera_ListId)) $o['Pera_ListId'] = $this->Pera_ListId;
        return empty($o) ? new class(){} : $o;
    }
}

class orgGetSingleResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var Organization|null */
        public ?Organization $org=null
    ) {
    }

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

class orgGetSingleRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $schoolID=0,
        /** @var int */
        public int $districtID=0
    ) {
    }

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

PHP orgGetSingleRequest 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.

GET /v1/Organization/GetSingleBySchoolID/{schoolID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<orgGetSingleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <org>
    <CountyID>0</CountyID>
    <CountyName>String</CountyName>
    <DistrictID>0</DistrictID>
    <DistrictName>String</DistrictName>
    <EntityId>String</EntityId>
    <EntityName>String</EntityName>
    <OrganizationId>0</OrganizationId>
    <OrganizationTypeId>0</OrganizationTypeId>
    <Pera_ListId>0</Pera_ListId>
    <SchoolID>0</SchoolID>
    <SchoolName>String</SchoolName>
    <Source>String</Source>
    <StateID>0</StateID>
    <StateName>String</StateName>
  </org>
</orgGetSingleResponse>