Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2.0
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      Hi,

      Two changes to make it easier:

      1) Now you don't need a key. As soon as you are authenticated, you can run (example)

      http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search
      or with more param (only the individuals, and return the name, mail and country)
      http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&contactType=Individual&return[email]=1&return[sort_name]=1&return[country]=1

      on every case you can have it as a json format:
      http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&json=1

      2) Now the authentication returns the session ID

      http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/login&user=xx&pwd=yy
      returns a PHPSESSID that you can uses as a get param on the other queries

      eg:
      http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&PHPSESSID=a956745e3d0056377adaa63a1c9dbb95

        Attachments

        1. REST.php
          9 kB
          xavier dutoit
        2. REST.php.diff
          4 kB
          xavier dutoit

          Activity

            People

            • Assignee:
              amit Amiteshwar Prasad
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: