Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

[REST-API] Example incorrect#201

Description

@TheDevMinerTV

Hey there 馃憢

It seems like the example URL given for advanced filtering on the /api/contacts endpoint is invalid.
When I try to cURL it to my Mautic 3.3.2 instance, it just throws a 500 error.

The URL in the documentation is: https://[your_mauitc_domain]/api/contacts?where%5B0%5D%5Bcol%5D=phone&where%5B0%5D%5Bexpr%5D=in&where%5B0%5D%5Bval%5D=444444444,888888888 (yes, that typo is in there too)
URL-Decoding the query string results in this: where[0][col]=phone&where[0][expr]=in&where[0][val]=444444444,888888888

This should evaluate to this JSON

{
  "where": [
    {
      "col": "phone",
      "expr": "in",
      "val": "444444444,888888888"
    }
  ]
}

This is the error logged to my log files:

[2021-06-10 09:31:50] mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: ""expr" is missing in the where clause array." at /var/www/html/app/bundles/CoreBundle/Entity/CommonRepository.php line 852 {"exception":"[object] (InvalidArgumentException(code: 0): \"expr\" is missing in the where clause array. at /var/www/html/app/bundles/CoreBundle/Entity/CommonRepository.php:852)"} []

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions