Add person
Add a new person to the site which can include person, household, email, cell, phone, custom fields and adding them to a group (required when user is clustered)
There are few mandatory fields, these are determined by the configuration of the site. Specific custom fields can be set as mandatory for instance. The fields the authenticated user is allowed to set are determined by the permissions in the role, e.g. if the role is not allowed to see archived people, then the archive field cannot be set. Invalid field names, or valid field names that the authenticated user does not have access to are returned with the error "Invalid Field".
Mandatory custom fields. The rule is that if the authenticated user can see the field, then its mandatory. There are 2 ways a field is hidden:
a) The field is on the 'involvement' tab - visibility is controlled based on the role "Can edit involvement tab"
b) A contact type is identified, and Custom Views are setup, and the mandatory field is visible in that contact type.
This method means that you can have a contact type of a "Fence Post" which has some mandatory fields, and another that is "Individual" which has others, and only those mandatory fields that are for the type specified are checked.
Body Required
-
firstname string
Contacts first name. Mandatory
-
lastname string
Contacts last name. Mandatory
-
middlename string
Contacts middle name. Optional
-
title string
Contacts title. Optional
-
gender string
Contacts gender. Organisation can be used to determine an organisation contact. Optional.
Values are
Male
,Female
, orORGANISATION
. -
archived integer
Whether this contact is archived (1) or not (0). Optional. Will default to 0. Authenticated user must have access to archived people to be able to use this field.
Values are
0
or1
. -
maritalStatus integer
The ID of the marital status lookup. Use the lookup/list end point to identify. Optional
-
occupation integer
The ID of the occupation list. Use the occupation/list end point to identify Optional
-
guardian integer
Whether this person is a guardian (1) or not (0) of children in this household. Optional
Values are
0
or1
. -
dateOfBirth string
The date in local time. Use YYYY-MM-DD format. Optional but must be a date before or on todays date.
-
dateOfDeath string
The date in local time. Use YYYY-MM-DD format. Optional but must be a date before or on todays date.
-
salutation string
An alternative value to refer to this contact. Optional. Uses firstname if not provided.
-
nickname string
An alternative value to refer to this contact. Optional. Uses firstname if not provided.
-
userName string
Login name for the user - must be unique. Optional. Must have ability to "Create account and set roles" in authenticated uses role.
-
loginActive integer
Whether the login is active (1) or not (0). Optional. Must have ability to "Create account and set roles" in authenticated uses role.
Values are
0
or1
. -
roleId integer
Role for this users login. See the role list end points. Optional. Must have ability to "Create account and set roles" in authenticated uses role.
-
preferredContactMethod string
Contacts preferred contact method. Optional Use these codes. EML: Email TXT: Text DOC: Letter TEL: Phone FB: Facebook SL: Slack CEL: Cell
Values are
EML
,TXT
,DOC
,TEL
,FB
,SL
, orCEL
. -
organisationcontact string
Whether the contact is an Organisation Contact. If not used, you can use Gender field to set it - using ORGANISATION as the gender value. If set to Y, this overrides the setting in gender. Optional
Values are
Y
orN
. -
HouseholdName string
Either the Household or the Organisation Name. Optional
-
Addressline1 string
Optional.
-
Addressline2 string
Optional.
-
Addressline3 string
Only used for sites in countries with this address line enabled. Optional.
-
Addressline4 string
Only used for sites in countries with this address line enabled. Optional.
-
Area string
The Area (also called suburb or state). Optional
-
City string
The City for the address. Optional
-
PostalCode string
The postcode (also called Zip code). Optional. Required for UK clients when they are used to make a claim.
-
CountryCode string
See the country list endpoint to get list of codes
-
HousedholdPhone string
The primary phone number for this household (or organisation). Optional
-
Fax string
The primary fax number for this household (or organisation). Optional
-
ReceiptToAlias string
Used when receipting to identify the name this receipt should be be issued to. Optional. The other names are used if this is not provided.
-
ReceiptTo string
The default Receipt To setting for transactions. Use the following codes. hh: Household (or organisation) ind: Individual
Values are
hh
orind
. -
ReceiptToOneOff integer
The default setting as to how to combine transactions. Use the following codes. 0 : Combined 1 : One-off -1 : No receipt
Values are
0
,1
, or-1
. -
email array[object]
A list of email addresses for this person
-
phone array[object]
A list of personal phone numbers for this person
-
cell array[object]
A list of personal cell phone (mobile) numbers for this person
-
if supplying a single custom field, you can use this method. Just provide the ID and the value. For a list of custom fields, use customfields property
-
customfields array[object]
This is an array of custom fields. Each array element includes:
- custom field id
- value Use the customfield list endpoint to determine the ID of the custom field you want to add along with its type type - can be string or integer as determined by the type of field
Lookup: Use the ID of the associated lookup using the lookup end point to inspect Multi Lookup: Use a comma separated list of IDs of the associated lookup
-
groups array[object]
The list of groups to add this contact to whilst loading. Because this is adding a person, then the group must be the 'child-most' group of a tree. infoodle will automatically add the person to all the parent groups as needed.
If the authenticated user is a Cluster'ed login, then this group field containing 1 or more groups is required. And the group must be part of the users cluster also. If the authenticated user is not clustered, then this is optional.
curl \
-X POST https://YOURSITE.infoodle.com/apiv2/people \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"firstname":"John","lastname":"Smith","middlename":"Andrew","title":"Mr","gender":"Male","archived":0,"maritalStatus":9,"occupation":98,"guardian":1,"dateOfBirth":"1980-10-31","dateOfDeath":"2021-10-31","salutation":"Mr Jimmy James","nickname":"Jimmy","userName":"JohnSmith","loginActive":1,"roleId":43,"preferredContactMethod":"EML","organisationcontact":"N","HouseholdName":"The Jones Company Ltd","HouseNameNum":"The Vicarage","Addressline1":"1 The High Street","Addressline2":"1 Lower East Hampton","Addressline3":"string","Addressline4":"string","Area":"West Area","City":"Glasgow","PostalCode":"SW1A 1AA","CountryCode":"NZ","HousedholdPhone":"012 123 1234","Fax":"012 123 1234","ReceiptToAlias":"James' Institute","ReceiptTo":"hh","ReceiptToOneOff":1,"email":[{"type":"home","value":"c@b.com","active":1}],"phone":[{"type":"home","value":"+1 123 3214 1234"}],"cell":[{"type":"work","value":"+1 123 3214 1234"}],"customfields":[{"id":101,"value":"new text"}],"groups":[{"id":100,"permission":"F","functionid":214,"skillid":542,"dateStarted":"2022-05-01","dateLeft":"2022-07-01","parentPermission":"V"}]}'
{
"firstname": "John",
"lastname": "Smith",
"middlename": "Andrew",
"title": "Mr",
"gender": "Male",
"archived": 0,
"maritalStatus": 9,
"occupation": 98,
"guardian": 1,
"dateOfBirth": "1980-10-31",
"dateOfDeath": "2021-10-31",
"salutation": "Mr Jimmy James",
"nickname": "Jimmy",
"userName": "JohnSmith",
"loginActive": 1,
"roleId": 43,
"preferredContactMethod": "EML",
"organisationcontact": "N",
"HouseholdName": "The Jones Company Ltd",
"HouseNameNum": "The Vicarage",
"Addressline1": "1 The High Street",
"Addressline2": "1 Lower East Hampton",
"Addressline3": "string",
"Addressline4": "string",
"Area": "West Area",
"City": "Glasgow",
"PostalCode": "SW1A 1AA",
"CountryCode": "NZ",
"HousedholdPhone": "012 123 1234",
"Fax": "012 123 1234",
"ReceiptToAlias": "James' Institute",
"ReceiptTo": "hh",
"ReceiptToOneOff": 1,
"email": [
{
"type": "home",
"value": "c@b.com",
"active": 1
}
],
"phone": [
{
"type": "home",
"value": "+1 123 3214 1234"
}
],
"cell": [
{
"type": "work",
"value": "+1 123 3214 1234"
}
],
"customfields": [
{
"id": 101,
"value": "new text"
}
],
"groups": [
{
"id": 100,
"permission": "F",
"functionid": 214,
"skillid": 542,
"dateStarted": "2022-05-01",
"dateLeft": "2022-07-01",
"parentPermission": "V"
}
]
}
{
"ok": 1,
"id": 123213,
"errors": [
{
"fieldname": "firstname",
"message": "Mandatory field not provided"
}
]
}