FieldDatum
A field datum is an individual piece of data for a custom field.
Example Request
curl https://api.planningcenteronline.com/people/v2/field_data
Example Object
{
"type": "FieldDatum",
"id": "1",
"attributes": {
"file": "string",
"file_content_type": "string",
"file_name": "string",
"file_size": 1,
"value": "string"
},
"relationships": {
"field_definition": {
"data": {
"type": "FieldDefinition",
"id": "1"
}
},
"customizable": {
"data": {
"type": "Customizable",
"id": "1"
}
}
}
}
Attributes
| Name | Type | Description |
|---|---|---|
file |
string |
|
file_content_type |
string |
|
file_name |
string |
|
file_size |
integer |
|
id |
primary_key |
|
value |
string |
Relationships
| Name | Type | Association Type | Note |
|---|---|---|---|
| field_definition | FieldDefinition | to_one | |
| customizable | Customizable | to_one | Currently, the only customizable relationship is with |
Can Include
| Parameter | Value | Description | Assignable |
|---|---|---|---|
| include | field_definition | include associated field_definition |
create and update |
| include | field_option | include associated field_option |
|
| include | tab | include associated tab |
Order By
| Parameter | Value | Type | Description |
|---|---|---|---|
| order | file | string | prefix with a hyphen (-file) to reverse the order |
| order | file_content_type | string | prefix with a hyphen (-filecontenttype) to reverse the order |
| order | file_name | string | prefix with a hyphen (-file_name) to reverse the order |
| order | file_size | string | prefix with a hyphen (-file_size) to reverse the order |
| order | value | string | prefix with a hyphen (-value) to reverse the order |
Query By
| Name | Parameter | Type | Description | Example |
|---|---|---|---|---|
| field_definition_id | where[field_definition_id] |
integer | Query on a related field_definition |
?where[field_definition_id]=1 |
| file | where[file] |
string | Query on a specific file |
?where[file]=string |
| file_content_type | where[file_content_type] |
string | Query on a specific filecontenttype |
?where[file_content_type]=string |
| file_name | where[file_name] |
string | Query on a specific file_name |
?where[file_name]=string |
| file_size | where[file_size] |
integer | Query on a specific file_size |
?where[file_size]=1 |
| value | where[value] |
string | Query on a specific value |
?where[value]=string |
Pagination
| Name | Parameter | Type | Description |
|---|---|---|---|
| per_page | per_page | integer | how many records to return per page (min=1, max=100, default=25) |
| offset | offset | integer | get results from given offset |
Endpoints
Listing
| HTTP Method | Endpoint |
|---|---|
| GET | /people/v2/field_data |
Reading
| HTTP Method | Endpoint |
|---|---|
| GET | /people/v2/field_data/{id} |
Creating
| HTTP Method | Endpoint | Assignable Attributes |
|---|---|---|
| POST | /people/v2/people/{person_id}/field_data |
|
Updating
| HTTP Method | Endpoint | Assignable Attributes |
|---|---|---|
| PATCH | /people/v2/field_data/{id} |
|
Notes:
Given a person ID and a field definition ID with a data type of 'checkboxes', in order to 'check' the box for that profile, you want to do a POST request to /people/v2/people/<person_id>/field_data.
The payload must contain the field_definition_id and the string value.
{
"data": {
"attributes": {
"field_definition_id": <field_definition_id>,
"value": "Financial/Bills"
}
}
}
Note that if you POST with a value that does not already correspond to an existing fieldoption value for that fielddefinition, then the API will create a new one with that value.
You can GET all the existing checkbox values at /people/v2/field_definitions/<field_definition_id>/field_options.
To 'uncheck' the value of the checkbox, you can issue a DELETE to /people/v2/people/<person_id>/field_data/<field_datum_id>.
Deleting
| HTTP Method | Endpoint |
|---|---|
| DELETE | /people/v2/field_data/{id} |
Associations
| HTTP Method | Endpoint | Returns | Details | Filter By |
|---|---|---|---|---|
| GET | https://api.planningcenteronline.com/people/v2/field_data/{field_datum_id}/field_definition |
FieldDefinition | ||
| GET | https://api.planningcenteronline.com/people/v2/field_data/{field_datum_id}/field_option |
FieldOption | ||
| GET | https://api.planningcenteronline.com/people/v2/field_data/{field_datum_id}/person |
Person | ||
| GET | https://api.planningcenteronline.com/people/v2/field_data/{field_datum_id}/tab |
Tab |
Belongs To
| HTTP Method | Endpoint | Association | Details | Filter By |
|---|---|---|---|---|
| GET | https://api.planningcenteronline.com/people/v2/field_data |
Organization | ||
| GET | https://api.planningcenteronline.com/people/v2/people/{person_id}/field_data |
Person |