ContactType.php
This api exposes CiviCRM contact types and sub-types.
CiviCRM comes with 3 primary contact types - Individual, Organization & Household. Changing these is not advised, but sub_types can be created with this api. Pass 'parent_id' param to specify which base type a new sub_type extends.
Table of Contents
Functions
- civicrm_api3_contact_type_create() : array<string|int, mixed>
- Create/update ContactType.
- civicrm_api3_contact_type_get() : array<string|int, mixed>
- Returns array of contact_types matching a set of one or more properties.
- civicrm_api3_contact_type_delete() : array<string|int, mixed>
- Delete an existing ContactType.
Functions
civicrm_api3_contact_type_create()
Create/update ContactType.
civicrm_api3_contact_type_create(array<string|int, mixed> $params) : array<string|int, mixed>
This API is used to create new ContactType or update any of the existing In case of updating existing ContactType, id of that particular ContactType must be in $params array.
Parameters
- $params : array<string|int, mixed>
-
Array per getfields metadata.
Return values
array<string|int, mixed> —ContactType array
civicrm_api3_contact_type_get()
Returns array of contact_types matching a set of one or more properties.
civicrm_api3_contact_type_get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
One or more valid property_name=>value pairs. If $params is set as null, all contact_types will be returned
Return values
array<string|int, mixed> —Array of matching contact_types
civicrm_api3_contact_type_delete()
Delete an existing ContactType.
civicrm_api3_contact_type_delete(array<string|int, mixed> $params) : array<string|int, mixed>
This method is used to delete any existing ContactType given its id.
Parameters
- $params : array<string|int, mixed>
-
[id]
Return values
array<string|int, mixed> —API Result Array