Difference between revisions of "Getting Member Profile Fields"
From Enterprise Help
Line 1: | Line 1: | ||
− | |||
[[Profile Fields|Profile fields]] are the various pieces of data about [[Members]], such as first name, last name, birthdate, phone number and so forth. Each site has its own collections of profile fields, so users can add their own custom profile fields. Most sites include with the following profile fields at a minimum: | [[Profile Fields|Profile fields]] are the various pieces of data about [[Members]], such as first name, last name, birthdate, phone number and so forth. Each site has its own collections of profile fields, so users can add their own custom profile fields. Most sites include with the following profile fields at a minimum: | ||
Line 45: | Line 44: | ||
|} | |} | ||
− | |||
+ | == '''Get Member Profile Field Data for a Site'''<br/> == | ||
+ | |||
+ | To find out all the available profile fields in a given site ([[Getting Site Information|get a SiteID]]), send a GET request to the ProfileFields endpoint. | ||
==== Sample Request<span class="mw-headline" id="Sample_Request_.28Using_1234567890_as_the_SiteID.29:">(Using 1234567890 as the SiteID</span>):<br/> ==== | ==== Sample Request<span class="mw-headline" id="Sample_Request_.28Using_1234567890_as_the_SiteID.29:">(Using 1234567890 as the SiteID</span>):<br/> ==== | ||
Line 63: | Line 64: | ||
{ | { | ||
− | + | "odata.metadata":"[https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields]", | |
− | + | "value":[ | |
− | + | { | |
− | + | "Name":"Anniversary", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"Wedding Anniversary", | |
− | + | "FieldType":"InternationalDateField", | |
− | + | "DataType":"System.DateTime", | |
− | + | "Indexed":false, | |
− | + | "MaximumLength":0 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"Birthdate", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"Birth Date", | |
− | + | "FieldType":"DateField", | |
− | + | "DataType":"System.DateTime", | |
− | + | "Indexed":true, | |
− | + | "MaximumLength":0 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"FirstName", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"First Name", | |
− | + | "FieldType":"StringField", | |
− | + | "DataType":"System.String", | |
− | + | "Indexed":true, | |
− | + | "MaximumLength":100 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"InputSource", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"Input Source", | |
− | + | "FieldType":"StringField", | |
− | + | "DataType":"System.String", | |
− | + | "Indexed":false, | |
− | + | "MaximumLength":100 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"JoinDate", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"JoinDate", | |
− | + | "FieldType":"DateField", | |
− | + | "DataType":"System.DateTime", | |
− | + | "Indexed":false, | |
− | + | "MaximumLength":0 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"LastName", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"Last Name", | |
− | + | "FieldType":"StringField", | |
− | + | "DataType":"System.String", | |
− | + | "Indexed":true, | |
− | + | "MaximumLength":100 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"Phone", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"Primary Phone Number", | |
− | + | "FieldType":"PhoneField", | |
− | + | "DataType":"System.String", | |
− | + | "Indexed":false, | |
− | + | "MaximumLength":14 | |
− | + | }, | |
− | + | { | |
− | + | "Name":"StoreCode", | |
− | + | "SiteID":"1234567890", | |
− | + | "DisplayName":"StoreCode", | |
− | + | "FieldType":"StoreField", | |
− | + | "DataType":"System.String", | |
− | + | "Indexed":true, | |
− | + | "MaximumLength":100 | |
− | + | } | |
− | + | ] | |
} | } | ||
− | == Editing Member Profile Field Data<br/> == | + | == '''Editing Member Profile Field Data'''<br/> == |
For each profile field, take note of the DataType because it determines which member attribute you need to add the profile field name-value pair to when creating/updating member. | For each profile field, take note of the DataType because it determines which member attribute you need to add the profile field name-value pair to when creating/updating member. | ||
Line 175: | Line 176: | ||
{ | { | ||
− | + | "MemberID":"9876543210", | |
− | + | "StringFields":[ | |
− | + | { | |
− | + | "Name":"StoreCode", | |
− | + | "Value":"001" | |
− | + | } | |
− | + | ], | |
− | + | "DateFields":[ | |
− | + | { | |
− | + | "Name":"Birthdate", | |
− | + | "Value":"1989-04-03T00:00:00" | |
− | + | }, | |
− | + | { | |
− | + | "Name":"Anniversary", | |
− | + | "Value":"1999-02-23T00:00:00" | |
− | + | } | |
− | + | ] | |
− | + | "BooleanFields":[ | |
− | + | { | |
− | + | "Name":"VIP", | |
− | + | "Value":"true" | |
− | + | } | |
− | + | ], | |
− | + | "Int32Fields":[ | |
− | + | { | |
− | + | "Name":"NumberOfChildren", | |
− | + | "Value":"3" | |
− | + | } | |
− | + | ] | |
} | } |
Latest revision as of 17:10, 8 June 2015
Profile fields are the various pieces of data about Members, such as first name, last name, birthdate, phone number and so forth. Each site has its own collections of profile fields, so users can add their own custom profile fields. Most sites include with the following profile fields at a minimum:
FieldName | Type | Size | Note |
---|---|---|---|
FirstName | StringField | 100 | |
LastName | StringField | 100 | |
StoreCode | StringField | 100 | This value indicates the location that the member is associated with. StoreCode format is typically 001, 002, 003, and so on. |
InputSource | StringField | 100 | This value indicates how a member is created (example: through a subscribe page, through API Integration, etc.). Do not update an existing input source value during PATCH/UPDATE requests. |
Birthdate | DateField | If applicable, members will receive special mailing for their birthday. | |
Example | DateField | If applicable, members will receive special mailing for their anniversary. | |
Example | DateField | If applicable, members will receive special welcome mailing. Please set to the current date when creating a member. Do not update this field during PATCH/UPDATE requests. |
Contents
Get Member Profile Field Data for a Site
To find out all the available profile fields in a given site (get a SiteID), send a GET request to the ProfileFields endpoint.
Sample Request(Using 1234567890 as the SiteID):
GET http://services.fishbowl.com/api/odata/v1/1234567890/ProfileFields HTTP/1.1 Accept: application/json Authorization: Bearer u7kBYz1UhHkoRSc7V4gruBs-4sEpIkFV-F4LGiFMwfGwJNnT_JzNft g6_Zm0yWi8P m60iPlmCCHUSwCX5Uru-OJq2jzhbT-E6nAc1OwzghTCmeoo0K69ubDBMFX5hyKlc AjA9H3Vs-ZNjNYKarpSO5rA5ubG5-Va5Aigm9mp-Pre-EaGAY_HBdxZi-LBMSQ_mSjyIDPBpLFYP BNzK3cu0xGobGsFLxPtDG3urs_4abXZtvxN8wm9rpsgr
Sample Response:
{ "odata.metadata":"https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields", "value":[ { "Name":"Anniversary", "SiteID":"1234567890", "DisplayName":"Wedding Anniversary", "FieldType":"InternationalDateField", "DataType":"System.DateTime", "Indexed":false, "MaximumLength":0 }, { "Name":"Birthdate", "SiteID":"1234567890", "DisplayName":"Birth Date", "FieldType":"DateField", "DataType":"System.DateTime", "Indexed":true, "MaximumLength":0 }, { "Name":"FirstName", "SiteID":"1234567890", "DisplayName":"First Name", "FieldType":"StringField", "DataType":"System.String", "Indexed":true, "MaximumLength":100 }, { "Name":"InputSource", "SiteID":"1234567890", "DisplayName":"Input Source", "FieldType":"StringField", "DataType":"System.String", "Indexed":false, "MaximumLength":100 }, { "Name":"JoinDate", "SiteID":"1234567890", "DisplayName":"JoinDate", "FieldType":"DateField", "DataType":"System.DateTime", "Indexed":false, "MaximumLength":0 }, { "Name":"LastName", "SiteID":"1234567890", "DisplayName":"Last Name", "FieldType":"StringField", "DataType":"System.String", "Indexed":true, "MaximumLength":100 }, { "Name":"Phone", "SiteID":"1234567890", "DisplayName":"Primary Phone Number", "FieldType":"PhoneField", "DataType":"System.String", "Indexed":false, "MaximumLength":14 }, { "Name":"StoreCode", "SiteID":"1234567890", "DisplayName":"StoreCode", "FieldType":"StoreField", "DataType":"System.String", "Indexed":true, "MaximumLength":100 } ] }
Editing Member Profile Field Data
For each profile field, take note of the DataType because it determines which member attribute you need to add the profile field name-value pair to when creating/updating member.
DataType | Member Attribute |
---|---|
System.String | StringFields |
System.Boolean | BooleanFields |
System.DateTime | DateFields |
System.Int32 | Int32Fields |
System.Int64 | Int64Fields |
System.Decimal | DecimalFields |
Sample Code:
{ "MemberID":"9876543210", "StringFields":[ { "Name":"StoreCode", "Value":"001" } ], "DateFields":[ { "Name":"Birthdate", "Value":"1989-04-03T00:00:00" }, { "Name":"Anniversary", "Value":"1999-02-23T00:00:00" } ] "BooleanFields":[ { "Name":"VIP", "Value":"true" } ], "Int32Fields":[ { "Name":"NumberOfChildren", "Value":"3" } ] }