POST | /users/prospect | Create a Prospect |
---|
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 CreateProspectRequestDto
: ApiDtoBase
{
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string Address { get; set; }
public virtual string City { get; set; }
public virtual string State { get; set; }
public virtual string Zip { get; set; }
public virtual string Email { get; set; }
public virtual string Gender { get; set; }
public virtual int? AddPackageId { get; set; }
public virtual int? ProspectTypeId { get; set; }
public virtual int? ReferralTypeId { get; set; }
public virtual bool SendEmail { get; set; }
public virtual string Phone { get; set; }
public virtual string WorkPhone { get; set; }
public virtual DateTime? DateOfBirth { get; set; }
public virtual string CellPhone { get; set; }
public virtual string Coupon { get; set; }
public virtual string Note { get; set; }
public virtual int? EmailTemplateId { get; set; }
public virtual string ExternalId { get; set; }
public virtual int? ReferredBy { get; set; }
public virtual int? AssignToId { get; set; }
public virtual int AssignToMethod { get; set; }
public virtual int? ContactedHow { get; set; }
public virtual string Username { get; set; }
public virtual string EmergencyContactName { get; set; }
public virtual string EmergencyContactPhone { get; set; }
public virtual string EmergencyContactType { get; set; }
public virtual bool EmailOptOut { get; set; }
public virtual bool? NonPromotionalSmsOptedIn { get; set; }
public virtual bool? PromotionalSmsOptedIn { get; set; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Members.Model
{
public partial class CreateProspectRequest
: CreateProspectRequestDto, 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>
///ClubReady Club ID (StoreID internally)
///</summary>
[ApiMember(DataType="integer", Description="ClubReady Club ID (StoreID internally)", IsRequired=true, Name="StoreId", ParameterType="query")]
public virtual int? StoreId { get; set; }
///<summary>
///First Name
///</summary>
[ApiMember(DataType="string", Description="First Name", IsRequired=true, Name="FirstName", ParameterType="query")]
public virtual string FirstName { get; set; }
///<summary>
///Last Name
///</summary>
[ApiMember(DataType="string", Description="Last Name", IsRequired=true, Name="LastName", ParameterType="query")]
public virtual string LastName { get; set; }
///<summary>
///Email Address
///</summary>
[ApiMember(DataType="string", Description="Email Address", IsRequired=true, Name="Email", ParameterType="query")]
public virtual string Email { get; set; }
///<summary>
///Gender (Format:'M'|'F')
///</summary>
[ApiMember(DataType="string", Description="Gender (Format:'M'|'F')", Name="Gender", ParameterType="query")]
public virtual string Gender { get; set; }
///<summary>
///Address
///</summary>
[ApiMember(DataType="string", Description="Address", Name="Address", ParameterType="query")]
public virtual string Address { get; set; }
///<summary>
///City
///</summary>
[ApiMember(DataType="string", Description="City", Name="City", ParameterType="query")]
public virtual string City { get; set; }
[ApiMember(DataType="string", Name="State", ParameterType="query")]
public virtual string State { get; set; }
[ApiMember(DataType="string", Name="Zip", ParameterType="query")]
public virtual string Zip { get; set; }
///<summary>
///Home phone
///</summary>
[ApiMember(DataType="string", Description="Home phone", Name="Phone", ParameterType="query")]
public virtual string Phone { get; set; }
///<summary>
///Work phone
///</summary>
[ApiMember(DataType="string", Description="Work phone", Name="WorkPhone", ParameterType="query")]
public virtual string WorkPhone { get; set; }
///<summary>
///Date of Birth (Format:YYYY-MM-DD)
///</summary>
[ApiMember(DataType="date", Description="Date of Birth (Format:YYYY-MM-DD)", Name="DateOfBirth", ParameterType="query")]
public virtual DateTime? DateOfBirth { get; set; }
///<summary>
///Cell phone
///</summary>
[ApiMember(DataType="string", Description="Cell phone", Name="CellPhone", ParameterType="query")]
public virtual string CellPhone { get; set; }
///<summary>
///Specify a Package to apply to the new prospect
///</summary>
[ApiMember(DataType="integer", Description="Specify a Package to apply to the new prospect", Name="AddPackageId", ParameterType="query")]
public virtual int? AddPackageId { get; set; }
///<summary>
///Specify a specific Prospect Type for the new prospect
///</summary>
[ApiMember(DataType="integer", Description="Specify a specific Prospect Type for the new prospect", Name="ProspectTypeId", ParameterType="query")]
public virtual int? ProspectTypeId { get; set; }
///<summary>
///Specify a specific Referral Type for the new prospect
///</summary>
[ApiMember(DataType="integer", Description="Specify a specific Referral Type for the new prospect", Name="ReferralTypeId", ParameterType="query")]
public virtual int? ReferralTypeId { get; set; }
///<summary>
///Send a Welcome email to the new prospect (Format:true|false)
///</summary>
[ApiMember(DataType="boolean", Description="Send a Welcome email to the new prospect (Format:true|false)", IsRequired=true, Name="SendEmail", ParameterType="query")]
public virtual bool SendEmail { get; set; }
///<summary>
///Only used if SendEmail = True
///</summary>
[ApiMember(DataType="integer", Description="Only used if SendEmail = True", Name="EmailTemplateId", ParameterType="query")]
public virtual int? EmailTemplateId { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="Coupon", ParameterType="query")]
public virtual string Coupon { get; set; }
///<summary>
///Add an internal note for the new prospect
///</summary>
[ApiMember(DataType="string", Description="Add an internal note for the new prospect", Name="Note", ParameterType="query")]
public virtual string Note { get; set; }
///<summary>
///Unique ID for the user from your system. We store internally as ExternalUserId
///</summary>
[ApiMember(DataType="string", Description="Unique ID for the user from your system. We store internally as ExternalUserId", Name="ExternalId", ParameterType="query")]
public virtual string ExternalId { get; set; }
///<summary>
///User ID of existing user who referred them.
///</summary>
[ApiMember(DataType="integer", Description="User ID of existing user who referred them.", Name="ReferredBy", ParameterType="query")]
public virtual int? ReferredBy { get; set; }
///<summary>
///ClubReady UserId of staff to assign new member to.
///</summary>
[ApiMember(DataType="integer", Description="ClubReady UserId of staff to assign new member to.", Name="AssignToId", ParameterType="query")]
public virtual int? AssignToId { get; set; }
///<summary>
///Who should be assigned to this lead? 0 = Default lead assignments, 1 = When passing in a ReferredBy user, assign the new Lead to that referring user's Staff assignment.
///</summary>
[ApiMember(DataType="integer", Description="Who should be assigned to this lead? 0 = Default lead assignments, 1 = When passing in a ReferredBy user, assign the new Lead to that referring user's Staff assignment.", Name="AssignToMethod", ParameterType="query")]
public virtual int AssignToMethod { get; set; }
///<summary>
///Username needs to be between 4 and 255 characters
///</summary>
[ApiMember(DataType="string", Description="Username needs to be between 4 and 255 characters", Name="Username", ParameterType="query")]
public virtual string Username { get; set; }
///<summary>
///Emergency contact name
///</summary>
[ApiMember(DataType="string", Description="Emergency contact name", Name="EmergencyContactName", ParameterType="query")]
public virtual string EmergencyContactName { get; set; }
///<summary>
///Emergency contact phone number
///</summary>
[ApiMember(DataType="string", Description="Emergency contact phone number", Name="EmergencyContactPhone", ParameterType="query")]
public virtual string EmergencyContactPhone { get; set; }
///<summary>
///Emergency contact relationship
///</summary>
[ApiMember(DataType="string", Description="Emergency contact relationship", Name="EmergencyContactType", ParameterType="query")]
public virtual string EmergencyContactType { get; set; }
///<summary>
///Set a prospect's email opt out status (Format:true|false)
///</summary>
[ApiMember(DataType="boolean", Description="Set a prospect's email opt out status (Format:true|false)", Name="EmailOptOut", ParameterType="query")]
public virtual bool EmailOptOut { get; set; }
///<summary>
///Set a prospect's NonPromotionalSmsOptedIn status (Format:true|false)
///</summary>
[ApiMember(DataType="boolean", Description="Set a prospect's NonPromotionalSmsOptedIn status (Format:true|false)", Name="NonPromotionalSmsOptedIn", ParameterType="query")]
public virtual bool? NonPromotionalSmsOptedIn { get; set; }
///<summary>
///Set a prospect's NonPromotionalSmsOptedIn status (Format:true|false)
///</summary>
[ApiMember(DataType="boolean", Description="Set a prospect's NonPromotionalSmsOptedIn status (Format:true|false)", Name="PromotionalSmsOptedIn", ParameterType="query")]
public virtual bool? PromotionalSmsOptedIn { get; set; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { 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 /users/prospect HTTP/1.1
Host: clubready.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ApiKey":"String","StoreId":0,"FirstName":"String","LastName":"String","Email":"String","Gender":"String","Address":"String","City":"String","State":"String","Zip":"String","Phone":"String","WorkPhone":"String","DateOfBirth":"0001-01-01T00:00:00.0000000","CellPhone":"String","AddPackageId":0,"ProspectTypeId":0,"ReferralTypeId":0,"SendEmail":false,"EmailTemplateId":0,"Coupon":"String","Note":"String","ExternalId":"String","ReferredBy":0,"AssignToId":0,"AssignToMethod":0,"Username":"String","EmergencyContactName":"String","EmergencyContactPhone":"String","EmergencyContactType":"String","EmailOptOut":false,"NonPromotionalSmsOptedIn":false,"PromotionalSmsOptedIn":false,"RestrictedId":0,"RestrictedResourceType":"Store","ContactedHow":0,"ChainId":0}