Management of contact data endpoints

Delete contact data

POST /analytics/v1/contacts/delete-requests

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/delete-requests
HTTP method POST
Description Create a new delete contact request.
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

Request body

Name Required Data type Description
JSON root Yes SubjectID[] The array of the subject (tracking ID) and data source pairs you want to delete

Responses

Name Returned data Description
200 OK DeleteContactRequest Returns the created deletion request.
400 Bad Request GeneralErrorResponse Returned when an invalid property is provided in the JSON.
401 Unauthorized Unauthorized Returned when an invalid or expired token is provided in the Authorization header.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid, but the authenticated user does not have access to this data center.
412 Precondition Failed GeneralErrorResponse Returned when the provided JSON is invalid or empty.

Sample request and response

The following request creates a new request for deletion of data for a contact reported to the Website data source with a tracking ID 183:

HTTP:

POST /analytics/v1/contacts/delete-requests

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9

Body JSON:

GET /analytics/v1/contacts/delete-requests

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/delete-requests
HTTP method GET
Description Get all delete requests in a specific data center.
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-skip Header No Integer Number of items to skip. Default value is 0
x-dataintelligence-take Header No Integer Number of items to take. Default value is 20
x-dataintelligence-filter Header No

{
  
"PropertyName":
  
"PropertyValue"
}

You can filter the delete requests by some of their properties. The allowed properties are Status and CreatedOn
x-dataintelligence-count Header No Boolean A flag for whether a count property with the total number of delete requests in the data center is returned

Responses

Name Returned data Description
200 OK

{
    "items": DeleteContactRequest[],   
    "count": Integer
}

For more information, see DeleteContactRequest API data type.

Returns a collection containing data delete requests. The count property is returned only if the x-dataintelligence-count parameter is set to true.
400 Bad Request GeneralErrorResponse Returned when an invalid property is provided in the JSON
401 Unauthorized Unauthorized Returned when an invalid or expired token is provided in the Authorization header.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center.
412 Precondition Failed GeneralErrorResponse Returned when the provided JSON is invalid or empty

Sample request and response

The following request will filter only delete requests, which are with status Done.

HTTP:

GET https://api.dec.sitefinity.com/analytics/v1/contacts/delete-requests

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-filter: {“Status”: “Done”}

Sample JSON response:

 

GET /analytics/v1/contacts/delete-requests/{request-id}

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/delete-requests/{request-id}
HTTP method GET
Description Get a delete request by I
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
request-id URI path Yes Integer The ID of the delete request you want to retrieve

Responses

Name Returned data Description
200 OK

DeleteContactRequest

Returns the data delete request with the provided ID
400 Bad Request GeneralErrorResponse Returned when the provided ID is not a valid integer
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center.
412 Not Found GeneralErrorResponse A delete request with the provided ID does not exist

Sample request and response

The following request will get the delete request with ID 83.

HTTP:

GET https://api.dec.sitefinity.com/analytics/v1/contacts/delete-requests/83

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9

Sample JSON response:

 

Export contact data

POST /analytics/v1/contacts/export-requests

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests
HTTP method POST
Description Create a new export request.
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

Request body

Name Required Data type Description
JSON root Yes

{
"TargetSubjectsJson":  SubjectId[]
}

For more information, see Subject ID API data type.

The array of the subject (tracking ID) and data source pairs you wish to export the data of

Responses

Name Returned data Description
200 OK ExportContactsRequest Returns the created export request
400 Bad Request GeneralErrorResponse Returned when an invalid property is provided in the JSON
401 Unauthorized Unauthorized Returned when an invalid or expired token is provided in the Authorization header
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center
412 Precondition Failed GeneralErrorResponse Returned when the provided JSON is invalid or empty

Sample request and response

The following request creates a new export data request for a contact reported to the “Website” data source with a tracking ID “185”.

HTTP:

POST https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9

Body JSON:

Sample JSON response:

GET /analytics/v1/contacts/export-requests

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests
HTTP method GET
Description Get all export requests in a specific data center.
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-skip Header No Integer Number of items to skip. Default value is 0.
x-dataintelligence-take Header No Integer Number of items to take. Default value is 20.
x-dataintelligence-filter Header No

{
 "
PropertyName":
 
"PropertyValue"
}

You can filter the delete requests by some of their properties. The allowed properties are Status and CreatedOn.
x-dataintelligence-count Header No Boolean A flag for whether a count property with the total number of delete requests in the data center is returned.

Responses

Name Returned data Description
200 OK

{
"items": ExportContactRequest[],
"count": Integer
}

For more information, see ExportContactRequest API data type.

Returns a collection containing data delete requests. The count property is returned only if the x-dataintelligence-count parameter is set to true.
400 Bad Request GeneralErrorResponse Returned when a valid JSON is provided in the sort or filter parameters but the property you are trying to sort or filter by is not supported.
401 Unauthorized Unauthorized Returned when an invalid or expired token is provided in the Authorization header.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center.
412 Precondition Failed GeneralErrorResponse Returned when some of the provided parameters (filter, skip, or take) are not valid. Usually the message states which parameter needs to be fixed.

Sample request and response

The following request filters only export requests, which are with status DataPrepared.

HTTP:

GET https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9
  • x-dataintelligence-filter: {“Status”: “DataPrepared”}

Sample JSON response:

 

GET /analytics/v1/contacts/export-requests/{request-id}

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests/{request-id}
HTTP method GET
Description Get an export request by ID.
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.
request-id URI path Yes Integer The ID of the delete request you want to retrieve.

Responses

Name Returned data Description
200 OK ExportContactRequest Returns the data export request with the provided ID.
400 Bad Request GeneralErrorResponse Returned when the provided ID is not a valid integer.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center.
412 Not Found GeneralErrorResponse A delete request with the provided ID does not exist.

Sample request and response

The following request will get the export request with ID 150.

HTTP:

GET https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests/150

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9

Sample JSON response:

 

GET /analytics/v1/contacts/export-requests/{request-id}/download

Resource information

URL https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests/{request-id}/download
HTTP method GET
Description Get the exported data of an export request by ID.
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.
request-id URI path Yes Integer The ID of the delete request you want to get the data for.

Responses

Name Returned data Description
200 OK Binary string Returns the binary string of the .ZIP file that contains a single file, named sitefinity-insight-client-data.json. This JSON file contains the exported data in the DecExportedData format.
403 Forbidden GeneralErrorResponse Returned when an invalid API key is provided in the x-dataintelligence-datacenterkey. Another reason is when the API key is valid but the authenticated user does not have access to this data center.
412 Not Found GeneralErrorResponse A delete request with the provided ID does not exist.

Sample request and response

 

The following request will get the extracted data for export request with ID 150.

HTTP:

GET https://api.dec.sitefinity.com/analytics/v1/contacts/export-requests/150/download

Headers:

  • Authorization: bearer token
  • x-dataintelligence-datacenterkey: c27aeeb7-d222-d848-d8bf-9792485dafa9

Response:

The response is a data stream which you need to save as a .ZIP file. Extract the saved .ZIP file and read the content of the .json file:

Was this article helpful?