Required role: | API |
All Verbs | /api/Query/Message |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubManager.Api.Services.Query;
namespace ClubManager.Api.Services.Query
{
[AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Message")]
public partial class FindMessage
: QueryDb<MessageInstance>
{
}
public partial class MessageInstance
{
public virtual int MessageId { get; set; }
public virtual DateTime DueDate { get; set; }
public virtual DateTime? SentDate { get; set; }
public virtual bool Processed { get; set; }
public virtual int Failures { get; set; }
public virtual int? InstanceId { get; set; }
public virtual string MessageSid { get; set; }
public virtual MessageTemplateInstance MessageTemplate { get; set; }
[References(typeof(ClubManager.Api.Services.Query.MessageTemplateInstance))]
public virtual int? MessageTemplateId { get; set; }
public virtual DateTime? OpenedDate { get; set; }
public virtual DateTime? BouncedDate { get; set; }
public virtual DateTime? DeliveredDate { get; set; }
public virtual DateTime? UnsubscribedDate { get; set; }
public virtual DateTime? SpamReportDate { get; set; }
public virtual UserInstance User { get; set; }
[References(typeof(ClubManager.Api.Services.Query.UserInstance))]
public virtual int? UserId { get; set; }
public virtual int? InstanceType { get; set; }
}
public partial class MessageTemplateInstance
{
public virtual int MessageTemplateId { get; set; }
public virtual string Name { get; set; }
public virtual string Subject { get; set; }
public virtual string Body { get; set; }
public virtual int? ReportId { get; set; }
public virtual int TemplateType { get; set; }
public virtual DateTime? Created { get; set; }
public virtual int? CreatedBy { get; set; }
public virtual DateTime? Modified { get; set; }
public virtual int? ModifiedBy { get; set; }
public virtual DateTime? Deleted { get; set; }
public virtual int? DeletedBy { get; set; }
public virtual int EventType { get; set; }
public virtual int ContentType { get; set; }
public virtual bool? Hidden { get; set; }
public virtual int? ParentMessageTemplateId { get; set; }
public virtual string InclusionTags { get; set; }
public virtual string ExclusionTags { get; set; }
}
public partial class UserInstance
{
public virtual int UserId { get; set; }
public virtual string UserName { get; set; }
public virtual string Name { get; set; }
public virtual string Email { get; set; }
public virtual string MobilePhone { get; set; }
public virtual bool Enabled { get; set; }
public virtual DateTime? LastLogin { get; set; }
public virtual DateTime Created { get; set; }
public virtual bool Training { get; set; }
public virtual bool Deleted { get; set; }
public virtual int CoursesCompleted { get; set; }
public virtual bool? DisplayHomeNotification { get; set; }
public virtual bool TwoFactorEnabled { get; set; }
public virtual bool EmailConfirmed { get; set; }
public virtual bool MobilePhoneConfirmed { get; set; }
public virtual bool Notifications { get; set; }
public virtual DateTime? ChangePassword { get; set; }
public virtual DateTime? Activated { get; set; }
}
}
namespace ServiceStack
{
[DataContract]
public partial class QueryBase
{
public QueryBase()
{
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual int? Skip { get; set; }
[DataMember(Order=2)]
public virtual int? Take { get; set; }
[DataMember(Order=3)]
public virtual string OrderBy { get; set; }
[DataMember(Order=4)]
public virtual string OrderByDesc { get; set; }
[DataMember(Order=5)]
public virtual string Include { get; set; }
[DataMember(Order=6)]
public virtual string Fields { get; set; }
[DataMember(Order=7)]
public virtual Dictionary<string, string> Meta { get; set; }
}
public partial class QueryDb<T>
: QueryBase
{
}
[DataContract]
public partial class QueryResponse<T>
{
public QueryResponse()
{
Results = new List<T>{};
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual int Offset { get; set; }
[DataMember(Order=2)]
public virtual int Total { get; set; }
[DataMember(Order=3)]
public virtual List<T> Results { get; set; }
[DataMember(Order=4)]
public virtual Dictionary<string, string> Meta { get; set; }
[DataMember(Order=5)]
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
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"}}}