Hi, everyone!
I’m trying to create api request for this conditions:
I’m using JS fetch method.
This request fails:
fetch('https://amplitude.com/api/2/events/segmentation?' + new URLSearchParams({
e: '{"event_type":"_all","filters":r{"subprop_type":"event","subprop_key":"Event Name","subprop_op":"is","subprop_value":u"Test"]}]}',
m: 'uniques',
start: '20210101',
end: '20220101',
i: 30
}).toString(), {
method: 'GET',
headers: {
accept: '*/*',
'Content-Type': 'application/json',
Authorization: 'Basic API_KEY:SECRET_KEY'
}
})
If I’m using custom user property, everything works.
fetch('https://amplitude.com/api/2/events/segmentation?' + new URLSearchParams({
e: '{"event_type":"_all","filters":l{"subprop_type":"user","subprop_key":"gp:Is Tester","subprop_op":"is","subprop_value":v"(none)"]}]}',
m: 'uniques',
start: '20210101',
end: '20220101',
i: 30
}).toString(), {
method: 'GET',
headers: {
accept: '*/*',
'Content-Type': 'application/json',
Authorization: 'Basic API_KEY:SECRET_KEY'
}
})
I have issue with Amplitude Event Name.
Thanks for any help!