You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add detailed Field Value Resource table with all attributes
- Add Field Value Value Type table showing value formats
- Add query parameters table for GET /field-values
- Add payload parameters table for POST /field-values
- Add path and payload parameters tables for PUT /field-values
- Add path parameters table for DELETE /field-values
- Enhance Field Value Changes supported types section
- Fix field_id requirement note in GET /field-values-changes
Copy file name to clipboardExpand all lines: docs/v1/affinity_api_docs.md
+64-23Lines changed: 64 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1222,19 +1222,42 @@ As an example for how a field value is created:
1222
1222
1223
1223
Each field value object has a unique id.
1224
1224
1225
-
A field value also has field_id, entity_id, and list_entry_id attributes that give it the appropriate associations, as noted in the example above.
1225
+
A field value resource has the following attributes:
1226
1226
1227
-
Use the created_at and updated_at timestamps on field values to determine when the value(s) for a given field have last been added or changed. Please note that what might amount to an "update" in production may actually be a delete followed by a create in the API.
1227
+
| Attribute | Type | Description |
1228
+
|-----------|------|-------------|
1229
+
| id | integer | The unique identifier of the field value object. |
1230
+
| field_id | integer | The unique identifier of the field (column) that this value belongs to. |
1231
+
| entity_id | integer | The unique identifier of the entity (person, organization, or opportunity) that this value is associated with. |
1232
+
| list_entry_id | integer | The unique identifier of the list entry (row) that this value is associated with. This is null for global field values. |
1233
+
| entity_type | integer | The type of entity (0=Person, 1=Organization, 8=Opportunity). |
1234
+
| value_type | integer | The type of value stored. See [Field Value Value Type](#field-value-value-type) below. |
1235
+
| value | varies | The actual value stored. The format depends on the value_type. See [Field Value Value Type](#field-value-value-type) below. |
1236
+
| created_at | string | The timestamp when the field value was created. |
1237
+
| updated_at | string | The timestamp when the field value was last updated. |
1228
1238
1229
-
A field value can take on many different kinds of values, depending on the field value type (see Field section).
1239
+
Use the created_at and updated_at timestamps on field values to determine when the value(s) for a given field have last been added or changed. Please note that what might amount to an "update" in production may actually be a delete followed by a create in the API.
1230
1240
1231
-
Field
1241
+
A field value can take on many different kinds of values, depending on the field value type (see [Field section](#field)).
1232
1242
1233
1243
> **Note**
1234
1244
> When retrieving Field Values from a specific cell in your Affinity list, it may be helpful to think about it as an XY coordinate system. The X coordinate is the List Entry or Entity and the Y coordinate is the Field.
1235
1245
1236
1246
#### Field Value Value Type
1237
1247
1248
+
The value types below determine the format of the `value` attribute in a field value:
The Field Types specified below correspond to the value_type of a field.
1239
1262
1240
1263
#### Get Field Value
@@ -1266,7 +1289,14 @@ GET /field-values Response:
1266
1289
1267
1290
Returns all field values attached to a person, organization, opportunity, or list_entry.
1268
1291
1269
-
#### Query Parameter
1292
+
#### Query Parameters
1293
+
1294
+
| Parameter | Type | Required | Description |
1295
+
|-----------|------|----------|-------------|
1296
+
| person_id | integer | custom*| The unique identifier of the person object. Exactly one of person_id, organization_id, opportunity_id, or list_entry_id must be specified. |
1297
+
| organization_id | integer | custom*| The unique identifier of the organization object. Exactly one of person_id, organization_id, opportunity_id, or list_entry_id must be specified. |
1298
+
| opportunity_id | integer | custom*| The unique identifier of the opportunity object. Exactly one of person_id, organization_id, opportunity_id, or list_entry_id must be specified. |
1299
+
| list_entry_id | integer | custom*| The unique identifier of the list entry object. Exactly one of person_id, organization_id, opportunity_id, or list_entry_id must be specified. |
Create a new field value with the supplied parameters.
1313
1343
1314
-
field_id integer true The unique identifier of the field (column) that the field value is associated with.
1315
-
1316
-
entity_id integer true The unique identifier of the entity (person, organization, or opportunity) that the field value is associated with.
1317
-
1318
-
| This determine whether the fields objects is required. | field_id | The unique identifier of the fields (column) that the field value is associated with. | entity_id |
1319
-
value custom true See the Field Value Resource section for all value type. The value specified must correspond to the value_type of the supplied fields. For ranked dropdowns fields like the default Sta
1320
-
1321
-
| The unique identifier of the entity (person, organization, or opportunity) that the field value is associated with. | value | custom | See the Field Value Resource section for all value type. The value specified must correspond to the value_type of the supplied fields. For ranked dropdowns fields like the default Status field, you must |
1322
-
Field Value Resource
1344
+
#### Payload Parameters
1323
1345
1324
-
list_entry_id integer false The unique identifier of the list entry (list row) that the field value is associated with. Only specify the list_entry_id if the field that the field value is associated with is list-specific.
1346
+
| Parameter | Type | Required | Description |
1347
+
|-----------|------|----------|-------------|
1348
+
| field_id | integer | true | The unique identifier of the field (column) that the field value is associated with. |
1349
+
| entity_id | integer | true | The unique identifier of the entity (person, organization, or opportunity) that the field value is associated with. |
1350
+
| value | custom | true | The value to store. The format must correspond to the value_type of the field. For ranked dropdown fields (like the default Status field), you must provide the dropdown option ID. See [Field Value Resource](#the-field-value-resource) section for value formats by type. |
1351
+
| list_entry_id | integer | false | The unique identifier of the list entry (list row) that the field value is associated with. Only specify the list_entry_id if the field that the field value is associated with is list-specific. |
1325
1352
1326
1353
#### Return
1327
1354
@@ -1350,10 +1377,18 @@ curl -X POST "https://api.affinity.co/field-values" \
1350
1377
1351
1378
Update the existing field value with field_value_id with the supplied parameters.
1352
1379
1353
-
#### value custom true See the Field Value Resource section for all value type. The value specified must correspond to the value_type of the supplied fields. For ranked dropdowns fields like the default Sta
1380
+
#### Path Parameters
1381
+
1382
+
| Parameter | Type | Required | Description |
1383
+
|-----------|------|----------|-------------|
1384
+
| field_value_id | integer | true | The unique identifier of the field value object to update. |
1354
1385
1355
-
| list_entry_id | The unique identifier of the list entry (lists row) that the field value is associated with. Only specify the list_entry_id if the fields that the field value is associated with is lists specific. | value | custom |
1356
-
Field Value Resource
1386
+
#### Payload Parameters
1387
+
1388
+
| Parameter | Type | Required | Description |
1389
+
|-----------|------|----------|-------------|
1390
+
| value | custom | true | The new value to store. The format must correspond to the value_type of the field. For ranked dropdown fields (like the default Status field), you must provide the dropdown option ID. See [Field Value Resource](#the-field-value-resource) section for value formats by type. |
1391
+
| list_entry_id | integer | false | The unique identifier of the list entry (list row) that the field value is associated with. Only specify the list_entry_id if the field that the field value is associated with is list-specific. |
1357
1392
1358
1393
#### Return
1359
1394
@@ -1385,6 +1420,12 @@ curl -X PUT "https://api.affinity.co/field-values/20406836" \
1385
1420
1386
1421
Delete a field value with the specified field_value_id.
1387
1422
1423
+
#### Path Parameters
1424
+
1425
+
| Parameter | Type | Required | Description |
1426
+
|-----------|------|----------|-------------|
1427
+
| field_value_id | integer | true | The unique identifier of the field value object to delete. |
1428
+
1388
1429
#### Example Request
1389
1430
1390
1431
```bash
@@ -1415,14 +1456,14 @@ Fields that are automatically created and "enriched" by Affinity do not support
1415
1456
1416
1457
Among fields that are not enriched, only the ones with the following data types support change tracking:
1417
1458
1418
-
#### Multi-valued Field
1459
+
-**Multi-valued fields**: Fields where `allows_multiple` is `true` and the field has `track_changes` set to `true`
1460
+
-**Single-valued fields**: Fields where `allows_multiple` is `false` and the field has `track_changes` set to `true`
1419
1461
1420
-
#### Single-valued field
1462
+
> **Note**
1463
+
> Ranked dropdown fields (like Status fields) typically support change tracking.
1421
1464
1422
1465
> **Note**
1423
-
> You can also see if a field does so by looking at the track_change attribute in the Field Resource. The API will return an appropriate error if the field doesn't support historical tracking.
1424
-
>
1425
-
> Field Resource
1466
+
> You can also see if a field supports change tracking by looking at the `track_changes` attribute in the [Field Resource](#the-field-resource). The API will return an appropriate error if the field doesn't support historical tracking.
0 commit comments