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
1
{
2
"method": "GET",
3
"url": "https://openapi.wix.com/v1/activities?version=1.0.0&activityTypes=form/contact-form&until=2017-03-26T13:48:42.220Z&pageSize=10",
4
"headers": {
5
"x-wix-application-id": "1462a46b-d417-e2a1-c95b-3d638d926904",
6
"x-wix-instance-id": "dbb179ed-7ffd-4c21-951b-c38ab7d1c45b",
7
"x-wix-timestamp": "2017-03-26T13:53:15.106Z",
8
"x-wix-signature": "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMT12"
9
}
10
}

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
1
{
2
"method": "GET",
3
"url": "https://openapi.wix.com/v1/activities/6cbefa98-0345-4f2b-8bb4-a480d3f5008a?version=1.0.0",
4
"headers": {
5
"x-wix-application-id": "1462a46b-d417-e2a1-c95b-3d638d926904",
6
"x-wix-instance-id": "dbb179ed-7ffd-4c21-951b-c38ab7d1c45b",
7
"x-wix-timestamp": "2017-03-26T13:59:10.254Z",
8
"x-wix-signature": "gMQmr3dQcB1knjd7si5dCEHubWOvEus0PtED3Vida90="
9
}
10
}

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
1
{
2
"method": "GET",
3
"url": "https://openapi.wix.com/v1/activities/types?version=1.0.0",
4
"headers": {
5
"x-wix-application-id": "1462a46b-d417-e2a1-c95b-3d638d926904",
6
"x-wix-instance-id": "dbb179ed-7ffd-4c21-951b-c38ab7d1c45b",
7
"x-wix-timestamp": "2017-03-26T14:00:30.160Z",
8
"x-wix-signature": "ieCPqR-O6jrLOI6wjc5Ud-uE-6hye3UU0z9hsVtZlSE="
9
}
10
}

Response:

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

Activity types:

Copy
1
{
2
"types": [
3
"contacts/create",
4
"e_commerce/cart-abandon",
5
"e_commerce/cart-add",
6
"e_commerce/cart-checkout",
7
"e_commerce/cart-remove",
8
"e_commerce/purchase",
9
"events/rsvp",
10
"form/contact-form",
11
"form/form",
12
"form/subscription-form",
13
"hotels/cancel",
14
"hotels/confirmation",
15
"hotels/purchase",
16
"hotels/purchase-failed",
17
"hotels/reservation",
18
"messaging/im",
19
"music/album-fan",
20
"music/album-played",
21
"music/album-share",
22
"music/track-lyrics",
23
"music/track-play",
24
"music/track-played",
25
"music/track-share",
26
"music/track-skip",
27
"scheduler/appointment",
28
"scheduler/cancel",
29
"scheduler/confirmation",
30
"social/comment",
31
"social/share-url",
32
"social/track",
33
]
34
}

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
1
{
2
"method": "GET",
3
"url": "https://openapi.wix.com/v1/contacts/0126c839-2344-47d6-b219-1441b30d1a8b/activities?version=1.0.0",
4
"headers": {
5
"x-wix-application-id": "1462a46b-d417-e2a1-c95b-3d638d926904",
6
"x-wix-instance-id": "dbb179ed-7ffd-4c21-951b-c38ab7d1c45b",
7
"x-wix-timestamp": "2017-03-26T14:01:51.914Z",
8
"x-wix-signature": "EBB0T_9rEyKRBys5eCaQRhO8Q6yriSIYifj0UKvy464="
9
}
10
}

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
1
{
2
"method": "POST",
3
"url": "https://openapi.wix.com/v1/contacts/0126c839-2344-47d6-b219-1441b30d1a8b/activities?version=1.0.0",
4
"headers": {
5
"x-wix-application-id": "1462a46b-d417-e2a1-c95b-3d638d926904",
6
"x-wix-instance-id": "dbb179ed-7ffd-4c21-951b-c38ab7d1c45b",
7
"x-wix-timestamp": "2017-03-26T14:09:09.668Z",
8
"x-wix-signature": "qklWQibm57XNToJlLZkPwhZJZ6NbUHgMkzezZKbDeIA="
9
},
10
"json": true,
11
"body": {
12
"createdAt": "2017-03-26T14:01:51.914Z",
13
"activityType": "hotels/cancel",
14
"activityLocationUrl": "http://google.com",
15
"activityInfo": {
16
"cancelDate": "2017-03-26T14:07:33.734Z",
17
"refund": {
18
"kind": "FULL",
19
"total": 100,
20
"currency": "USD",
21
"notes": "too expensive",
22
"destination": "Tel Aviv"
23
},
24
"reservationId": "455",
25
"guests": {
26
"total": 1,
27
"adults": 1,
28
"children": 0
29
},
30
"stay": {
31
"checkin": "2017-03-26T14:06:07.334Z",
32
"checkout": "2017-03-26T14:07:33.734Z"
33
},
34
"rates": [
35
{
36
"date": "2017-03-26T14:06:07.334Z",
37
"subtotal": 22.4,
38
"taxes": [
39
{
40
"name": "stuff",
41
"total": 0.6,
42
"currency": "USD"
43
}
44
],
45
"total": 30,
46
"currency": "USD"
47
}
48
],
49
"invoice": {
50
"subtotal": 20,
51
"total": 30,
52
"currency": "UDS"
53
},
54
"customer": {
55
"contactId": "123",
56
"isGuest": true,
57
"name": {
58
"prefix": "Mr",
59
"first": "Kanye",
60
"middle": "k",
61
"last": "West",
62
"suffix": "The king"
63
},
64
"phone": "1234567",
65
"email": "email@email.com"
66
},
67
"rooms": [
68
{
69
"id": "single123",
70
"beds": [
71
{
72
"kind": "king"
73
}
74
],
75
"maxOccupancy": 3,
76
"amenities": [
77
"air conditioning",
78
"wifi",
79
"cable",
80
"goats"
81
]
82
}
83
]
84
}
85
}
86
}

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