Schema
The schema defines all the fields that exist within an Entry record. Any response from these endpoints can be expected to contain the fields below unless the _filter the query parameter is used, or the schema field only appears in a specific context.
idinteger | Unique identifier for the Entry. Read-only Context: view, edit, embed |
typestring | The Entry type. Context: view, edit, embedOne of: family, individual, organization |
slugstring | A unique alphanumeric identifier for the Entry. Context: view, edit, embed |
linkstring (uri) | URL to the post. Read-only Context: view, edit, embed |
fnstring | The Entry’s full name. Read-only Context: view, edit, embed |
honorific_prefixobject | An honorific prefix preceding a person’s name such as Dr/Mrs/Mr. Context: view, edit, embed |
given_nameobject | Given name. In the U.S., the first name of a person. Context: view, edit, embed |
additional_nameobject | An additional name for a person. The middle name of a person. Context: view, edit, embed |
family_nameobject | Family name. In the U.S., the last name of a person. Context: view, edit, embed |
honorific_suffixobject | An honorific suffix preceding a person’s name, such as M.D. or Ph.D. Context: view, edit, embed |
job_titleobject | The job title of the Entry (for example, Financial Manager). Context: view, edit, embed |
orgobject | The organization object for the Entry. Properties: – organization_name (string) Organization name.– organization_unit (string) Department (organization unit).Context: view, edit, embed |
object | The contact name object for the entry of type organization. Properties: – given_name (string) First name.– family_name (string) Last name.Context: view, edit, embed |
adrobject[] | The addresses that are attached to an Entry. Properties: – id (integer) Unique identifier for the address.– order (integer) The display order of the address.– preferred (boolean) Whether the address is the preferred address.– type (string) Address type.– street_address (string) Address line one.– extended_address (string) Address line two.– extended_address_2 (string) Address line three.– extended_address_3 (string) Address line four.– district (string) Address district.– county (string) Address county.– locality (string) Address locality (city).– region (string) Address region (state/province).– postal_code (string) Address postcode (zip code).– country_name (string) Address country.– latitude (number) Address latitude.– longitude (number) Address longitude.– visibility (string) Visibility of the address. [One of: private, public, unlisted]Context: view, edit, embed |
telobject[] | The telephone numbers that are attached to an Entry. Properties: – id (integer) Unique identifier for the phone number.– order (integer) The display order of the phone numbers.– preferred (boolean) Whether the number is the preferred phone number.– type (string) Phone number type.– number (string) The phone number.Context: view, edit, embed |
emailobject[] | The email addresses that are attached to an Entry. Properties: – id (integer) Unique identifier for the email address.– order (integer) The display order of the email addresses.– preferred (boolean) Whether the address is the preferred email address.– type (string) Email address type.– address (string [email]) The email address.Context: view, edit, embed |
socialobject[] | The social networks attached to an Entry. Properties: – id (integer) Unique identifier for the social network.– order (integer) The display order of the social networks.– preferred (boolean) Whether the network is the preferred social network.– type (string) Social network type.– url (string [uri]) The social network URI.Context: view, edit, embed |
bioobject | The biography for the Entry. Context: view, edit, embed |
excerptobject | The excerpt for the Entry. Context: view, edit, embed |
notesobject | The notes for the Entry. Context: view, edit, embed |
visibilitystring | Visibility of the Entry. Context: view, edit, embedOne of: private, public, unlisted |
statusstring | Moderation status of the Entry. Context: view, edit, embedOne of: approved, pending |
Endpoints
Request Entries
Query this endpoint to retrieve a collection of entries. The response you receive can be controlled and filtered using the URL query parameters below.
Arguments
contextstring | Scope under which the request is made; determines the fields present in the response. Default: viewOne of: view, embed, edit |
excludeinteger[] | Ensure the result set excludes specific IDs. |
includeinteger[] | Limit result set to specific IDs. |
offsetinteger | Offset the result set by a specific number of items. |
pageinteger | Current page of the collection. Default: 1 |
per_pageinteger | The maximum number of items to be returned in the result set. Default: 10 |
searchstring | Limit results to those matching a string. |
tax_relationstring | Limit result set based on the relationship between multiple taxonomies. One of: AND, ORDefault: OR |
categoriesinteger[] | Limit result set to items with specific terms assigned in the categories taxonomy. |
categories_excludeinteger[] | Limit result set to items except those with specific terms assigned in the categories taxonomy. |
Example Request
fetch("https://example.com/wp-json/cn-api/v1/entry", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Create Entry
Post to this endpoint to create a new Entry.
Arguments
Important
Not yet implemented.
Example Request
Important
No examples are available.
Request Entry
Query this endpoint to retrieve a specific entry record.
Arguments
idinteger | Unique identifier for the Entry. |
Example Request
fetch("https://example.com/wp-json/cn-api/v1/entry/40388", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Update an Entry
Post to this endpoint to update an Entry.
Arguments
idinteger | Unique identifier for the Entry. |
typestring | The Entry type. One of: family, individual, organization |
slugstring | A unique alphanumeric identifier for the Entry. |
honorific_prefixstring | An honorific prefix preceding a person’s name such as Dr/Mrs/Mr. |
given_namestring | Given name. In the U.S., the first name of a person. |
additional_namestring | An additional name for a person. The middle name of a person. |
family_namestring | Family name. In the U.S., the last name of a person. |
honorific_suffixstring | An honorific suffix preceding a person’s name, such as M.D. or Ph.D. |
job_titlestring | The job title of the Entry (for example, Financial Manager). |
orgobject | The organization object for the Entry. Properties: – organization_name (string) Organization name.– organization_unit (string) Department (organization unit). |
object | The contact name object for the entry of type organization. Properties: – given_name (string) First name.– family_name (string) Last name. |
biostring | The biography for the Entry. |
excerptstring | The excerpt for the Entry. |
notesstring | The notes for the Entry. |
visibilitystring | Visibility of the Entry. One of: private, public, unlisted |
statusstring | Moderation status of the Entry. One of: approved, pending |
Important
Currently, it is not possible to edit the address, phone, email, link, and social media fields.
Example Request
fetch("https://example.com/wp-json/cn-api/v1/entry/66969", {
method: "post",
headers: {
Authorization: "Basic " + btoa("username:password"),
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "organization",
org: {
organization_name: "Organization Name",
organization_unit: "Department Name",
},
contact: {
given_name: "First Name",
family_name: "Last Name",
},
bio: "This is the entry bio.",
notes: "This is my notes.",
status: "approved",
visibility: "private",
}),
})
.then((data) => data.json())
.then(console.log);
Moderate an Entry
Post to the endpoint to set an Entry’s moderation status.
Arguments
idinteger | Unique identifier for the Entry. |
actionstring | The moderation action. One of: approve,unapprove |
Example Request
fetch("https://example.com/wp-json/cn-api/v1/entry/66969/moderate/", {
method: "post",
headers: {
Authorization: "Basic " + btoa("username:password"),
"Content-Type": "application/json",
},
body: JSON.stringify({
action: "approve"
}),
})
.then((data) => data.json())
.then(console.log);Delete an Entry
Arguments
idinteger | Unique identifier for the Entry. |
Example Request
fetch("https://example.com/wp-json/cn-api/v1/entry/4325", {
method: "delete",
headers: {
Authorization: "Basic " + btoa("username:password"),
},
})
.then((data) => data.json())
.then(console.log);Important
If you are running the example from the browser’s Console, ensure you are not currently logged in to your WordPress admin; otherwise, the example request will fail with a 401 response code.
Hooks
Actions
Connections_Directory/API/REST/Route/Entry/Delete/AfterConnections_Directory/API/REST/Route/Entry/Update/After
Filters
Connections_Directory/API/REST/Route/Entry/Get_Items/ArgumentsConnections_Directory/API/REST/Route/Entry/Prepare_Item/Response
Examples
Example filter that hooks into the request arguments adding support to query entries with a specific postal code.
https://example.com/wp-json/cn-api/v1/entry/?postal_code={postal_code}
add_filter(
'Connections_Directory/API/REST/Route/Entry/Get_Items/Arguments',
static function( $arguments, $request ) {
$arguments['zip_code'] = Connections_Directory\Utility\_array::get( $request, 'postal_code' );
return $arguments;
},
10,
2
);Example request with the using the filter.
fetch("https://example.com/wp-json/cn-api/v1/entry/?postal_code=19606", {
method: "get",
})
.then((data) => data.json())
.then(console.log);