How to use where parameter ? (API)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codeboy
    Senior Member
    • May 2018
    • 112

    #1

    How to use where parameter ? (API)

    How to use where api parameter ?
    I read the documentation but did not see the sample code. Could you give a simple example?

    var URL = `http://espocrm.com/api/v1/Lead?maxSize=20&where=lead.user.name ?`;
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9616

    #2
    You can utilize this https://github.com/espocrm/documenta...-client-php.md

    Use browser's console to see requests for an example.

    Comment

    • codeboy
      Senior Member
      • May 2018
      • 112

      #3
      Originally posted by yurikuzn
      You can utilize this https://github.com/espocrm/documenta...-client-php.md

      Use browser's console to see requests for an example.
      I did not see the "where" command. I'm new Do you have a chance to help? Example code I'm use react native.

      where: { firstName: 'John' } I try this method but not work

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        http://demo.espocrm.de/advanced/api/v1/Contact?where[0][type]=startsWith&where[0][attribute]=firstName&where[0][value]=Ro

        Comment

        • codeboy
          Senior Member
          • May 2018
          • 112

          #5
          Originally posted by tanya
          http://demo.espocrm.de/advanced/api/v1/Contact?where[0][type]=startsWith&where[0][attribute]=firstName&where[0][value]=Ro
          That's it! Thank you

          Comment

          • bradaks
            Active Community Member
            • Aug 2017
            • 254

            #6
            Hello,

            How would you request multiple selections? Example:

            ?where[0][type]=in&where[0][attribute]=assignmentType&where[0][value]=Event&where[0][value]=Mobile+Draw"

            I cannot get both "Event" and "Mobile Draw" to be filtered. Thanks for the help!

            Comment

            • bradaks
              Active Community Member
              • Aug 2017
              • 254

              #7
              This post isnt showing up for me on recent posts?? Adding a comment to refresh.

              Comment

              • bradaks
                Active Community Member
                • Aug 2017
                • 254

                #8
                Originally posted by bradaks
                Hello,

                How would you request multiple selections? Example:

                ?where[0][type]=in&where[0][attribute]=assignmentType&where[0][value]=Event&where[0][value]=Mobile+Draw"

                I cannot get both "Event" and "Mobile Draw" to be filtered. Thanks for the help!
                Has anyone overcame this or know what I may be doing wrong? Thanks again!

                Comment

                • bradaks
                  Active Community Member
                  • Aug 2017
                  • 254

                  #9
                  Still trying to figure this out.

                  Comment

                  • yuri
                    EspoCRM product developer
                    • Mar 2014
                    • 9616

                    #10
                    You can replicate the request via EspoCRM UI and copy the request URL from the browser console network tab.

                    Comment

                    Working...