Preview a saved filter view
curl --request POST \
--url https://api-v2.watchcollect.com/v2/views/{view_id}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"page_size": 100
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cursor: '<string>', page_size: 100})
};
fetch('https://api-v2.watchcollect.com/v2/views/{view_id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-v2.watchcollect.com/v2/views/{view_id}/preview"
payload = {
"cursor": "<string>",
"page_size": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_occurrence_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_timestamp_ms": 123,
"first_seen_at_ms": 123,
"last_seen_at_ms": 123,
"sender": {
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"lid": "<string>",
"display_name": "<string>",
"country_prefix": "<string>"
},
"group_names": [
"<string>"
],
"group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"group_count": 123,
"occurrence_count": 123,
"has_media": true,
"classification_status": "pending",
"message_intent": "selling",
"is_edited": true,
"is_revoked": true,
"message_text": "<string>",
"primary_media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_media_url": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}views
Preview a saved filter view
Runs a saved view and returns a cursor page. Currently implemented for message previews.
POST
/
v2
/
views
/
{view_id}
/
preview
Preview a saved filter view
curl --request POST \
--url https://api-v2.watchcollect.com/v2/views/{view_id}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"page_size": 100
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cursor: '<string>', page_size: 100})
};
fetch('https://api-v2.watchcollect.com/v2/views/{view_id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-v2.watchcollect.com/v2/views/{view_id}/preview"
payload = {
"cursor": "<string>",
"page_size": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_occurrence_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_timestamp_ms": 123,
"first_seen_at_ms": 123,
"last_seen_at_ms": 123,
"sender": {
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"lid": "<string>",
"display_name": "<string>",
"country_prefix": "<string>"
},
"group_names": [
"<string>"
],
"group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"group_count": 123,
"occurrence_count": 123,
"has_media": true,
"classification_status": "pending",
"message_intent": "selling",
"is_edited": true,
"is_revoked": true,
"message_text": "<string>",
"primary_media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_media_url": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.