| POST | /api/sendmessage | ||
|---|---|---|---|
| POST | /api/sendmessage/immediate | ||
| POST | /api/send | ||
| POST | /api/sms/send | ||
| POST | /api/send/immediate | ||
| POST | /api/sms/send/immediate |
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 CommResponse:
comm_id: Optional[str] = None
reference: Optional[str] = None
status: bool = False
message: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseLicenseeEnforcedServiceModel:
licensee_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SMSContact:
name: Optional[str] = None
phone_number: Optional[str] = None
contact_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SMSModel(BaseLicenseeEnforcedServiceModel):
from_: Optional[SMSContact] = field(metadata=config(field_name='from'), default=None)
to: Optional[List[SMSContact]] = None
message_body: Optional[str] = None
reply_is_allowed: bool = False
reply_is_required: bool = False
notes: Optional[str] = None
linked_object_id: Optional[str] = None
suite_id: Optional[str] = None
# @Api(Description="Saves the specified SMS and sends it for background processing")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SMSSend:
"""
Saves the specified SMS and sends it for background processing
"""
sms_model: Optional[SMSModel] = None
create_communication_references_immediately: bool = False
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 /api/sendmessage HTTP/1.1
Host: production-eros-gateway-api-sms-wa.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
SMSModel:
{
From:
{
Name: String,
PhoneNumber: String,
ContactId: 00000000000000000000000000000000
},
To:
[
{
Name: String,
PhoneNumber: String,
ContactId: 00000000000000000000000000000000
}
],
MessageBody: String,
ReplyIsAllowed: False,
ReplyIsRequired: False,
Notes: String,
LinkedObjectId: 00000000000000000000000000000000,
SuiteId: 00000000000000000000000000000000,
LicenseeId: 00000000000000000000000000000000
},
CreateCommunicationReferencesImmediately: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
CommId: 00000000000000000000000000000000,
Reference: String,
Status: False,
Message: String
}