Forum Academy Marketplace Showcase Pricing Features

Get Data API User constraints email equals

Hello while querying an user by email using :
var constraints = [
{
“key”: “email”,
“constraint_type”: “equals”,
“value”: "[email protected]"
}
];
Here is my api call (constraints is url encoded)

https://mydomain.com/version-test/api/1.1/obj/user?api_token=…&constraints=constraints

returns

{ statusCode: 404,

body:

{ status: ‘NOT_FOUND’,

message: ‘Constraint type not found equals for field email and type user’ },

args: { bubble_code: ‘1561728858293x159059712561494530’ } }

I even tried “text contains” constraint type but same error

2 Likes

@stephane have you figured a workaround? I run into this problem as well.

Nope I haven’t tried it again…

I actually found the cause and the solution: it looks like the email and other authorization-related information lives in a different data structure (as described here: Search by email with Data API?) . So what I do now to be able to search by email is that I save the email in a separate field, and then I can query by email.

I solved this by checking all the fields, assuming that the email is unique you should get a valid response :
{ key: “_all”, constraint_type: “equals”, value: “[email protected]” }