GET | /users | Get users list filtered by date |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubReady.Web.Api.Members.Model;
using ClubReady.Core.Api.Models;
using ClubReady.Web.Api;
namespace ClubReady.Core.Api.Models
{
public partial class ApiDtoBase
{
public virtual string ApiKey { get; set; }
public virtual int? StoreId { get; set; }
public virtual int? ChainId { get; set; }
}
public partial class UsersListRequestDto
: ApiDtoBase
{
public virtual string Segment { get; set; }
public virtual string ActivityDate { get; set; }
public virtual string ActivityOperator { get; set; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Members.Model
{
public partial class UsersListRequest
: UsersListRequestDto, IRestrictedApiRequest
{
///<summary>
///Api Key - grants access to resources
///</summary>
[ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")]
public virtual string ApiKey { get; set; }
///<summary>
///StoreId OR ChainId is required
///</summary>
[ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="StoreId", ParameterType="query")]
public virtual int? StoreId { get; set; }
///<summary>
///StoreId OR ChainId is required
///</summary>
[ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="ChainId", ParameterType="query")]
public virtual int? ChainId { get; set; }
///<summary>
///Date to use for filter
///</summary>
[ApiMember(DataType="Date", Description="Date to use for filter", IsRequired=true, Name="ActivityDate", ParameterType="query")]
public virtual string ActivityDate { get; set; }
///<summary>
///The operator to use when comparing ActivityDate. Options are GT,EQ and LT for Greater Than, Equal and Less Than. Defaults to GT if not provided.
///</summary>
[ApiMember(DataType="String", Description="The operator to use when comparing ActivityDate. Options are GT,EQ and LT for Greater Than, Equal and Less Than. Defaults to GT if not provided.", Name="ActivityOperator", ParameterType="query")]
public virtual string ActivityOperator { get; set; }
///<summary>
///Filter by a specific segment. Types: Prospects, Active, Inactive, All, PastDue
///</summary>
[ApiMember(DataType="string", Description="Filter by a specific segment. Types: Prospects, Active, Inactive, All, PastDue", Name="Segment", ParameterType="query")]
public virtual string Segment { get; set; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { get; set; }
///<summary>
///Version 2 adds email and mobile phone to output
///</summary>
[ApiMember(DataType="string", Description="Version 2 adds email and mobile phone to output", Name="Version", ParameterType="query")]
public virtual int? Version { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /users HTTP/1.1 Host: clubready.com Accept: application/xml