Difference between revisions of "Getting Member Profile Fields"

From Enterprise Help
Jump to: navigation, search
Line 1: Line 1:
__NOTOC__[[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:
+
__NOTOC__
 +
[[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:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! FieldName !! Type !! Size !! Note
+
! FieldName
 +
! Type
 +
! Size
 +
! Note
 
|-
 
|-
| FirstName || StringField || 100 ||  
+
| FirstName
 +
| StringField
 +
| 100
 +
|  
 
|-
 
|-
| LastName|| 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.  
+
| 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.
+
| 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.
+
| 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 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.
+
| 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.
 
|}
 
|}
  
 +
<br/>To find out all the available profile fields in a given site, send a GET request to the ProfileFields endpoint.
  
To find out all the available profile fields in a given site, send a GET request to the ProfileFields endpoint.
 
  
  
 
==== Example: ====
 
==== Example: ====
  
 
+
   GET [http://enterprise.qa.fishbowl.com/api/odata/v1/SITE_ID/ProfileFields http://services.fishbowl.com/api/odata/v1/SITE_ID/ProfileFields] HTTP/1.1
   GET http://enterprise.qa.fishbowl.com/api/odata/v1/SITE_ID/ProfileFields HTTP/1.1
+
  Accept: application/json
  Accept: application/json
+
  Authorization: Bearer u7kBYz1UhHkoRSc7V4gruBs-4sEpIkFV-F4LGiFMwfGwJNnT_JzNft
  Authorization: Bearer u7kBYz1UhHkoRSc7V4gruBs-4sEpIkFV-F4LGiFMwfGwJNnT_JzNft
+
  g6_Zm0yWi8P m60iPlmCCHUSwCX5Uru-OJq2jzhbT-E6nAc1OwzghTCmeoo0K69ubDBMFX5hyKlc
  g6_Zm0yWi8P m60iPlmCCHUSwCX5Uru-OJq2jzhbT-E6nAc1OwzghTCmeoo0K69ubDBMFX5hyKlc
+
  AjA9H3Vs-ZNjNYKarpSO5rA5ubG5-Va5Aigm9mp-Pre-EaGAY_HBdxZi-LBMSQ_mSjyIDPBpLFYP
  AjA9H3Vs-ZNjNYKarpSO5rA5ubG5-Va5Aigm9mp-Pre-EaGAY_HBdxZi-LBMSQ_mSjyIDPBpLFYP
+
  BNzK3cu0xGobGsFLxPtDG3urs_4abXZtvxN8wm9rpsgr
  BNzK3cu0xGobGsFLxPtDG3urs_4abXZtvxN8wm9rpsgr
+
  
  
Line 39: Line 63:
  
 
   {   
 
   {   
      "odata.metadata":"https://enterprise.qa.fishbowl.com/API/odata/v1/2147483947/
+
    "odata.metadata":"[https://enterprise.qa.fishbowl.com/API/odata/v1/2147483947/ https://services.fishbowl.com/API/odata/v1/2147483947/]
                        $metadata#ProfileFields",
+
                      $metadata#ProfileFields",
      "value":[   
+
    "value":[   
        {   
+
        {   
            "Name":"Anniversary",
+
          "Name":"Anniversary",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"Wedding Anniversary",
+
          "DisplayName":"Wedding Anniversary",
            "FieldType":"InternationalDateField",
+
          "FieldType":"InternationalDateField",
            "DataType":"System.DateTime",
+
          "DataType":"System.DateTime",
            "Indexed":false,
+
          "Indexed":false,
            "MaximumLength":0
+
          "MaximumLength":0
        },
+
        },
        {   
+
        {   
            "Name":"Birthdate",
+
          "Name":"Birthdate",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"Birth Date",
+
          "DisplayName":"Birth Date",
            "FieldType":"DateField",
+
          "FieldType":"DateField",
            "DataType":"System.DateTime",
+
          "DataType":"System.DateTime",
            "Indexed":true,
+
          "Indexed":true,
            "MaximumLength":0
+
          "MaximumLength":0
        },
+
        },
        {   
+
        {   
            "Name":"FirstName",
+
          "Name":"FirstName",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"First Name",
+
          "DisplayName":"First Name",
            "FieldType":"StringField",
+
          "FieldType":"StringField",
            "DataType":"System.String",
+
          "DataType":"System.String",
            "Indexed":true,
+
          "Indexed":true,
            "MaximumLength":100
+
          "MaximumLength":100
        },
+
        },
        {   
+
        {   
            "Name":"InputSource",
+
          "Name":"InputSource",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"Input Source",
+
          "DisplayName":"Input Source",
            "FieldType":"StringField",
+
          "FieldType":"StringField",
            "DataType":"System.String",
+
          "DataType":"System.String",
            "Indexed":false,
+
          "Indexed":false,
            "MaximumLength":100
+
          "MaximumLength":100
        },
+
        },
        {   
+
        {   
            "Name":"JoinDate",
+
          "Name":"JoinDate",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"JoinDate",
+
          "DisplayName":"JoinDate",
            "FieldType":"DateField",
+
          "FieldType":"DateField",
            "DataType":"System.DateTime",
+
          "DataType":"System.DateTime",
            "Indexed":false,
+
          "Indexed":false,
            "MaximumLength":0
+
          "MaximumLength":0
        },
+
        },
        {   
+
        {   
            "Name":"LastName",
+
          "Name":"LastName",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"Last Name",
+
          "DisplayName":"Last Name",
            "FieldType":"StringField",
+
          "FieldType":"StringField",
            "DataType":"System.String",
+
          "DataType":"System.String",
            "Indexed":true,
+
          "Indexed":true,
            "MaximumLength":100         
+
          "MaximumLength":100         
        },
+
        },
        {   
+
        {   
            "Name":"Phone",
+
          "Name":"Phone",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"Primary Phone Number",
+
          "DisplayName":"Primary Phone Number",
            "FieldType":"PhoneField",
+
          "FieldType":"PhoneField",
            "DataType":"System.String",
+
          "DataType":"System.String",
            "Indexed":false,
+
          "Indexed":false,
            "MaximumLength":14
+
          "MaximumLength":14
        },         
+
        },         
        {   
+
        {   
            "Name":"StoreCode",
+
          "Name":"StoreCode",
            "SiteID":"2147483947",
+
          "SiteID":"2147483947",
            "DisplayName":"StoreCode",
+
          "DisplayName":"StoreCode",
            "FieldType":"StoreField",
+
          "FieldType":"StoreField",
            "DataType":"System.String",
+
          "DataType":"System.String",
            "Indexed":true,
+
          "Indexed":true,
            "MaximumLength":100
+
          "MaximumLength":100
        }
+
        }
      ]
+
    ]
  }
+
  }
  
  
Line 123: Line 147:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! DataType !Member Attribute  
+
! DataType
 +
! Member Attribute
 
|-
 
|-
| System.String |StringFields  
+
| System.String
 +
| StringFields
 
|-
 
|-
| System.Boolean |BooleanFields
+
| System.Boolean
 +
| BooleanFields
 
|-
 
|-
| System.DateTime |DateFields  
+
| System.DateTime
 +
| DateFields
 
|-
 
|-
| System.Int32 |Int32Fields  
+
| System.Int32
 +
| Int32Fields
 
|-
 
|-
| System.Int64 |Int64Fields
+
| System.Int64
 +
| Int64Fields
 
|-
 
|-
| System.Decimal |DecimalFields
+
| System.Decimal
 +
| DecimalFields
 
|}
 
|}
+
 
+
 
  
 
==== Example: ====
 
==== Example: ====
  
 
   {
 
   {
      "MemberID":"2148166490",       
+
    "MemberID":"2148166490",       
      "StringFields":[
+
    "StringFields":[
        {
+
        {
            "Name":"StoreCode",
+
          "Name":"StoreCode",
            "Value":"001"
+
          "Value":"001"
        }
+
        }
      ],
+
    ],
      "DateFields":[
+
    "DateFields":[
        {
+
        {
            "Name":"Birthdate",
+
          "Name":"Birthdate",
            "Value":"1989-04-03T00:00:00"
+
          "Value":"1989-04-03T00:00:00"
        },
+
        },
        {
+
        {
            "Name":"Anniversary",
+
          "Name":"Anniversary",
            "Value":"1999-02-23T00:00:00"
+
          "Value":"1999-02-23T00:00:00"
        }
+
        }
      ]
+
    ]
      "BooleanFields":[
+
    "BooleanFields":[
        {
+
        {
            "Name":"VIP",
+
          "Name":"VIP",
            "Value":"true"
+
          "Value":"true"
        }
+
        }
      ],
+
    ],
      "Int32Fields":[
+
    "Int32Fields":[
        {
+
        {
            "Name":"NumberOfChildren",
+
          "Name":"NumberOfChildren",
            "Value":"3"
+
          "Value":"3"
        }
+
        }
      ]
+
    ]
  }
+
  }

Revision as of 07:45, 14 May 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.


To find out all the available profile fields in a given site, send a GET request to the ProfileFields endpoint.


Example:

  GET http://services.fishbowl.com/api/odata/v1/SITE_ID/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


Response:

  {  
    "odata.metadata":"https://services.fishbowl.com/API/odata/v1/2147483947/
                      $metadata#ProfileFields",
    "value":[  
       {  
          "Name":"Anniversary",
          "SiteID":"2147483947",
          "DisplayName":"Wedding Anniversary",
          "FieldType":"InternationalDateField",
          "DataType":"System.DateTime",
          "Indexed":false,
          "MaximumLength":0
       },
       {  
          "Name":"Birthdate",
          "SiteID":"2147483947",
          "DisplayName":"Birth Date",
          "FieldType":"DateField",
          "DataType":"System.DateTime",
          "Indexed":true,
          "MaximumLength":0
       },
       {  
          "Name":"FirstName",
          "SiteID":"2147483947",
          "DisplayName":"First Name",
          "FieldType":"StringField",
          "DataType":"System.String",
          "Indexed":true,
          "MaximumLength":100
       },
       {  
          "Name":"InputSource",
          "SiteID":"2147483947",
          "DisplayName":"Input Source",
          "FieldType":"StringField",
          "DataType":"System.String",
          "Indexed":false,
          "MaximumLength":100
       },
       {  
          "Name":"JoinDate",
          "SiteID":"2147483947",
          "DisplayName":"JoinDate",
          "FieldType":"DateField",
          "DataType":"System.DateTime",
          "Indexed":false,
          "MaximumLength":0
       },
       {  
          "Name":"LastName",
          "SiteID":"2147483947",
          "DisplayName":"Last Name",
          "FieldType":"StringField",
          "DataType":"System.String",
          "Indexed":true,
          "MaximumLength":100         
       },
       {  
          "Name":"Phone",
          "SiteID":"2147483947",
          "DisplayName":"Primary Phone Number",
          "FieldType":"PhoneField",
          "DataType":"System.String",
          "Indexed":false,
          "MaximumLength":14
       },         
       {  
          "Name":"StoreCode",
          "SiteID":"2147483947",
          "DisplayName":"StoreCode",
          "FieldType":"StoreField",
          "DataType":"System.String",
          "Indexed":true,
          "MaximumLength":100
       }
    ]
 }


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


Example:

  {
    "MemberID":"2148166490",      
    "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"
       }
    ]
 }