Preview a view
curl --request POST \
--url https://api.getlurk.com/v1/views/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"who": "everyone",
"what": [
{}
],
"shape": {
"type": "number"
}
},
"compare": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {who: 'everyone', what: [{}], shape: {type: 'number'}},
compare: true
})
};
fetch('https://api.getlurk.com/v1/views/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/views/preview"
payload = {
"definition": {
"who": "everyone",
"what": [{}],
"shape": { "type": "number" }
},
"compare": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"compared_with": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"series": [
{
"measure": {
"measure": "active_users"
},
"unit": "<string>",
"total": 123,
"previous_total": 123,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"value": 123
}
],
"previous_points": [
{
"at": "2023-11-07T05:31:56Z",
"value": 123
}
]
}
],
"rows": [
{
"rank": 123,
"label": "<string>",
"user": {
"id": "<string>",
"external_id": "<string>"
},
"rule": {
"id": "<string>",
"key": "<string>",
"name": "<string>"
},
"property": {
"value": "<string>"
},
"value": 123,
"previous_rank": 123,
"values": [
123
]
}
],
"total_rows": 1,
"computed_at": "2023-11-07T05:31:56Z",
"steps": [
{
"step": {
"event": "<string>",
"where": {
"property": "<string>",
"equals": "<string>"
}
},
"people": 1,
"previous_people": 1,
"median_seconds": 1
}
]
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Views
Preview a view
Answers a view without saving it: a number, series, ranked list or funnel. A funnel counts one try per person, from their first step one in the range; a later try is not counted. Members of every role, keys and brand agents. At most 90 days. Views
POST
/
v1
/
views
/
preview
Preview a view
curl --request POST \
--url https://api.getlurk.com/v1/views/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"who": "everyone",
"what": [
{}
],
"shape": {
"type": "number"
}
},
"compare": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {who: 'everyone', what: [{}], shape: {type: 'number'}},
compare: true
})
};
fetch('https://api.getlurk.com/v1/views/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/views/preview"
payload = {
"definition": {
"who": "everyone",
"what": [{}],
"shape": { "type": "number" }
},
"compare": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"compared_with": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"series": [
{
"measure": {
"measure": "active_users"
},
"unit": "<string>",
"total": 123,
"previous_total": 123,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"value": 123
}
],
"previous_points": [
{
"at": "2023-11-07T05:31:56Z",
"value": 123
}
]
}
],
"rows": [
{
"rank": 123,
"label": "<string>",
"user": {
"id": "<string>",
"external_id": "<string>"
},
"rule": {
"id": "<string>",
"key": "<string>",
"name": "<string>"
},
"property": {
"value": "<string>"
},
"value": 123,
"previous_rank": 123,
"values": [
123
]
}
],
"total_rows": 1,
"computed_at": "2023-11-07T05:31:56Z",
"steps": [
{
"step": {
"event": "<string>",
"where": {
"property": "<string>",
"equals": "<string>"
}
},
"people": 1,
"previous_people": 1,
"median_seconds": 1
}
]
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Body
application/json
Response
Preview a view