Trendsic Platform Service

<back to all web services

AttachmentViewRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/AttachmentView/{AttachmentId}
<?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 AttachmentViewResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string */
        public string $AttachmentId='',
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $MimeType=null,
        /** @var float */
        public float $FileSizeInKB=0.0,
        /** @var string|null */
        public ?string $Extension=null,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Viewer=null,
        /** @var bool|null */
        public ?bool $IsSensitive=null,
        /** @var bool|null */
        public ?bool $CanDownload=null,
        /** @var string|null */
        public ?string $ContentUrl=null,
        /** @var string|null */
        public ?string $MediaUrl=null,
        /** @var int */
        public int $PageCount=0,
        /** @var int */
        public int $CurrentVersionNo=0,
        /** @var int */
        public int $VersionCount=0,
        /** @var string|null */
        public ?string $TableName=null,
        /** @var int */
        public int $RecordId=0,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['MimeType'])) $this->MimeType = $o['MimeType'];
        if (isset($o['FileSizeInKB'])) $this->FileSizeInKB = $o['FileSizeInKB'];
        if (isset($o['Extension'])) $this->Extension = $o['Extension'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Viewer'])) $this->Viewer = $o['Viewer'];
        if (isset($o['IsSensitive'])) $this->IsSensitive = $o['IsSensitive'];
        if (isset($o['CanDownload'])) $this->CanDownload = $o['CanDownload'];
        if (isset($o['ContentUrl'])) $this->ContentUrl = $o['ContentUrl'];
        if (isset($o['MediaUrl'])) $this->MediaUrl = $o['MediaUrl'];
        if (isset($o['PageCount'])) $this->PageCount = $o['PageCount'];
        if (isset($o['CurrentVersionNo'])) $this->CurrentVersionNo = $o['CurrentVersionNo'];
        if (isset($o['VersionCount'])) $this->VersionCount = $o['VersionCount'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->MimeType)) $o['MimeType'] = $this->MimeType;
        if (isset($this->FileSizeInKB)) $o['FileSizeInKB'] = $this->FileSizeInKB;
        if (isset($this->Extension)) $o['Extension'] = $this->Extension;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Viewer)) $o['Viewer'] = $this->Viewer;
        if (isset($this->IsSensitive)) $o['IsSensitive'] = $this->IsSensitive;
        if (isset($this->CanDownload)) $o['CanDownload'] = $this->CanDownload;
        if (isset($this->ContentUrl)) $o['ContentUrl'] = $this->ContentUrl;
        if (isset($this->MediaUrl)) $o['MediaUrl'] = $this->MediaUrl;
        if (isset($this->PageCount)) $o['PageCount'] = $this->PageCount;
        if (isset($this->CurrentVersionNo)) $o['CurrentVersionNo'] = $this->CurrentVersionNo;
        if (isset($this->VersionCount)) $o['VersionCount'] = $this->VersionCount;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class AttachmentViewRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $AttachmentId=''
    ) {
    }

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

PHP AttachmentViewRequest 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/AttachmentView/{AttachmentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AttachmentViewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
  <CanDownload>false</CanDownload>
  <Category>String</Category>
  <ContentUrl>String</ContentUrl>
  <CreatedBy>String</CreatedBy>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <CurrentVersionNo>0</CurrentVersionNo>
  <Extension>String</Extension>
  <FileName>String</FileName>
  <FileSizeInKB>0</FileSizeInKB>
  <IsSensitive>false</IsSensitive>
  <MediaUrl>String</MediaUrl>
  <MimeType>String</MimeType>
  <PageCount>0</PageCount>
  <RecordId>0</RecordId>
  <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>
  <TableName>String</TableName>
  <VersionCount>0</VersionCount>
  <Viewer>String</Viewer>
</AttachmentViewResponse>