Loading...
Area: Episerver Profile Store
Applies to versions: 1.3.0 and higher

Profile methods

This topic describes the GET, POST, PUT and DELETE methods of the Episerver Profile Store API, used for querying profile data in Profile Store. Profiles are used for storing aggregated data from visitor interactions.

In this topic

GET api/v1.0/profiles/{scope}/{profileid}

  • Returns HTTP 200 OK with the profile in the response body, for the ID provided.
  • Returns HTTP 404 NOT FOUND if no profile with the ID was found.

Example of response body:

{
  "ProfileId"          : "6243d1c0-70dd-453e-9cc4-63c577cb25ad",
  "DeviceIds"          : [
                           "9f4447e4-9f00-4fa8-ad30-a1a971d4fbf6"
                         ],
  "Name"               : "Nikki A Blomqvist",
  "ProfileManager"     : null, 
  "FirstSeen"          : "2017-12-01T12:34:56",
  "LastSeen"           : "2018-05-19T11:33:12",
  "Visits"             : 1150,
  "UpdateTime"         : "2019-03-06T21:29:38.4088275Z",
  "Scope"              : "DefaultScope"
  "Info"               : {
                           "Website" : "https://example.com"
                           "Picture" : "http://example.com/Nikki A Blomqvist_avatar.png",
                           "Country" : "SW",
                           "Email"   : "Nikki.Blomqvist@example.com"
                         },
  "ContactInformation" : [
                           "Mailable",
                           "Anonymous"
                         ],
  "Payload"            : {
                           "customField"      : 14,
                           "otherCustomField" : "apple"
                         }
}

POST api/v1.0/profiles/

  • Maximum request body size: 256KB
  • Creates a new profile object.

Example of request body. (Note that ID should be not sent because it is generated by the API. Similarly, UpdateTime is set by the API prior to saving the profile)

{
  "DeviceIds"      : [
                       "1f68f8a6-894b-42ce-aa2a-d5110eba1fba"
                     ],
  "Name"           : "Luke Skywalker",
  "ProfileManager" : null,
  "LastSeen"       : "2018-06-15T00:00:00",
  "Scope"          : "CommerceSite",
  "Visits"         : 1205,
  "Info"           : {
                       "Website"          : "https://example.com"
                       "Picture"          : "http://example.com/profile/luke_avatar.png",
                       "InferredCountry"  : "Sweden",
                       "Email"            : "Luke.Skywalker@example.com"
                     },
  "Payload"        : {
                       "customField"      : 10,
                       "otherCustomField" : "banana"
                     }
}
  • In case Scope is null or no Scope is sent, the default value for Scope will be default.
  • Returns HTTP 201 CREATED with the created profile in the response body, and with the same structure as when retrieving a profile with the GET method as described above.

    The HTTP response header Location contains the URL to the profile:

    HTTP/1.1 201 Created Location: http://www.example.org/api/v1.0/profiles/df9fbdb3-4141-4d85-b37b-f5664b11a9dc
  • Returns HTTP 413 REQUEST ENTITY TOO LARGE if request body is > 256KB.

PUT api/v1.0/profiles/{id}

  • Maximum request body size: 256KB
  • Replaces an existing profile, or creates a new one if no profile with the specified ID was found.
  • Similar to the POST API, the PUT API sets the UpdateTime of the Profile before udapting it.
  • Returns:
    • HTTP 201 CREATED (same response as POST method) if profile with ID was not found, so it was created.
    • HTTP 200 OK when a profile was found and replaced (same response as GET method).
    • HTTP 413 REQUEST ENTITY TOO LARGE if request body is > 256KB.
    • HTTP 409 CONFLICT if a profile cannot be replaced due to duplication.

      Profile is considered as duplicated when:

      • An existing profile containing the deviceId is found in Profile Store.
      • An existing profile with same email is found (Info.Email) in Profile Store.
    • HTTP 400 BAD REQUEST if invalid data is found in the request.
      • First seen is greater than last seen.
      • Invalid ISO 3166-1 alpha-2 country code in Info.Country or Info. InferredCountry field. Note that only upper-case code is accepted.
      • Visitor groups list exceeds 1000 elements.
      • Scope does not exist.
      • Info.ZipCode is an invalid zip code.
      • Info.Website is an invalid domain name or URL.
      • Info.Email is an invalid email address.
      • Info.Mobile is an invalid phone number.
      • Info.Phone is an invalid phone number.

DELETE  api/v1.0/profiles/{scope}/{profileid}

  • Returns HTTP 200 OK in case the deletion of both profile and its related track events was succesful.
  • Returns HTTP 404 NOT FOUND if no profile with the ID was found.
  • Returns HTTP 500 INTERNAL SERVER ERROR in situations where the profile and its related track events was unexceptedly unsuccesful.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Sep 27, 2018