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 .csv suffix or ?format=csv

HTTP + CSV

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/csv
Content-Type: text/csv
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/csv
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-01T00:00:00.0000000","ExpiresAtUtc":"0001-01-01T00:00:00.0000000","MaxViews":0,"ViewCount":0,"RevokedAtUtc":"0001-01-01T00:00:00.0000000","RevokedByUserId":"00000000000000000000000000000000","TenantId":"00000000000000000000000000000000"},"PortalUrl":"String","DeliveryErrors":["String"]}