CPU.Notifications

<back to all web services

SendGridEvents

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

class SendGridEvent implements IConvertible
{
    // @DataMember(Name="sg_event_id")
    String? sg_event_id;

    // @DataMember(Name="sg_message_id")
    String? sg_message_id;

    String? email;
    int timestamp = 0;
    // @DataMember(Name="smtp-id")
    String? smtp_id;

    String? event;
    String? type;
    List<String>? category;
    String? reason;
    String? status;
    String? userAgent;
    String? ip;
    String? url;
    // @DataMember(Name="url_offset")
    String? url_offset;

    // @DataMember(Name="sg_machine_open")
    bool sg_machine_open;

    String? tls;
    // @DataMember(Name="unique_args")
    Map<String,String?>? unique_args;

    // @DataMember(Name="custom_args")
    Map<String,String?>? custom_args;

    // @DataMember(Name="marketing_campaign_id")
    String? marketing_campaign_id;

    // @DataMember(Name="marketing_campaign_name")
    String? marketing_campaign_name;

    // @DataMember(Name="singlesend_id")
    String? singlesend_id;

    // @DataMember(Name="singlesend_name")
    String? singlesend_name;

    // @DataMember(Name="bounce_classification")
    String? bounce_classification;

    SendGridEvent({this.sg_event_id,this.sg_message_id,this.email,this.timestamp,this.smtp_id,this.event,this.type,this.category,this.reason,this.status,this.userAgent,this.ip,this.url,this.url_offset,this.sg_machine_open,this.tls,this.unique_args,this.custom_args,this.marketing_campaign_id,this.marketing_campaign_name,this.singlesend_id,this.singlesend_name,this.bounce_classification});
    SendGridEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        sg_event_id = json['sendGridEventId'];
        sg_message_id = json['sendGridMessageId'];
        email = json['email'];
        timestamp = json['timestamp'];
        smtp_id = json['smtpId'];
        event = json['event'];
        type = json['type'];
        category = JsonConverters.fromJson(json['category'],'List<String>',context!);
        reason = json['reason'];
        status = json['status'];
        userAgent = json['userAgent'];
        ip = json['ip'];
        url = json['url'];
        url_offset = json['urlOffset'];
        sg_machine_open = json['machineOpen'];
        tls = json['tls'];
        unique_args = JsonConverters.toStringMap(json['uniqueArgs']);
        custom_args = JsonConverters.toStringMap(json['customArgs']);
        marketing_campaign_id = json['marketingCampaignId'];
        marketing_campaign_name = json['marketingCampaignName'];
        singlesend_id = json['singleSendID'];
        singlesend_name = json['singleSendName'];
        bounce_classification = json['bounceClassification'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'sg_event_id': sg_event_id,
        'sg_message_id': sg_message_id,
        'email': email,
        'timestamp': timestamp,
        'smtp_id': smtp_id,
        'event': event,
        'type': type,
        'category': JsonConverters.toJson(category,'List<String>',context!),
        'reason': reason,
        'status': status,
        'userAgent': userAgent,
        'ip': ip,
        'url': url,
        'url_offset': url_offset,
        'sg_machine_open': sg_machine_open,
        'tls': tls,
        'unique_args': unique_args,
        'custom_args': custom_args,
        'marketing_campaign_id': marketing_campaign_id,
        'marketing_campaign_name': marketing_campaign_name,
        'singlesend_id': singlesend_id,
        'singlesend_name': singlesend_name,
        'bounce_classification': bounce_classification
    };

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

class SendGridEvents extends ListBase<SendGridEvent> implements IConvertible
{
    final List<SendGridEvent> l = [];
    set length(int newLength) { l.length = newLength; }
    int get length => l.length;
    SendGridEvent operator [](int index) => l[index];
    void operator []=(int index, SendGridEvent value) { l[index] = value; }
    SendGridEvents();
    SendGridEvents.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "SendGridEvents";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'cpmwebservices_t.clarkpud.com', types: <String, TypeInfo> {
    'SendGridEvent': TypeInfo(TypeOf.Class, create:() => SendGridEvent()),
    'SendGridEvents': TypeInfo(TypeOf.Class, create:() => SendGridEvents()),
});

Dart SendGridEvents 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 /sendgridevents HTTP/1.1 
Host: cpmwebservices-t.clarkpud.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

[
	
]
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

(string)