Activities

Note:
Before using these API endpoints, learn more about how to use WixHive activities in your app.

GET/activities

Activities will be returned in descending order from the most recent Activity. The Activities by default are for the site the application is installed on, determined by the application-id and instance-id parameters/headers. Optionally results can be restricted to activities created by the current application. Results are returned in cursored form, and can be filtered by date ranges.

Parameters:

NameData TypeParameter TypeDescription
activityTypesStringQueryThe activity types to filter against. Multiple activity types are seperated by a comma
untilDatetimeQueryThe ending date for activities we want to return, as an ISO 8601 timestamp. This field is only relevant when a cursor is not present.
fromDatetimeQueryThe beginning date for activities we want to return, as an ISO 8601 timestamp. This field is only relevant when a cursor is not present.
scope'site', 'app'QueryThe scope of the results to return, either for the entire site or limited to the current application. By default, all activities for the site will be returned
cursorStringQueryThe semi-optional cursor into the desired data. This cursor will expire after 30 minutes, it should not be cached.
pageSizeInteger (1-500)QueryThe number of results to return per page of data. Defaults to 25.
version (required)IntegerQueryThe specific version of this endpoint. This version uses semantic versioning, in the form of major.minor.path
application-id (required)StringQuery/ HeaderThe application definition ID. If sent through the header, this field must be prefixed with x-wix-
instance-id (required)StringQuery/ HeaderThe instance ID used for security validation with Wix. If sent through the header, this field must be prefixed with x-wix-
signature (required)StringQuery/ HeaderThe computed signature. If sent through the header, this field must be prefixed with x-wix-
timestamp (required)DatetimeQuery/ HeaderThe timestamp as an ISO 8601 timestamp. If sent through the header, this field must be prefixed with x-wix-

Example:

Copy

Response:

Here’s the full list of fields that can be part of the response.

The fields you’ll actually receive depend on the information you request and what we have in the system.

NameTypeDescription
pageSizeInteger (1-500)Number of results returned per cursor
previousCursorStringThe cursor used to access the previous set of activities. null will be returned if there are no previous results
nextCursorStringThe cursor used to access the next set of activities. null will be returned if there are no more results
resultsArray[Object]Array of Activity items
results.idStringActivity ID
results.createdAtDatetimeTimestamp indicating when this activity was created, as an ISO 8601 timestamp
results.activityTypeString (see list of activity types)Type of activity performed
results.activityLocationUrlStringURL where the activity was performed
results.activityDetailsObjectRelevant information about this activity to display in the Dashboard
results.activityDetails.additionalInfoUrlStringURL linking to more specific contextual information about the activity for use in the Dashboard
results.activityDetails.summaryStringA short description about the activity for use in the Dashboard
results.activityInfoObjectActivity specific information related to this type of activity. This field must adhere to the schema specified by the activity type.

Errors:

Here’s a list of possible error codes and when they occur. Read more about our API errors.

HTTP Status CodeReason/Error Message
400* Bad request. 'from' and 'until' fields are only valid when a cursor is not present. * Bad request. Unknown scope parameter value. * Invalid pageSize. Valid values are 25, 50 or 100. * Invalid or missing cursor. * Bad authentication credentials. * Bad request. Authentication credentials may be missing. * Missing endpoint version number.
403* Unauthorized. Your app has been removed from the site. * Unauthorized. Insufficient permissions.
404* Activity Type not found. * App is not found on site. * Endpoint version number does not exist.
408Timestamp expired on the request, please submit again with a new timestamp.
410Cursor expired. The cursor is no longer valid. Please query again.

GET/activities/{activityId}

Returns an activity referenced by its ID, only relevant for the given site determined by the application-id and instance-id parameters/headers.

NameData TypeParameter TypeDescription
activityId (required)StringPathThe activity to get
version (required)IntegerQueryThe specific version of this endpoint. This version uses semantic versioning, in the form of major.minor.path
application-id (required)StringQuery/ HeaderThe application definition ID. If sent through the header, this field must be prefixed with x-wix-
instance-id (required)StringQuery/ HeaderThe instance ID used for security validation with Wix. If sent through the header, this field must be prefixed with x-wix-
signature (required)StringQuery/ HeaderThe computed signature. If sent through the header, this field must be prefixed with x-wix-
timestamp (required)DatetimeQuery/ HeaderThe timestamp as an ISO 8601 timestamp. If sent through the header, this field must be prefixed with x-wix-

