Contacts


Search

Search for contacts.

Endpoint

Method URI Description
GET /users/{user_id}/contacts Search user owned contacts

Example Response

{
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "first_name": "Gus",
            "last_name": "Grasshopper",
            "full_name": "Gus Grasshopper",
            "email": "[email protected]",
            "phone": "123-456-7890",
            "dob": "1990-01-01",
            "gender": "Male",
            "audience": "Sphere",
            "is_audience_locked": true,
            "source": "List Upload",
            "status": "Subscribed",
            "tags": [
                "Tag 1",
                "Tag 2"
            ],
            "team_tags": [
                "Tag 1",
                "Tag 2"
            ],
            "created_at": "2020-04-09T16:34:59Z",
            "updated_at": "2020-04-09T16:35:19Z",
            "deleted_at": null
        }
    ],
    "links": {
        "first": "http://api.happygrasshopper.com/v3/users/77179/contacts?page=1",
        "last": "http://api.happygrasshopper.com/v3/users/77179/contacts?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://api.happygrasshopper.com/v3/users/77179/contacts",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}

Create

Create an contact.

Endpoint

Method URI Description
POST /users/{user_id}/contacts Create a user owned contact

Body Params

{
    "first_name": "Gus",
    "last_name": "Grasshopper",
    "email": "[email protected]",
    "phone": "123-456-7890",
    "dob": "1990-01-01",
    "gender": "Male",
    "audience": "Sphere",
    "is_audience_locked": true,
    "source": "List Upload",
    "status": "Subscribed",
    "tags": [
        "Tag 1",
        "Tag 2"
    ],
    "team_tags": [
        "Tag 1",
        "Tag 2"
    ]
}

Example Response

{
    "id": 1,
    "user_id": 1,
    "first_name": "Gus",
    "last_name": "Grasshopper",
    "full_name": "Gus Grasshopper",
    "email": "[email protected]",
    "phone": "123-456-7890",
    "dob": "1990-01-01",
    "gender": "Male",
    "audience": "Sphere",
    "is_audience_locked": true,
    "source": "List Upload",
    "status": "Subscribed",
    "tags": [
        "Tag 1",
        "Tag 2"
    ],
    "team_tags": [
        "Tag 1",
        "Tag 2"
    ],
    "created_at": "2020-04-09T16:34:59Z",
    "updated_at": "2020-04-09T16:35:19Z",
    "deleted_at": null
}

Read

Retrieve an contact.

Endpoint

Method URI Description
GET /contacts/{contact_id} Retrieve an contact by it's id

Example Response

{
    "id": 1,
    "user_id": 1,
    "first_name": "Gus",
    "last_name": "Grasshopper",
    "full_name": "Gus Grasshopper",
    "email": "[email protected]",
    "phone": "123-456-7890",
    "dob": "1990-01-01",
    "gender": "Male",
    "audience": "Sphere",
    "is_audience_locked": true,
    "source": "List Upload",
    "status": "Subscribed",
    "tags": [
        "Tag 1",
        "Tag 2"
    ],
    "team_tags": [
        "Tag 1",
        "Tag 2"
    ],
    "created_at": "2020-04-09T16:34:59Z",
    "updated_at": "2020-04-09T16:35:19Z",
    "deleted_at": null
}

Update

Update an contact.

Endpoint

Method URI Description
PUT /contacts/{contact_id} Update an contact

Body Params

{
    "first_name": "Gus",
    "last_name": "Grasshopper",
    "email": "[email protected]",
    "phone": "123-456-7890",
    "dob": "1990-01-01",
    "gender": "Male",
    "audience": "Sphere",
    "is_audience_locked": true,
    "source": "List Upload",
    "status": "Subscribed",
    "tags": [
        "Tag 1",
        "Tag 2"
    ],
    "team_tags": [
        "Tag 1",
        "Tag 2"
    ]
}

Example Response

{
    "id": 1,
    "user_id": 1,
    "first_name": "Gus",
    "last_name": "Grasshopper",
    "full_name": "Gus Grasshopper",
    "email": "[email protected]",
    "phone": "123-456-7890",
    "dob": "1990-01-01",
    "gender": "Male",
    "audience": "Sphere",
    "is_audience_locked": true,
    "source": "List Upload",
    "status": "Subscribed",
    "tags": [
        "Tag 1",
        "Tag 2"
    ],
    "team_tags": [
        "Tag 1",
        "Tag 2"
    ],
    "created_at": "2020-04-09T16:34:59Z",
    "updated_at": "2020-04-09T16:35:19Z",
    "deleted_at": null
}

Delete

Delete an contact.

Endpoint

Method URI Description
DELETE /contacts/{contact_id} Delete an contact by it's id

Example Response

{
    "success": true
}