Required role: | API |
All Verbs | /api/Query/Message |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
@AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Message")
open class FindMessage : QueryDb<MessageInstance>()
{
}
open class QueryDb<T> : QueryBase()
{
}
@DataContract
open class QueryBase
{
@DataMember(Order=1)
var Skip:Int? = null
@DataMember(Order=2)
var Take:Int? = null
@DataMember(Order=3)
var OrderBy:String? = null
@DataMember(Order=4)
var OrderByDesc:String? = null
@DataMember(Order=5)
var Include:String? = null
@DataMember(Order=6)
var Fields:String? = null
@DataMember(Order=7)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
open class MessageInstance
{
var MessageId:Int? = null
var DueDate:Date? = null
var SentDate:Date? = null
var Processed:Boolean? = null
var Failures:Int? = null
var InstanceId:Int? = null
var MessageSid:String? = null
var MessageTemplate:MessageTemplateInstance? = null
@References(MessageTemplateInstance.class)
var MessageTemplateId:Int? = null
var OpenedDate:Date? = null
var BouncedDate:Date? = null
var DeliveredDate:Date? = null
var UnsubscribedDate:Date? = null
var SpamReportDate:Date? = null
var User:UserInstance? = null
@References(UserInstance.class)
var UserId:Int? = null
var InstanceType:Int? = null
}
open class MessageTemplateInstance
{
var MessageTemplateId:Int? = null
var Name:String? = null
var Subject:String? = null
var Body:String? = null
var ReportId:Int? = null
var TemplateType:Int? = null
var Created:Date? = null
var CreatedBy:Int? = null
var Modified:Date? = null
var ModifiedBy:Int? = null
var Deleted:Date? = null
var DeletedBy:Int? = null
var EventType:Int? = null
var ContentType:Int? = null
var Hidden:Boolean? = null
var ParentMessageTemplateId:Int? = null
var InclusionTags:String? = null
var ExclusionTags:String? = null
}
open class UserInstance
{
var UserId:Int? = null
var UserName:String? = null
var Name:String? = null
var Email:String? = null
var MobilePhone:String? = null
var Enabled:Boolean? = null
var LastLogin:Date? = null
var Created:Date? = null
var Training:Boolean? = null
var Deleted:Boolean? = null
var CoursesCompleted:Int? = null
var DisplayHomeNotification:Boolean? = null
var TwoFactorEnabled:Boolean? = null
var EmailConfirmed:Boolean? = null
var MobilePhoneConfirmed:Boolean? = null
var Notifications:Boolean? = null
var ChangePassword:Date? = null
var Activated:Date? = null
}
@DataContract
open class QueryResponse<T>
{
@DataMember(Order=1)
var Offset:Int? = null
@DataMember(Order=2)
var Total:Int? = null
@DataMember(Order=3)
var Results:ArrayList<T> = ArrayList<T>()
@DataMember(Order=4)
var Meta:HashMap<String,String> = HashMap<String,String>()
@DataMember(Order=5)
var ResponseStatus:ResponseStatus? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/Query/Message HTTP/1.1
Host: api.clubmanagercentral.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Skip":0,"Take":0,"OrderBy":"String","OrderByDesc":"String","Include":"String","Fields":"String","Meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Offset":0,"Total":0,"Results":[{"MessageId":0,"DueDate":"0001-01-01T00:00:00.0000000","SentDate":"0001-01-01T00:00:00.0000000","Processed":false,"Failures":0,"InstanceId":0,"MessageSid":"String","MessageTemplate":{"MessageTemplateId":0,"Name":"String","Subject":"String","Body":"String","ReportId":0,"TemplateType":0,"Created":"0001-01-01T00:00:00.0000000","CreatedBy":0,"Modified":"0001-01-01T00:00:00.0000000","ModifiedBy":0,"Deleted":"0001-01-01T00:00:00.0000000","DeletedBy":0,"EventType":0,"ContentType":0,"Hidden":false,"ParentMessageTemplateId":0,"InclusionTags":"String","ExclusionTags":"String"},"MessageTemplateId":0,"OpenedDate":"0001-01-01T00:00:00.0000000","BouncedDate":"0001-01-01T00:00:00.0000000","DeliveredDate":"0001-01-01T00:00:00.0000000","UnsubscribedDate":"0001-01-01T00:00:00.0000000","SpamReportDate":"0001-01-01T00:00:00.0000000","User":{"UserId":0,"UserName":"String","Name":"String","Email":"String","MobilePhone":"String","Enabled":false,"LastLogin":"0001-01-01T00:00:00.0000000","Created":"0001-01-01T00:00:00.0000000","Training":false,"Deleted":false,"CoursesCompleted":0,"DisplayHomeNotification":false,"TwoFactorEnabled":false,"EmailConfirmed":false,"MobilePhoneConfirmed":false,"Notifications":false,"ChangePassword":"0001-01-01T00:00:00.0000000","Activated":"0001-01-01T00:00:00.0000000"},"UserId":0,"InstanceType":0}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}