Example:

Copy

Response:

Here’s the full list of fields that can be part of the response.

The fields you’ll actually receive depend on the information you request and what we have in the system.

NameTypeDescription
idStringActivity ID
createdAtDatetimeTimestamp indicating when this activity was created, as an ISO 8601 timestamp
activityTypeString (see list of activity types)Type of activity performed
activityLocationUrlStringURL where the activity was performed
activityDetailsObjectRelevant information about this activity to display in the Dashboard
activityDetails.additionalInfoUrlStringURL linking to more specific contextual information about the activity for use in the Dashboard
activityDetails.summaryStringA short description about the activity for use in the Dashboard
activityInfoObjectActivity specific information related to this type of activity. This field must adhere to the schema specified by the activity type.

Errors:

Here’s a list of possible error codes and when they occur. Read more about our API errors.

HTTP Status CodeReason/Error Message
400* Bad authentication credentials. * Bad request. Authentication credentials may be missing. * Missing endpoint version number.
403* Unauthorized. Your app has been removed from the site. * Unauthorized. Insufficient permissions.
404* Activity not found, or site for instance-id and app-id does not exist. * App is not found on site. * Endpoint version number does not exist.
408Timestamp expired on the request, please submit again with a new timestamp.

GET/activities/types

Returns a list of Activity types that are currently supported by Wix. Each Activity type has an associated schema that data must conform to when posting Activities to Wix.

Parameters:

NameData TypeParameter TypeDescription
version (required)IntegerQueryThe specific version of this endpoint. This version uses semantic versioning, in the form of major.minor.path
application-id (required)StringQuery/headerThe application definition ID. If sent through the header, this field must be prefixed with x-wix-
instance-id (required)StringQuery/headerThe instance ID used for security validation with Wix. If sent through the header, this field must be prefixed with x-wix-
signature (required)StringQuery/headerThe computed signature. If sent through the header, this field must be prefixed with x-wix-
timestamp (required)DatetimeQuery/headerThe timestamp as an ISO 8601 timestamp. If sent through the header, this field must be prefixed with x-wix-

Example:

Copy

Response:

NameTypeDescription
typesArray[String]An array of activity types currently supported by Wix

Activity types:

Copy

Errors:

Here’s a list of possible error codes and when they occur. Read more about our API errors.

HTTP Status CodeReason/Error Message
400* Bad authentication credentials. * Bad request. Authentication credentials may be missing. * Missing endpoint version number.
403* Unauthorized. Your app has been removed from the site. * Unauthorized. Insufficient permissions.
404* App is not found on site. * Endpoint version number does not exist.
408Timestamp expired on the request, please submit again with a new timestamp.
410Cursor expired. The cursor is no longer valid. Please query again.

GET/contacts/{contactId}/activities

Returns the activity stream for a given contact, referenced by the contact’s unique ID. Activities will be returned in descending order from the most recent activity, in cursored form, and can be filtered by date ranges.

Parameters:

NameData TypeParameter TypeDescription
contactId (required)StringPathID of the contact's stream to fetch
activityTypesString (see list of activity types)QueryThe activity types to filter against. Multiple activity types are separated by a comma.
untilDatetimeQueryThe ending date for activities we want to return, as an ISO 8601 timestamp. This field is only relevant when a cursor is not present.
fromDatetimeQueryThe beginning date for activities we want to return, as an ISO 8601 timestamp. This field is only relevant when a cursor is not present
scope'site', 'app'QueryThe scope of the results to return, either for the entire site or limited to the current application. By default, all activities for the site will be returned
cursorStringQueryThe semi-optional cursor into the desired data. This cursor will expire after 30 minutes, it should not be cached.
pageSizeInteger (1-500)QueryThe number of results to return per page of data. Defaults to 25.
version (required)IntegerQueryThe specific version of this endpoint. This version uses semantic versioning, in the form of major.minor.path
application-id (required)StringQuery/headerThe application definition ID. If sent through the header, this field must be prefixed with x-wix-
instance-id (required)StringQuery/headerThe instance ID used for security validation with Wix. If sent through the header, this field must be prefixed with x-wix-
signature (required)StringQuery/headerThe computed signature. If sent through the header, this field must be prefixed with x-wix-
timestamp (required)DatetimeQuery/headerThe timestamp as an ISO 8601 timestamp. If sent through the header, this field must be prefixed with x-wix-

