PUT | /users/{UserId} | Update user account info |
---|
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 UserAccountRequestDto
: ApiDtoBase
{
public virtual int UserId { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string HomePhone { get; set; }
public virtual string CellPhone { get; set; }
public virtual string Address1 { 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 DateTime? DateOfBirth { get; set; }
public virtual string Username { get; set; }
public virtual string ExternalId { get; set; }
public virtual string EmergencyContactName { get; set; }
public virtual string EmergencyContactPhone { get; set; }
public virtual string EmergencyContactType { get; set; }
public virtual int? ProspectTypeId { get; set; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Members.Model
{
public partial class UserAccountRequest
: UserAccountRequestDto, 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>
///
///</summary>
[ApiMember(DataType="integer", Description="", IsRequired=true, Name="UserId", ParameterType="query")]
public virtual int UserId { 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>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="FirstName", ParameterType="query")]
public virtual string FirstName { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="LastName", ParameterType="query")]
public virtual string LastName { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="HomePhone", ParameterType="query")]
public virtual string HomePhone { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="CellPhone", ParameterType="query")]
public virtual string CellPhone { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="Address1", ParameterType="query")]
public virtual string Address1 { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="City", ParameterType="query")]
public virtual string City { get; set; }
///<summary>
///(Format:2 characters; Example:'MO')
///</summary>
[ApiMember(DataType="string", Description="(Format:2 characters; Example:'MO')", Name="State", ParameterType="query")]
public virtual string State { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", Name="Zip", ParameterType="query")]
public virtual string Zip { get; set; }
///<summary>
///
///</summary>
[ApiMember(DataType="string", Description="", 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>
///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>
///Username should be between 4 and 255 characters long
///</summary>
[ApiMember(DataType="string", Description="Username should be between 4 and 255 characters long", Name="Username", ParameterType="query")]
public virtual string Username { 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>
///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>
///Prospect Type Id
///</summary>
[ApiMember(DataType="integer", Description="Prospect Type Id", Name="ProspectTypeId", ParameterType="query")]
public virtual int? ProspectTypeId { 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 .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /users/{UserId} HTTP/1.1
Host: clubready.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ApiKey: String,
UserId: 0,
StoreId: 0,
ChainId: 0,
FirstName: String,
LastName: String,
HomePhone: String,
CellPhone: String,
Address1: String,
City: String,
State: String,
Zip: String,
Email: String,
Gender: String,
DateOfBirth: 0001-01-01,
Username: String,
ExternalId: String,
EmergencyContactName: String,
EmergencyContactPhone: String,
EmergencyContactType: String,
ProspectTypeId: 0,
RestrictedId: 0,
RestrictedResourceType: User
}