Trendsic Platform Service

<back to all web services

DropboxShareRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator, Worker, Agent, Administrator
The following routes are available for this service:
DELETE,OPTIONS/v1/DropboxShare/{DropboxShareId}
PUT,OPTIONS/v1/DropboxShare/{DropboxShareId}/{canShare}
POST,OPTIONS/v1/DropboxShare/{ContactId}/{AgentId}/{AttachmentId}/{SharerAgentId}
POST,OPTIONS/v1/DropboxShare/{AgentId}/{AttachmentId}/{SharerAgentId}
<?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 DropboxShareResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class DropboxShareRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var int */
        public int $DropboxShareId=0,
        /** @var int */
        public int $AgentId=0,
        /** @var string */
        public string $AttachmentId='',
        /** @var int */
        public int $SharerAgentId=0,
        /** @var bool|null */
        public ?bool $canShare=null
    ) {
    }

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

PHP DropboxShareRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/DropboxShare/{ContactId}/{AgentId}/{AttachmentId}/{SharerAgentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ContactId: 0,
	DropboxShareId: 0,
	AgentId: 0,
	AttachmentId: 00000000000000000000000000000000,
	SharerAgentId: 0,
	canShare: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}