Addresses


Search

Search for addresses.

Endpoint

Method URI Description
GET /users/{user_id}/addresses Search user owned addresses
GET /teams/{team_id}/addresses Search team owned addresses
GET /contacts/{contact_id}/addresses Search contact owned addresses

Example Response

{
    "data": [
        {
            "id": 1,
            "street": "500 Main St. Suite H",
            "street_2": null,
            "city": "Safety Harbor",
            "state": "FL",
            "country_id": 1,
            "country_name": "United States",
            "country": {
                "id": 1,
                "name": "United States",
                "code": "US"
            },
            "postal_code": "33763",
            "latitude": null,
            "longitude": null,
            "is_primary": true,
            "type": "Business",
            "created_at": "2020-01-01T00:00:00Z",
            "updated_at": "2020-01-01T00:00:00Z",
            "deleted_at": null
        }
    ],
    "links": {
        "first": "https://api.happygrasshopper.com/v3/contacts/11882201/addresses?page=1",
        "last": "https://api.happygrasshopper.com/v3/contacts/11882201/addresses?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "path": "https://api.happygrasshopper.com/v3/contacts/11882201/addresses",
        "per_page": 15,
        "to": null,
        "total": 1
    }
}

Create

Create an address.

Endpoint

Method URI Description
POST /users/{user_id}/addresses Create a user owned address
POST /teams/{team_id}/addresses Create a team owned address
POST /contacts/{contact_id}/addresses Create a contact owned address

Body Params

{
    "street": "500 Main St. Suite H",
    "street_2": null,
    "city": "Safety Harbor",
    "state": "FL",
    "country": "United States",
    "postal_code": "33763",
    "is_primary": true,
    "type": "Other"
}

Example Response

{
    "id": 1,
    "street": "500 Main St. Suite H",
    "street_2": null,
    "city": "Safety Harbor",
    "state": "FL",
    "country_id": 1,
    "country_name": "United States",
    "country": {
        "id": 1,
        "name": "United States",
        "code": "US"
    },
    "postal_code": "33763",
    "latitude": null,
    "longitude": null,
    "is_primary": true,
    "type": "Other",
    "created_at": "2020-07-06T00:48:59Z",
    "updated_at": "2020-07-06T00:48:59Z",
    "deleted_at": null
}

Read

Retrieve an address.

Endpoint

Method URI Description
GET /addresses/{address_id} Retrieve an address by it's id

Example Response

{
    "id": 1,
    "street": "500 Main St. Suite H",
    "street_2": null,
    "city": "Safety Harbor",
    "state": "FL",
    "country_id": 1,
    "country_name": "United States",
    "country": {
        "id": 1,
        "name": "United States",
        "code": "US"
    },
    "postal_code": "33763",
    "latitude": null,
    "longitude": null,
    "is_primary": true,
    "type": "Other",
    "created_at": "2020-07-06T00:48:59Z",
    "updated_at": "2020-07-06T00:48:59Z",
    "deleted_at": null
}

Update

Update an address.

Endpoint

Method URI Description
PUT /addresses/{address_id} Update an address

Body Params

{
    "street": "500 Main St. Suite H",
    "street_2": null,
    "city": "Safety Harbor",
    "state": "FL",
    "country": "United States",
    "postal_code": "33763",
    "is_primary": true,
    "type": "Other"
}

Example Response

{
    "id": 1,
    "street": "500 Main St. Suite H",
    "street_2": null,
    "city": "Safety Harbor",
    "state": "FL",
    "country_id": 1,
    "country_name": "United States",
    "country": {
        "id": 1,
        "name": "United States",
        "code": "US"
    },
    "postal_code": "33763",
    "latitude": null,
    "longitude": null,
    "is_primary": true,
    "type": "Other",
    "created_at": "2020-07-06T00:48:59Z",
    "updated_at": "2020-07-06T00:48:59Z",
    "deleted_at": null
}

Delete

Delete an address.

Endpoint

Method URI Description
DELETE /addresses/{address_id} Delete an address by it's id

Example Response

{
    "success": true
}