Trendsic Platform Service

<back to all web services

CustomerLinkCreateRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/customerlink
import 'package:servicestack/servicestack.dart';

class CustomerLink implements IConvertible
{
    int? CustomerLinkId;
    String? CustomerLinkUID;
    String? TokenHash;
    String? ResourceType;
    String? ResourceUid;
    String? SensitivityTier;
    bool? RequireOtp;
    String? OtpChannel;
    String? DeliveryChannels;
    int? RecipientContactId;
    String? RecipientEmail;
    String? RecipientPhone;
    bool? SmsConsentSnapshot;
    String? CreatedByUserId;
    int? CreatedByAgentId;
    DateTime? CreatedAtUtc;
    DateTime? ExpiresAtUtc;
    int? MaxViews;
    int? ViewCount;
    DateTime? RevokedAtUtc;
    String? RevokedByUserId;
    String? TenantId;

    CustomerLink({this.CustomerLinkId,this.CustomerLinkUID,this.TokenHash,this.ResourceType,this.ResourceUid,this.SensitivityTier,this.RequireOtp,this.OtpChannel,this.DeliveryChannels,this.RecipientContactId,this.RecipientEmail,this.RecipientPhone,this.SmsConsentSnapshot,this.CreatedByUserId,this.CreatedByAgentId,this.CreatedAtUtc,this.ExpiresAtUtc,this.MaxViews,this.ViewCount,this.RevokedAtUtc,this.RevokedByUserId,this.TenantId});
    CustomerLink.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CustomerLinkId = json['CustomerLinkId'];
        CustomerLinkUID = json['CustomerLinkUID'];
        TokenHash = json['TokenHash'];
        ResourceType = json['ResourceType'];
        ResourceUid = json['ResourceUid'];
        SensitivityTier = json['SensitivityTier'];
        RequireOtp = json['RequireOtp'];
        OtpChannel = json['OtpChannel'];
        DeliveryChannels = json['DeliveryChannels'];
        RecipientContactId = json['RecipientContactId'];
        RecipientEmail = json['RecipientEmail'];
        RecipientPhone = json['RecipientPhone'];
        SmsConsentSnapshot = json['SmsConsentSnapshot'];
        CreatedByUserId = json['CreatedByUserId'];
        CreatedByAgentId = json['CreatedByAgentId'];
        CreatedAtUtc = JsonConverters.fromJson(json['CreatedAtUtc'],'DateTime',context!);
        ExpiresAtUtc = JsonConverters.fromJson(json['ExpiresAtUtc'],'DateTime',context!);
        MaxViews = json['MaxViews'];
        ViewCount = json['ViewCount'];
        RevokedAtUtc = JsonConverters.fromJson(json['RevokedAtUtc'],'DateTime',context!);
        RevokedByUserId = json['RevokedByUserId'];
        TenantId = json['TenantId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CustomerLinkId': CustomerLinkId,
        'CustomerLinkUID': CustomerLinkUID,
        'TokenHash': TokenHash,
        'ResourceType': ResourceType,
        'ResourceUid': ResourceUid,
        'SensitivityTier': SensitivityTier,
        'RequireOtp': RequireOtp,
        'OtpChannel': OtpChannel,
        'DeliveryChannels': DeliveryChannels,
        'RecipientContactId': RecipientContactId,
        'RecipientEmail': RecipientEmail,
        'RecipientPhone': RecipientPhone,
        'SmsConsentSnapshot': SmsConsentSnapshot,
        'CreatedByUserId': CreatedByUserId,
        'CreatedByAgentId': CreatedByAgentId,
        'CreatedAtUtc': JsonConverters.toJson(CreatedAtUtc,'DateTime',context!),
        'ExpiresAtUtc': JsonConverters.toJson(ExpiresAtUtc,'DateTime',context!),
        'MaxViews': MaxViews,
        'ViewCount': ViewCount,
        'RevokedAtUtc': JsonConverters.toJson(RevokedAtUtc,'DateTime',context!),
        'RevokedByUserId': RevokedByUserId,
        'TenantId': TenantId
    };

    getTypeName() => "CustomerLink";
    TypeContext? context = _ctx;
}

class CustomerLinkExtended extends CustomerLink implements IConvertible
{
    String? RecipientDisplayName;
    String? RecipientType;
    String? Status;

    CustomerLinkExtended({this.RecipientDisplayName,this.RecipientType,this.Status});
    CustomerLinkExtended.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        RecipientDisplayName = json['RecipientDisplayName'];
        RecipientType = json['RecipientType'];
        Status = json['Status'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'RecipientDisplayName': RecipientDisplayName,
        'RecipientType': RecipientType,
        'Status': Status
    });

    getTypeName() => "CustomerLinkExtended";
    TypeContext? context = _ctx;
}

class CustomerLinkCreateResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    CustomerLinkExtended? Link;
    String? PortalUrl;
    List<String>? DeliveryErrors = [];

    CustomerLinkCreateResponse({this.ResponseStatus,this.Link,this.PortalUrl,this.DeliveryErrors});
    CustomerLinkCreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Link = JsonConverters.fromJson(json['Link'],'CustomerLinkExtended',context!);
        PortalUrl = json['PortalUrl'];
        DeliveryErrors = JsonConverters.fromJson(json['DeliveryErrors'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Link': JsonConverters.toJson(Link,'CustomerLinkExtended',context!),
        'PortalUrl': PortalUrl,
        'DeliveryErrors': JsonConverters.toJson(DeliveryErrors,'List<String>',context!)
    };

    getTypeName() => "CustomerLinkCreateResponse";
    TypeContext? context = _ctx;
}

class CustomerLinkCreateRequest implements IConvertible
{
    String? ResourceType;
    String? ResourceUid;
    int? RecipientContactId;
    String? RecipientEmail;
    String? RecipientPhone;
    bool? DeliverEmail;
    bool? DeliverSms;
    int? ExpiresInHours;
    int? MaxViews;

    CustomerLinkCreateRequest({this.ResourceType,this.ResourceUid,this.RecipientContactId,this.RecipientEmail,this.RecipientPhone,this.DeliverEmail,this.DeliverSms,this.ExpiresInHours,this.MaxViews});
    CustomerLinkCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResourceType = json['ResourceType'];
        ResourceUid = json['ResourceUid'];
        RecipientContactId = json['RecipientContactId'];
        RecipientEmail = json['RecipientEmail'];
        RecipientPhone = json['RecipientPhone'];
        DeliverEmail = json['DeliverEmail'];
        DeliverSms = json['DeliverSms'];
        ExpiresInHours = json['ExpiresInHours'];
        MaxViews = json['MaxViews'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResourceType': ResourceType,
        'ResourceUid': ResourceUid,
        'RecipientContactId': RecipientContactId,
        'RecipientEmail': RecipientEmail,
        'RecipientPhone': RecipientPhone,
        'DeliverEmail': DeliverEmail,
        'DeliverSms': DeliverSms,
        'ExpiresInHours': ExpiresInHours,
        'MaxViews': MaxViews
    };

    getTypeName() => "CustomerLinkCreateRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CustomerLink': TypeInfo(TypeOf.Class, create:() => CustomerLink()),
    'CustomerLinkExtended': TypeInfo(TypeOf.Class, create:() => CustomerLinkExtended()),
    'CustomerLinkCreateResponse': TypeInfo(TypeOf.Class, create:() => CustomerLinkCreateResponse()),
    'CustomerLinkCreateRequest': TypeInfo(TypeOf.Class, create:() => CustomerLinkCreateRequest()),
});

Dart CustomerLinkCreateRequest 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.

POST /v1/customerlink HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerLinkCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <DeliverEmail>false</DeliverEmail>
  <DeliverSms>false</DeliverSms>
  <ExpiresInHours>0</ExpiresInHours>
  <MaxViews>0</MaxViews>
  <RecipientContactId>0</RecipientContactId>
  <RecipientEmail>String</RecipientEmail>
  <RecipientPhone>String</RecipientPhone>
  <ResourceType>String</ResourceType>
  <ResourceUid>00000000-0000-0000-0000-000000000000</ResourceUid>
</CustomerLinkCreateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerLinkCreateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <DeliveryErrors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </DeliveryErrors>
  <Link>
    <CreatedAtUtc>0001-01-01T00:00:00</CreatedAtUtc>
    <CreatedByAgentId>0</CreatedByAgentId>
    <CreatedByUserId>00000000-0000-0000-0000-000000000000</CreatedByUserId>
    <CustomerLinkId>0</CustomerLinkId>
    <CustomerLinkUID>00000000-0000-0000-0000-000000000000</CustomerLinkUID>
    <DeliveryChannels>String</DeliveryChannels>
    <ExpiresAtUtc>0001-01-01T00:00:00</ExpiresAtUtc>
    <MaxViews>0</MaxViews>
    <OtpChannel>String</OtpChannel>
    <RecipientContactId>0</RecipientContactId>
    <RecipientEmail>String</RecipientEmail>
    <RecipientPhone>String</RecipientPhone>
    <RequireOtp>false</RequireOtp>
    <ResourceType>String</ResourceType>
    <ResourceUid>00000000-0000-0000-0000-000000000000</ResourceUid>
    <RevokedAtUtc>0001-01-01T00:00:00</RevokedAtUtc>
    <RevokedByUserId>00000000-0000-0000-0000-000000000000</RevokedByUserId>
    <SensitivityTier>String</SensitivityTier>
    <SmsConsentSnapshot>false</SmsConsentSnapshot>
    <TenantId>00000000-0000-0000-0000-000000000000</TenantId>
    <TokenHash>String</TokenHash>
    <ViewCount>0</ViewCount>
    <RecipientDisplayName>String</RecipientDisplayName>
    <RecipientType>String</RecipientType>
    <Status>String</Status>
  </Link>
  <PortalUrl>String</PortalUrl>
  <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>
</CustomerLinkCreateResponse>