Addresses
Addresses are managed through contact records as each address belongs to a contact.
The following fields relate to the Addresses endpoint.
Field | Limits | Required? | Writeable? |
---|---|---|---|
id | No | No | |
The id of the address | |||
type | No | Yes | |
The type of address Possible values: | |||
street_address_1 | 45 characters | No | Yes |
The first line of the street address | |||
street_address_2 | 45 characters | No | Yes |
The second line of the street address | |||
zip | 45 characters | No | Yes |
city | 200 characters | No | Yes |
state | 200 characters | No | Yes |
The state, spelled out in full | |||
created_at | No | No | |
The date and time at which the address was created | |||
modified_at | No | No | |
The date and time at which the address was modified |
Retrieving Addresses
GET https://api-v2.liondesk.com//contacts/10/addresses
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
Addresses are returned along with the contact:
This list of addresses represents all of the contact's addresses. If you intend to get a specific address, then include the id
of the address as well.
Visibility
Addresses are visible and changeable as long as:
- You are the owner of the contact
- You are part of the same team as the owner of the contact
- You are an assigned user to the contact
Submitting Addresses
Submit the address data to have it saved to the database, attached to the contact who's id
you specified:
POST https://api-v2.liondesk.com//contacts/10/addresses
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
"data": {
"type": "Main Office",
"street_address_1": "5045 Herman Knoll",
"street_address_2": null,
"zip": "39246-5277",
"city": "Berniermouth",
"state": "West Virginia",
}
Updating Addresses
You may update address values by simply including the fields you want to change along with the value to change to:
PATCH https://api-v2.liondesk.com//contacts/10/addresses/149
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
data: {
"zip": "V6J 1H9"
}
Deleting addresses
To delete an address, simply submit delete request and specify the id
of the address to delete. This will return the address information corresponding to the address you deleted.
DELETE https://api-v2.liondesk.com//contacts/10/addresses/149
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
{
"id": 249,
"type": "Second Home",
"street_address_1": "5404 Courtney Light",
"street_address_2": "Apt. 004",
"zip": "30002",
"city": "West Jevonstad",
"state": "Georgia",
"created_at": "2015-10-22T09:26:13.000Z",
"modified_at": "2018-04-17T00:36:22.000Z"
}