Serialization#
Request and response models.
APIRequest#
APIResponse#
- class civicrm_py.APIResponse[source]
-
CiviCRM API v4 response structure.
- values
List of returned entities.
- Type:
list[civicrm_py.core.serialization.T] | None
- count
Total count of matching records.
- Type:
int | None
- countFetched
Number of records actually returned.
- Type:
int | None
- error_message
Error message if request failed.
- Type:
str | None
- property is_error: bool
Check if response indicates an error.
- property first: T | None
Get first value from response or None.
APIv3Response#
- class civicrm_py.APIv3Response[source]
Bases:
StructCiviCRM API v3 response structure.
APIv3 reports errors in-band (HTTP 200 with
is_error: 1), andvaluesis keyed by entity ID unless the request setsequential: 1.- is_error
1 if the call failed, else 0.
- Type:
- error_message
Error message if the call failed.
- Type:
str | None
- version
API version (always 3).
- Type:
int | None
- count
Number of returned records.
- Type:
int | None
- values
Records, as an ID-keyed object or (sequential) a list.
- is_error: int
- property first: Any
Get first record or None.