| POST | /sendgridevents |
|---|
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
Object = TypeVar('Object')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SendGridEvent:
send_grid_event_id: Optional[str] = None
send_grid_message_id: Optional[str] = None
email: Optional[str] = None
timestamp: int = 0
smtp_id: Optional[str] = None
event: Optional[str] = None
type: Optional[str] = None
category: Optional[List[str]] = None
reason: Optional[str] = None
status: Optional[str] = None
user_agent: Optional[str] = None
ip: Optional[str] = None
url: Optional[str] = None
url_offset: Optional[str] = None
machine_open: bool = False
tls: Optional[str] = None
unique_args: Optional[Dict[str, str]] = None
custom_args: Optional[Dict[str, str]] = None
marketing_campaign_id: Optional[str] = None
marketing_campaign_name: Optional[str] = None
single_send_i_d: Optional[str] = None
single_send_name: Optional[str] = None
bounce_classification: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SendGridEvents(List[SendGridEvent]):
pass
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 /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)