| Requires any of the roles: | Client, Admin, Partner |
| PUT | /campaign/actions/files | Set Campaign Action Files |
|---|
<?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 CampaignActionFile implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $FileType=null,
/** @var string|null */
public ?string $FileSize=null,
/** @var string|null */
public ?string $Extension=null,
/** @var string|null */
public ?string $UploadUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['FileType'])) $this->FileType = $o['FileType'];
if (isset($o['FileSize'])) $this->FileSize = $o['FileSize'];
if (isset($o['Extension'])) $this->Extension = $o['Extension'];
if (isset($o['UploadUrl'])) $this->UploadUrl = $o['UploadUrl'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->FileType)) $o['FileType'] = $this->FileType;
if (isset($this->FileSize)) $o['FileSize'] = $this->FileSize;
if (isset($this->Extension)) $o['Extension'] = $this->Extension;
if (isset($this->UploadUrl)) $o['UploadUrl'] = $this->UploadUrl;
return empty($o) ? new class(){} : $o;
}
}
class SetCampaignActionFiles 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<CampaignActionFile>|null */
public ?array $Files=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['Files'])) $this->Files = JsonConverters::fromArray('CampaignActionFile', $o['Files']);
}
/** @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->Files)) $o['Files'] = JsonConverters::toArray('CampaignActionFile', $this->Files);
return empty($o) ? new class(){} : $o;
}
}
PHP SetCampaignActionFiles DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /campaign/actions/files HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CampaignsId":0,"CampaignActionsId":0,"Files":[{"Name":"String","FileType":"String","FileSize":"String","Extension":"String","UploadUrl":"String"}]}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length false