Home App Docs Blog Github

How can i filter by url?

Hi when i use the API to query an object from a model, i can query by id for example :
{
“query.id” : “MY_ID”
}
but when i want to query a object with specific url :
{
“query.data.url”: “/my-url”
}
I always have 0 results.

Hey @smaiau - this is because data.url is a special computed property, that is only applied after the query happens.

You can use targeting for this - e.g. ?userAttributes.urlPath=/my-url to filter by URL, or you can query off of the query object directly, e.g. in most cases it’s ?query.query.0.value=/my-url

If you look at the query property of the response object you should see what I mean, it should look like

{ query: [ { property: 'urlPath', value: '/my-url' }] }