Trendsic Platform Service

<back to all web services

DocumentShareCreateRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/documentshare
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentShare:
    document_share_id: int = 0
    document_share_u_i_d: Optional[str] = None
    token_hash: Optional[str] = None
    attachment_id: Optional[str] = None
    sensitivity_tier: Optional[str] = None
    require_otp: bool = False
    otp_channel: Optional[str] = None
    delivery_channels: Optional[str] = None
    recipient_contact_id: Optional[int] = None
    recipient_email: Optional[str] = None
    recipient_phone: Optional[str] = None
    sms_consent_snapshot: bool = False
    created_by_user_id: Optional[str] = None
    created_by_agent_id: Optional[int] = None
    created_at_utc: datetime.datetime = datetime.datetime(1, 1, 1)
    expires_at_utc: datetime.datetime = datetime.datetime(1, 1, 1)
    max_views: Optional[int] = None
    view_count: int = 0
    revoked_at_utc: Optional[datetime.datetime] = None
    revoked_by_user_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentShareExtended(DocumentShare):
    attachment_name: Optional[str] = None
    recipient_display_name: Optional[str] = None
    recipient_type: Optional[str] = None
    created_by_name: Optional[str] = None
    status: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentShareResponse:
    response_status: Optional[ResponseStatus] = None
    document_share: List[DocumentShareExtended] = field(default_factory=list)
    share_url: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentShareCreateRequest:
    attachment_id: Optional[str] = None
    recipient_contact_id: int = 0
    recipient_email: Optional[str] = None
    recipient_phone: Optional[str] = None
    is_adhoc: bool = False
    sensitivity_tier: Optional[str] = None
    require_otp: bool = False
    otp_channel: Optional[str] = None
    delivery_channels: Optional[str] = None
    expires_in_hours: int = 0
    max_views: int = 0

Python DocumentShareCreateRequest 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/documentshare HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	AttachmentId: 00000000000000000000000000000000,
	RecipientContactId: 0,
	RecipientEmail: String,
	RecipientPhone: String,
	IsAdhoc: False,
	SensitivityTier: String,
	RequireOtp: False,
	OtpChannel: String,
	DeliveryChannels: String,
	ExpiresInHours: 0,
	MaxViews: 0
}
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
		}
	},
	DocumentShare: 
	[
		{
			AttachmentName: String,
			RecipientDisplayName: String,
			RecipientType: String,
			CreatedByName: String,
			Status: String,
			DocumentShareId: 0,
			DocumentShareUID: 00000000000000000000000000000000,
			TokenHash: String,
			AttachmentId: 00000000000000000000000000000000,
			SensitivityTier: String,
			RequireOtp: False,
			OtpChannel: String,
			DeliveryChannels: String,
			RecipientContactId: 0,
			RecipientEmail: String,
			RecipientPhone: String,
			SmsConsentSnapshot: False,
			CreatedByUserId: 00000000000000000000000000000000,
			CreatedByAgentId: 0,
			CreatedAtUtc: 0001-01-01,
			ExpiresAtUtc: 0001-01-01,
			MaxViews: 0,
			ViewCount: 0,
			RevokedAtUtc: 0001-01-01,
			RevokedByUserId: 00000000000000000000000000000000
		}
	],
	ShareUrl: String
}