API usage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galya
    Junior Member
    • Nov 2015
    • 7

    API usage

    I want to understand how to send Where argument within the API to filter for example name or something else within any Modules
    According to Document it provide with simple parameters offset or maxSize, but how to use WHERE ???

    Sample API from Documents
    GET Account?offset=0&maxSize=20


    Please provide me with sample using where

    Thank you in advance
    Last edited by galya; 12-27-2015, 12:43 PM.
  • yuri
    Member
    • Mar 2014
    • 8627

    #2
    Hi

    Click F12 in your browser. Open Account and make search. You will see what url is sent in Network tab.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • galya
      Junior Member
      • Nov 2015
      • 7

      #3
      Hello,


      i have this call From network tab, when i did click on accounts Link


      http://localhost/espocrm/api/v1/Acco...sc=false&where[0][type]=primary&where[0][name]=AAAA


      But i have noticed 2 things ,
      1- The first where and second where taking same array of Zero, i dont know if this correct or not
      2- if i try to change for example the Name value from AAAA to be BBBB , i will get same result

      also i did try to do something like this
      http://localhost/espocrm/api/v1/Contact?where[0][lastName]=galya

      i have 3 contacts in myDB and i get always the 3 contacts even only 1 of them have lastName as galya,



      Thank you in advance for your help..

      Comment

      • yuri
        Member
        • Mar 2014
        • 8627

        #4
        I don't think &where[0][type] is a correct request.

        It should look like... /api/v1/Lead?maxSize=20&offset=0&sortBy=createdAt&asc=fals e&where%5B0%5D%5Btype%5D=textFilter&where%5B0%5D%5 Bvalue%5D=galya
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...