1. Home
  2. Docs
  3. REST API
  4. Contact API
  5. GET Method 

GET Method 

The GET method is used to get contacts from the database. Users can retrieve all the contacts from their database using the following query.

http://yoursite.com/wp-json/gh/v2/contact?key=[public_key]&token=[token]

You can also retrieve specific contacts by passing the contact_id argument while making request. Following  query returns details about contact with contact_id=1.

http://yoursite.com/wp-json/gh/v2/contact?key=[public_key]&token=[token]&contact_id=1

Which will return a response like the below.

{
    "contact": {
        "ID": "1",
        "email": "email@example.com",
        "first_name": "Jhon",
        "last_name": "Doe",
        "user_id": "1",
        "owner_id": "1",
        "optin_status": "0",
        "date_created": "2018-12-13 16:47:15",
        "meta": {
            "primary_phone": "1234567890",
            "primary_phone_extension": "5623",
            "street_address_1": "25 Lesmill Rd",
            "street_address_2": "Unit D",
            "city": "North York",
            "postal_zip": "M3B 2T3",
            "region": "Ontario",
            "country": "CA",
            "notes": "",
            "lead_source": "",
            "source_page": "",
            "custom_meta": "this is meta"
        }
    }
}
Was this article helpful to you? Yes No

How can we help?