Query Customer Profile
GET /profiles/${customer_id} |
Description
Queries the Customer Profile based on the customer ID parameter. According to the query's fields, your application can retrieve profile and extension attributes in addition to the identified customer ID. The response always contains all attributes of the customer profile resource, and all attributes of the specified extensions, to avoid ambiguity in further updates (see Update Customer Profile).
Operation
Prerequisites: A Customer Profile Schema (a list of Attribute Schema) is available.
ID | CV.WS.PROF.1 | ||
---|---|---|---|
Method | GET | ||
URL | /profiles/${customer_id} | ||
Field Name | Type | Mandatory | Description |
URI Parameters | |||
${customer_id} | string | yes | Specified in the URI, the ID of the customer. |
extensions | string | no | The list of extensions to return within the result. Your application can specify multiple extension names, separated with comas. For instance: extensions=contacts,purchases |
Response
The Context Management Service API answers with HTTP codes for every request. The following table shows the correct response for a successful request. See [[HTTP Response Codes and Errors for further details on the possible codes that this operation can return.
HTTP code | 200 | ||
---|---|---|---|
HTTP message | OK | ||
Field Name | Type | Mandatory | Description |
Body: Customer Profile. The returned result contains parts of the profile or the complete profile according to the parameters of the request. See Customer Profile for further information on the resource. | |||
customer_id | string | yes | The unique ID of the given customer. Limited to 16 characters. |
<attribute n> |
|
yes | Customer attributes, where <attribute n> is the attribute name. See the configuration options for further details. Attributes are not part of a separated array, see the example below.
The date/time formats are ISO 8601: |
<extension n> | Extension or Extension[] |
no | By default, no extension is returned. The returned extensions are specified in the parameters of the request. For further details, see Extension. |
<references />
Example
For example, the customer profile (id=0004Va58A92T0017) has three attributes: "name","birthdate" and "EmailAddress". This profile also has two defined extensions:
- contacts: one or more phone numbers (a multi-valued extension).
- preferences: a single-valued extension representing customer preferences for receiving a weekly newsletter, receiving notification of new offers, and the desired email type.
Operation
GET /profiles/0004Va58A92T0017?extensions=contacts,preferences
Result
200 OK { "customer_id": "0004Va58A92T0017 ", "name": "Doe, John", "birthdate": "1976-05-10", "EmailAddress": [ "john.doe@genesyslab.com", "jd34@hotmail.dom"], "contacts": [ {"phone": "408-555-1234", "ext": "1234"}, {"phone": "408-832-7712"} ], "preferences": { "newsletter": "y", "new_offers": "n", "email": "html" } }