Personalization API endpoints

With the Sitefinity Insight API, you can personalize content in an easy and straightforward way.

Endpoint: GET /analytics/v1/personalization/visitor-context

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/personalization/visitor-context
HTTP method GET
Description Use this endpoint for personalization. All available information is returned, and the consumer can decide how to change the served content.
Authentication Required

Parameters

Name Location Required Data type Description
Authorization Header Yes String The access token of the user.
x-dataintelligence-datacenterkey Header Yes Guid The API key of the data center.
x-dataintelligence-datasource Header Yes String The name of the data source where the subject is reported.
x-dataintelligence-subject Header Yes String The subject ID of the visitor you want to check.

Responses

Name Returned data Description
200 OK

{

   Properties: ContactProperty[]

   InPersonas?: PersContextPersona[]

   PassedLeads?:PersContextLead[]

   InCampaigns?: PersContextCampaign[]

}
Returns an object containing:
  • Properties: Contains the values of all ContactProperties. Each object property contains the ID of the respective ContactProperty.
  • InPersonas: Optional. All Persona IDs where a given visitor belongs to.
  • PassedLeads: Optional. IDs of all lead scorings, where a given visitor interactions count with their levels.
  • InCampaigns: Optional. IDs of all campaigns targeting a given visitor.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in thex-dataintelligence-datacenterkeyparameter. Another reason is when a valid key is provided but the authenticated user does not have access to the data center.
412 Precondition Failed GeneralErrorResponse Some of the provided parameters are not valid. Generally, the message states which parameter needs to be fixed.

Personalization Context - Persona

Name Data Type Required Description
PersonaId Int No Contains the ID of the persona, which a given visitor belongs to.

Personalization Context - Leads

Name Data Type Required Description
LeadId Int No Contains the ID of the lead scoring for particular visitor.
LevelId Int No Contains the completed level of given lead scoring for a given visitor.

Personalization Context - Campaign

Name Data Type Required Description
CampaignId Int No Contains the ID of the campaign where a given visitor is targeted.

Sample request and response

HTTP:

GET /analytics/v1/personalization/visitor-context

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-datasource: Demo data
  • x-dataintelligence-subject: 1353

JSON response:

Endpoint: GET /analytics/v2/scorings/leads/in

Resource information

URL https://api.dec.sitefinity.com/analytics/v2/scorings/leads/in
HTTP method GET
Description Gets information about the lead scoring types the visitors are associated to.
Authentication Required

Parameters

Name Location Required Data type Description
Authorization Header Yes String The access token of the user.
x-dataintelligence-datacenterkey Header Yes Guid The API key of the data center.
x-dataintelligence-datasource Header Yes String The name of the data source where the subject is reported.
x-dataintelligence-subject Header Yes String The subject ID of the visitor you want to check.
x-dataintelligence-ids Header No String

The IDs of the lead scoring types in the data center you want check. You can check several lead scoring types at once by separating the IDs with a comma. For example: “10, 25, 36”. 

If you do not provide a parameter, all lead scoring types to which the provided visitors are associated to are  returned.

Responses

Name Returned data Description
200 OK

{

    “items”: LeadScoringResultV2

}

For details, see Lead scoring result API data type v2.

Returns:

  • Data source
  • Visitor ID
  • Current points and dates on which each level was passed for each of the provided lead scoring types Ids the visitor is associated to.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey parameter. Another reason is when a valid key is provided but the authenticated user does not have access to the data center.
412 Precondition Failed GeneralErrorResponse Some of the provided parameters are not valid. Generally, the message states which parameter needs to be fixed.

Sample request and response

HTTP:

GET /analytics/v2/scorings/leads/in

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-datasource: Demo data
  • x-dataintelligence-subject: 1353
  • x-dataintelligence-ids: 73, 74

JSON response:

Endpoint: GET /analytics/v1/scorings/personas/in

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/scorings/personas/in

HTTP method

GET
Description Checks whether the provided subjects are associated to the required personas.
Authentication Required

Parameters

Name Location Required Data type Description
Authorization Header Yes String The access token of the user.
x-dataintelligence-datacenterkey Header Yes Guid The API key of the data center.
x-dataintelligence-datasource Header Yes String The name of the data source where the subject is reported.
x-dataintelligence-subject Header Yes String The subject ID of the visitor you want to check.
x-dataintelligence-ids Header No String

The IDs of the personas in the data center you want check. You can check several personas at once by separating the IDs with a comma. For example: “1, 45, 24”. 

If you do not provide a parameter, all personas to which the provided visitors are associated to are  returned.

Responses

Name Returned data Description
200 OK

{

“items”: ScoringResult []

}

For details, see Scoring result API data type.

Returns:

  • Data source
  • Visitor ID
  • Current points and dates on which each level was passed for each of the provided persona IDs the visitor is associated to.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey parameter. Another reason is when a valid key is provided but the authenticated user does not have access to the data center.
412 Precondition Failed GeneralErrorResponse Some of the provided parameters are not valid. Generally, the message states which parameter needs to be fixed.

Sample request and response

HTTP:

Endpoint: GET https://api.dec.sitefinity.com/analytics/v1/scorings/personas/in

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-datasource: Demo data
  • x-dataintelligence-subject: 1353
  • x-dataintelligence-ids: 59, 60

JSON sample response:

Endpoint: GET /analytics/v1/scorings/leads/in

Resource information     

URL https://api.dec.sitefinity.com/analytics/v1/scorings/leads/in

HTTP method

GET
Description Get information about the lead scoring types whose threshold visitors passed.
Authentication Required

Parameters

Name Location Required Data type Description
Authorization Header Yes String The access token of the user.
x-dataintelligence-datacenterkey Header Yes Guid The API key of the data center.
x-dataintelligence-contacts Header Yes Object

An object containing information about the visitors (clients) to check, grouped by data source name, for example:

{

    "Data Source 1 Name": [“Subject Id of Client 1”,  “Subject Id of Client 2”],

    "Data Source 2 Name": [“Subject Id of Client 3”,  “Subject Id of Client 4”]

}

x-dataintelligence-ids Header No String

The IDs of the lead scoring types in the data center you want check. You can check several lead scoring types at once by separating the IDs with a comma. For example: “10, 25, 46”.

If you do not provide a parameter, all lead scoring types, to which the provided visitors are associated to are returned.

Responses

Name Returned data Description
200 OK

{

LeadScoringResultReport[]

}

For details, see Lead scoring result report API data type.

Returns the lead scoring type ID, current points and dates, on which each scoring type threshold was passed for each of the provided lead scoring types IDs the visitor is associated to.

403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey parameter. Another reason is when a valid key is provided but the authenticated user does not have access to the data center.
412 Precondition Failed GeneralErrorResponse Some of the provided parameters are not valid. Generally, the message states which parameter needs to be fixed.

Sample request and response

HTTP:

Endpoint: GET https://api.dec.sitefinity.com/analytics/v1/scorings/leads/in

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-ids: 73
  • x-dataintelligence-contacts: {"Demo data": ["1353", "1399"], "Learn": ["1254"]}

JSON sample response:

Was this article helpful?