| POST,OPTIONS | /v1/customerlink |
|---|
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 CustomerLink:
customer_link_id: int = 0
customer_link_u_i_d: Optional[str] = None
token_hash: Optional[str] = None
resource_type: Optional[str] = None
resource_uid: 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: Optional[datetime.datetime] = None
max_views: Optional[int] = None
view_count: int = 0
revoked_at_utc: Optional[datetime.datetime] = None
revoked_by_user_id: Optional[str] = None
tenant_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerLinkExtended(CustomerLink):
recipient_display_name: Optional[str] = None
recipient_type: Optional[str] = None
status: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerLinkCreateResponse:
response_status: Optional[ResponseStatus] = None
link: Optional[CustomerLinkExtended] = None
portal_url: Optional[str] = None
delivery_errors: List[str] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerLinkCreateRequest:
resource_type: Optional[str] = None
resource_uid: Optional[str] = None
recipient_contact_id: Optional[int] = None
recipient_email: Optional[str] = None
recipient_phone: Optional[str] = None
deliver_email: bool = False
deliver_sms: bool = False
expires_in_hours: Optional[int] = None
max_views: Optional[int] = None
Python CustomerLinkCreateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/customerlink HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ResourceType: String,
ResourceUid: 00000000000000000000000000000000,
RecipientContactId: 0,
RecipientEmail: String,
RecipientPhone: String,
DeliverEmail: False,
DeliverSms: False,
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
}
},
Link:
{
RecipientDisplayName: String,
RecipientType: String,
Status: String,
CustomerLinkId: 0,
CustomerLinkUID: 00000000000000000000000000000000,
TokenHash: String,
ResourceType: String,
ResourceUid: 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,
TenantId: 00000000000000000000000000000000
},
PortalUrl: String,
DeliveryErrors:
[
String
]
}