Trendsic Platform Service

<back to all web services

IntegrationsActionRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/integrations/{Provider}/{Action}
<?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 ProviderView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Blurb=null,
        /** @var string|null */
        public ?string $Mono=null,
        /** @var string|null */
        public ?string $AuthMode=null,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Health=null,
        /** @var string|null */
        public ?string $StatusDetail=null,
        /** @var string|null */
        public ?string $AccountLabel=null,
        /** @var string|null */
        public ?string $Environment=null,
        /** @var DateTime|null */
        public ?DateTime $LastActivityAt=null,
        /** @var string|null */
        public ?string $ManageRoute=null,
        /** @var array<string>|null */
        public ?array $Actions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Blurb'])) $this->Blurb = $o['Blurb'];
        if (isset($o['Mono'])) $this->Mono = $o['Mono'];
        if (isset($o['AuthMode'])) $this->AuthMode = $o['AuthMode'];
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Health'])) $this->Health = $o['Health'];
        if (isset($o['StatusDetail'])) $this->StatusDetail = $o['StatusDetail'];
        if (isset($o['AccountLabel'])) $this->AccountLabel = $o['AccountLabel'];
        if (isset($o['Environment'])) $this->Environment = $o['Environment'];
        if (isset($o['LastActivityAt'])) $this->LastActivityAt = JsonConverters::from('DateTime', $o['LastActivityAt']);
        if (isset($o['ManageRoute'])) $this->ManageRoute = $o['ManageRoute'];
        if (isset($o['Actions'])) $this->Actions = JsonConverters::fromArray('string', $o['Actions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Blurb)) $o['Blurb'] = $this->Blurb;
        if (isset($this->Mono)) $o['Mono'] = $this->Mono;
        if (isset($this->AuthMode)) $o['AuthMode'] = $this->AuthMode;
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Health)) $o['Health'] = $this->Health;
        if (isset($this->StatusDetail)) $o['StatusDetail'] = $this->StatusDetail;
        if (isset($this->AccountLabel)) $o['AccountLabel'] = $this->AccountLabel;
        if (isset($this->Environment)) $o['Environment'] = $this->Environment;
        if (isset($this->LastActivityAt)) $o['LastActivityAt'] = JsonConverters::to('DateTime', $this->LastActivityAt);
        if (isset($this->ManageRoute)) $o['ManageRoute'] = $this->ManageRoute;
        if (isset($this->Actions)) $o['Actions'] = JsonConverters::toArray('string', $this->Actions);
        return empty($o) ? new class(){} : $o;
    }
}

class IntegrationsActionResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Ok=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var ProviderView|null */
        public ?ProviderView $Provider=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class IntegrationsActionRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Provider=null,
        /** @var string|null */
        public ?string $Action=null,
        /** @var string|null */
        public ?string $ApiKey=null,
        /** @var string|null */
        public ?string $FromDate=null,
        /** @var string|null */
        public ?string $ToDate=null
    ) {
    }

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

PHP IntegrationsActionRequest 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/integrations/{Provider}/{Action} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<IntegrationsActionRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Action>String</Action>
  <ApiKey>String</ApiKey>
  <FromDate>String</FromDate>
  <Provider>String</Provider>
  <ToDate>String</ToDate>
</IntegrationsActionRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<IntegrationsActionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Message>String</Message>
  <Ok>false</Ok>
  <Provider>
    <AccountLabel>String</AccountLabel>
    <Actions xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Actions>
    <AuthMode>String</AuthMode>
    <Available>false</Available>
    <Blurb>String</Blurb>
    <Category>String</Category>
    <Environment>String</Environment>
    <Health>String</Health>
    <Key>String</Key>
    <LastActivityAt>0001-01-01T00:00:00</LastActivityAt>
    <ManageRoute>String</ManageRoute>
    <Mono>String</Mono>
    <Name>String</Name>
    <Status>String</Status>
    <StatusDetail>String</StatusDetail>
  </Provider>
  <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>
  <Url>String</Url>
</IntegrationsActionResponse>