Difference between revisions of "Getting Member Profile Fields"

From Enterprise Help
Jump to: navigation, search
Line 45: Line 45:
 
|}
 
|}
  
<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.
+
<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.
  
  
Line 63: Line 63:
  
 
   {   
 
   {   
  "odata.metadata":"https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields",
+
  "odata.metadata":"[https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields https://services.fishbowl.com/API/odata/v1/1234567890/$metadata#ProfileFields]",
  "value":[   
+
  "value":[   
      {   
+
    {   
        "Name":"Anniversary",
+
        "Name":"Anniversary",
        "SiteID":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "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":"1234567890",
+
        "SiteID":"1234567890",
        "DisplayName":"StoreCode",
+
        "DisplayName":"StoreCode",
        "FieldType":"StoreField",
+
        "FieldType":"StoreField",
        "DataType":"System.String",
+
        "DataType":"System.String",
        "Indexed":true,
+
        "Indexed":true,
        "MaximumLength":100
+
        "MaximumLength":100
      }
+
    }
  ]
+
  ]
 
  }
 
  }
  
Line 175: Line 175:
  
 
   {
 
   {
  "MemberID":"9876543210",       
+
  "MemberID":"9876543210",       
  "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 16:48, 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.


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"
    }
 ]
}