Example:

Copy

Response:

Here’s the full list of fields that can be part of the response.

The fields you’ll actually receive depend on the information you request and what we have in the system.

NameTypeDescription
pageSizeInteger (1-500)Number of results returned per cursor
previousCursorStringThe cursor used to access the previous set of activities. null will be returned if there are no previous results
nextCursorStringThe cursor used to access the next set of activities. null will be returned if there are no more results
resultsArray[Object]Array of Activity items
results.idStringActivity ID
results.createdAtDatetimeTimestamp indicating when this activity was created, as an ISO 8601 timestamp
results.activityTypeString (see list of activity types)Type of activity performed
results.activityLocationUrlStringURL where the activity was performed
results.activityDetailsObjectRelevant information about this activity to display in the Dashboard
results.activityDetails.additionalInfoUrlStringURL linking to more specific contextual information about the activity for use in the Dashboard
results.activityDetails.summaryStringA short description about the activity for use in the Dashboard
results.activityInfoObjectActivity specific information related to this type of activity. This field must adhere to the schema specified by the activity type.

Errors:

Here’s a list of possible error codes and when they occur. Read more about our API errors.

HTTP Status CodeReason/Error Message
400* Bad request. 'from' and 'until' fields are only valid when a cursor is not present. * Bad request. Unknown scope parameter value. * Invalid pageSize. Valid values are 25, 50 or 100.* Invalid or missing cursor. * Bad authentication credentials. * Bad request. Authentication credentials may be missing. * Missing endpoint version number.
403* Unauthorized. Your app has been removed from the site. * Unauthorized. Insufficient permissions.
404* Contact not found. * Activity Type not found. * App is not found on site. * Endpoint version number does not exist.
408Timestamp expired on the request, please submit again with a new timestamp.
410Cursor expired. The cursor is no longer valid. Please query again.

POST/contacts/{contactId}/activities

This endpoint creates an activity of a given activity type, adding the activity directly to the specific contact. These activity objects are then viewable in the site owner’s dashboard. Each activity conforms to a specific schema predefined by Wix. When the activity is successfully created, the ID of the activity will be returned. If schema validation fails, or other errors occur, an error will be returned by this endpoint.

Parameters:

NameData TypeParameter TypeDescription
contactId (required)StringPathID of the contact to edit
version (required)IntegerQueryThe specific version of this endpoint. This version uses semantic versioning, in the form of major.minor.path
application-id (required)StringQuery/headerThe application definition ID. If sent through the header, this field must be prefixed with x-wix-
instance-id (required)StringQuery/headerThe instance ID used for security validation with Wix. If sent through the header, this field must be prefixed with x-wix-
signature (required)StringQuery/headerThe computed signature. If sent through the header, this field must be prefixed with x-wix-
timestamp (required)DatetimeQuery/headerThe timestamp as an ISO 8601 timestamp. If sent through the header, this field must be prefixed with x-wix-
activity (required)ObjectBodyThe activity to create
activity.createdAt (required)DatetimeBodyTimestamp indicating when this activity was created, as an ISO 8601 timestamp
activity.activityType (required)String (see list of activity types)BodyType of activity performed
activity.activityLocationUrlStringBodyURL where the activity was performed
activity.activityDetailsObjectBodyRelevant information about this activity to display in the Dashboard
activity.activityDetails.additionalInfoUrl (required)StringBodyURL linking to more specific contextual information about the activity for use in the Dashboard
activity.activityDetails.summary (required)StringBodyA short description about the activity for use in the Dashboard
activity.activityInfo (required)ObjectBodyActivity specific information related to this type of activity. This field must adhere to the schema specified by the activity type.

Example:

Copy

Response:

NameTypeDescription
activityIdStringActivity ID
contactIdStringContact ID

Errors:

Here’s a list of possible error codes and when they occur. Read more about our API errors.

HTTP Status CodeReason/Error Message
400* Activity is missing required information. * Bad authentication credentials. * Bad request. Authentication credentials may be missing. * Missing endpoint version number.
403* Unauthorized. Your app has been removed from the site. * Unauthorized. Insufficient permissions.
404* Contact not found. * App is not found on site. * Endpoint version number does not exist.
408Timestamp expired on the request, please submit again with a new timestamp.
Was this helpful?
Yes
No