Hello,
The error comes from the fact that field "Is Portal Enabled?" is set to "true" (I indeed wanted to create portal access at the same time): in this case, the api expects contact_person_ID available in the JSON, which is not available by definition, since we are creating the contact_name and contract_person_ID as primary contact at the same time based on fields "First Name", "Last Name" and "email".
When I disable client portal access, the
contact is properly created
contact_name : tester
with primary contact person:
first_name: anny
last_name: go
email:
[email protected]
is_primary_contract: true
is_added_in_portal: false
What this means: I do not think it is possible to create a contact and grant portal access if the primary contact ID is not known/created yet. Hence in the app to create contact,
it makes no sense to select "enable portal access".
In case the contact person would already exist, and we would use the "create contact app" enabling access to portal, then we miss a field to map primary contact ID. I believe there is very low probability that someone needs to create a company for an already existing contact person, as we cannot create a contact person independently from a company.
What I will do: simply use the app with "enable portal access" always set on false.
Maybe you should consider:
- either removing field to create portal access from this app (I guess default is false). I believe this is best option
- or add field for contact_person_ID
Kind regards
Fanny Cattiaut
www.opti-biz.com