Contacts¶
Contacts are natural or legal persons known to your organization. This API endpoint enables CRUD operations on Contacts. The Contacts list is the organization directory.
Contacts collection¶
GET¶
Retrieve list of contacts of a specific organization.
GET /orgs/{org_pk}/contacts/
Parameters
expand:
notes
(enum[string], optional)Include full notes inside of the contact body.
Example request:
curl -iL --request GET "https:/www.readycloud.com/api/v2/orgs/1/contacts/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
Response 200 (application/json):
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"addresses": [
{
"address_type": "shipping",
"address_1": "2010 Warsaw Rd",
"address_2": "Apt 4",
"city": "Roswell",
"company": "FedEx",
"country": "United States",
"default": true,
"email": "[email protected]",
"first_name": "Nick",
"last_name": "Smith",
"phone": "6785851113",
"post_code": "56001",
"region": "NY",
"residential": false,
"url": "/api/v2/orgs/1/contacts/5/addresses/5/",
"validated": false
}
],
"created_at": "2018-03-30T00:00:16.159321Z",
"custom_fields": {},
"description": null,
"first_name": "Nick",
"is_company": false,
"last_name": "Smith",
"notes": [],
"occupation": null,
"orders": "/api/v2/orgs/1/contacts/5/orders/",
"profile_image": null,
"source": {
"retrieved_at": "2018-03-30T00:00:16+00:00"
},
"updated_at": "2018-03-30T00:00:16.159321Z",
"url": "/api/v2/orgs/1/contacts/5/",
"website": null
}
]
}
POST¶
Create new contact for a specific organization.
POST /orgs/{org_pk}/contacts/
Example request:
curl -iL --request POST -H "Content-Type: application/json" --upload-file data.json "https:/www.readycloud.com/api/v2/orgs/1/contacts/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
data.json:
{
"first_name": "Marge",
"last_name": "Simpson",
"profile_image": null,
"occupation": null,
"orders": [],
"notes": [],
"website": null,
"description": null,
"is_company": false,
"addresses": [
{
"address_type": "shipping",
"company": "ReadyCloud",
"first_name": "Marge",
"last_name": "Simpson",
"address_1": "4032 N Scottsdale Rd",
"address_2": "",
"city": "Scottsdale",
"region": "AZ",
"post_code": "85251",
"country": "United States",
"phone": " +1 555-321-4578",
"email": "[email protected]",
"residential": null,
"validated": false,
"default": true
}
],
"custom_fields": {}
}
Response 201 (application/json):
{
"addresses": [
{
"address_type": "shipping",
"address_1": "4032 N Scottsdale Rd",
"address_2": "",
"city": "Scottsdale",
"company": "ReadyCloud",
"country": "United States",
"default": true,
"email": "[email protected]",
"first_name": "Marge",
"last_name": "Simpson",
"phone": "+1 555-321-4578",
"post_code": "85251",
"region": "AZ",
"residential": null,
"url": "/api/v2/orgs/1/contacts/6/addresses/6/",
"validated": false
}
],
"created_at": "2018-03-30T00:00:16.159321Z",
"custom_fields": {},
"description": null,
"first_name": "Marge",
"is_company": false,
"last_name": "Simpson",
"notes": [],
"occupation": null,
"orders": "/api/v2/orgs/1/contacts/6/orders/",
"profile_image": null,
"updated_at": "2018-03-30T00:00:16.159321Z",
"source": {
"account": null,
"channel": null,
"id": null,
"name": null,
"retrieved_at": "2018-03-30T00:00:16.159321Z",
"updated_at": "2018-03-30T00:00:16.159321Z"
},
"url": "/api/v2/orgs/1/contacts/6/",
"website": null
}
Contact¶
GET¶
Retrieve details of a specific contact.
GET /orgs/{org_pk}/contacts/{contact_pk}/
Parameters
expand:
notes
(enum[string], optional)Include full notes inside of the contact body.
Example request:
curl -iL --request GET "https:/www.readycloud.com/api/v2/orgs/1/contacts/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
Response 200 (application/json):
{
"addresses": [
{
"address_type": "shipping",
"address_1": "2010 Warsaw Rd",
"address_2": "Apt 4",
"city": "Roswell",
"company": "FedEx",
"country": "United States",
"default": true,
"email": "[email protected]",
"first_name": "Nick",
"last_name": "Smith",
"phone": "6785851113",
"post_code": "56001",
"region": "NY",
"residential": false,
"url": "/api/v2/orgs/1/contacts/5/addresses/5/",
"validated": false
}
],
"created_at": "2018-03-30T00:00:16.159321Z",
"custom_fields": {},
"description": null,
"first_name": "Nick",
"is_company": false,
"last_name": "Smith",
"notes": [],
"occupation": null,
"orders": "/api/v2/orgs/1/contacts/5/orders/",
"profile_image": null,
"source": {
"retrieved_at": "2018-03-30T00:00:16+00:00"
},
"updated_at": "2018-03-30T00:00:16.159321Z",
"url": "/api/v2/orgs/1/contacts/5/",
"website": null
}
PATCH¶
Update a specific contact.
PATCH /orgs/{org_pk}/contacts/{contact_pk}/
Example request:
curl -iL --request PATCH -H "Content-Type: application/json" --upload-file data.json "https:/www.readycloud.com/api/v2/orgs/1/contacts/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
data.json:
{
"addresses": [
{
"address_type": "shipping",
"company": "self-employed",
"email": "[email protected]",
"url": "/api/v2/orgs/1/contacts/5/addresses/5/"
}
],
"website": "http://www.nicksmith.com/"
}
Response 200 (application/json):
{
"addresses": [
{
"address_type": "shipping",
"address_1": "2010 Warsaw Rd",
"address_2": "Apt 4",
"city": "Roswell",
"company": "self-employed",
"country": "United States",
"default": true,
"email": "[email protected]",
"first_name": "Nick",
"last_name": "Smith",
"phone": "6785851113",
"post_code": "56001",
"region": "NY",
"residential": false,
"url": "/api/v2/orgs/1/contacts/5/addresses/5/",
"validated": false
}
],
"created_at": "2018-03-30T00:00:16.159321Z",
"custom_fields": {},
"description": null,
"first_name": "Nick",
"is_company": false,
"last_name": "Smith",
"notes": [],
"occupation": null,
"orders": "/api/v2/orgs/1/contacts/5/orders/",
"profile_image": null,
"source": {
"account": null,
"channel": null,
"id": null,
"name": null,
"retrieved_at": "2018-03-30T00:00:16.159321Z",
"updated_at": "2018-03-30T00:00:16.159321Z"
},
"updated_at": "2018-03-30T00:00:16.159321Z",
"url": "/api/v2/orgs/1/contacts/5/",
"website": "http://www.nicksmith.com/"
}
DELETE¶
Delete a specific contact.
DELETE /orgs/{org_pk}/contacts/{contact_pk}/
Response 204 (application/json)