digitaluapi

<back to all web services

SetCampaignActionForm

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
PUT/campaign/actionformSet Campaign Action Form
<?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 SetCampaignActionFormResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Status=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class FormFieldOption implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $Label=null
    ) {
    }

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

class FormField implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $ControlType=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Placeholder=null,
        /** @var string|null */
        public ?string $Help=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $SortOrder=0,
        /** @var array<FormFieldOption>|null */
        public ?array $Options=null,
        /** @var array<string>|null */
        public ?array $Validation=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ControlType'])) $this->ControlType = $o['ControlType'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Placeholder'])) $this->Placeholder = $o['Placeholder'];
        if (isset($o['Help'])) $this->Help = $o['Help'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('FormFieldOption', $o['Options']);
        if (isset($o['Validation'])) $this->Validation = JsonConverters::fromArray('string', $o['Validation']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ControlType)) $o['ControlType'] = $this->ControlType;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Placeholder)) $o['Placeholder'] = $this->Placeholder;
        if (isset($this->Help)) $o['Help'] = $this->Help;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('FormFieldOption', $this->Options);
        if (isset($this->Validation)) $o['Validation'] = JsonConverters::toArray('string', $this->Validation);
        return empty($o) ? new class(){} : $o;
    }
}

class SetCampaignActionForm implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $CampaignsId=0,

        /** @var int */
        public int $CampaignActionsId=0,
        /** @var array<FormField>|null */
        public ?array $FormMeta=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CampaignsId'])) $this->CampaignsId = $o['CampaignsId'];
        if (isset($o['CampaignActionsId'])) $this->CampaignActionsId = $o['CampaignActionsId'];
        if (isset($o['FormMeta'])) $this->FormMeta = JsonConverters::fromArray('FormField', $o['FormMeta']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CampaignsId)) $o['CampaignsId'] = $this->CampaignsId;
        if (isset($this->CampaignActionsId)) $o['CampaignActionsId'] = $this->CampaignActionsId;
        if (isset($this->FormMeta)) $o['FormMeta'] = JsonConverters::toArray('FormField', $this->FormMeta);
        return empty($o) ? new class(){} : $o;
    }
}

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

PUT /campaign/actionform HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SetCampaignActionForm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
  <CampaignActionsId>0</CampaignActionsId>
  <CampaignsId>0</CampaignsId>
  <FormMeta>
    <FormField>
      <ControlType>String</ControlType>
      <Help>String</Help>
      <Id>0</Id>
      <Label>String</Label>
      <Name>String</Name>
      <Options>
        <FormFieldOption>
          <Label>String</Label>
          <Value>String</Value>
        </FormFieldOption>
      </Options>
      <Placeholder>String</Placeholder>
      <SortOrder>0</SortOrder>
      <Validation xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Validation>
    </FormField>
  </FormMeta>
</SetCampaignActionForm>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SetCampaignActionFormResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
  <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>
  <Status>false</Status>
</SetCampaignActionFormResponse>