Case sensitive API Queries

We have a quick question about the API requests.
In the docs (Query Objects | JourneyApps Docs), it says that ‘contains’ operator is case-sensitive.
There is no information about an equal operator, but when I try it, it works as case-sensitive operator.

Is there any way to make an API Query Object request case-insensitive (for strings)?

1 Like

Hi Fred

Yes, at the moment our Backend Data API is case sensitive, except for the search API.

However, we have a QUERY API (undocumented at time of writing) which is basically what OnlineDB uses, and that does support case-insensitive querying using contains. The query syntax is very similar to what you would write for in-app queries

Authentication: Same as for the Backend Data API
URL: https://{app-deployment-id}.backend.{region-code}.journeyapps.com/api/v4/{backend-deployment-id}/objects/{model}/query.json
METHOD: POST
PAYLOAD:

{
	"expression": "query expression string" // e.g. "name contains ?", "(name starts with ? and status = ?) or status = ?", just like in the runtime
	"arguments":[arg1, arg2, ...], // array of arguments for the query expressions
	"skip":null, // integer to skip over results,
	"limit": null, // integer to limit results
	"sort":["field1", "-field2"] // sorting attributes
}

Example:

ProTip: Open the Debug console on your browser or Desktop app, run some OnlineDB queries, and inspect the network requests for payload syntax examples.

2 Likes

I want to point out that the correct URL will be:
https://{app-deployment-id}.backend.{region-code}.journeyapps.com/api/v4/{backend-deployment-id}/objects/{model}/query.json

1 Like