POST | /v2/{ApiKey}/club/{StoreId}/prospect | (obsolete) 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 CreateProspectRequestV2Dto
: 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; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Members.Model
{
public partial class CreateProspectRequestV2
: CreateProspectRequestV2Dto, 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
///</summary>
[ApiMember(DataType="string", Description="Gender", 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; }
public virtual string Phone { get; set; }
public virtual string WorkPhone { get; set; }
public virtual DateTime? DateOfBirth { get; set; }
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
///</summary>
[ApiMember(DataType="boolean", Description="Send a Welcome email to the new prospect", 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; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { get; set; }
}
}
C# CreateProspectRequestV2 DTOs
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.
POST /v2/{ApiKey}/club/{StoreId}/prospect HTTP/1.1
Host: clubready.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateProspectRequestV2 xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Members.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<AddPackageId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</AddPackageId>
<Address xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Address>
<CellPhone xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</CellPhone>
<City xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</City>
<Coupon xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Coupon>
<DateOfBirth xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0001-01-01T00:00:00</DateOfBirth>
<Email xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Email>
<EmailTemplateId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</EmailTemplateId>
<FirstName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</FirstName>
<Gender xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Gender>
<LastName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</LastName>
<Note xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Note>
<Phone xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Phone>
<ProspectTypeId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ProspectTypeId>
<ReferralTypeId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ReferralTypeId>
<SendEmail xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</SendEmail>
<State xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</State>
<WorkPhone xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</WorkPhone>
<Zip xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Zip>
</CreateProspectRequestV2>