Set the value of a field that references a DataTable object, such as a contact or another asset
Call template
All DataTable calls can be POST or GET.
https://{OrangeLogicURL}/API/DataTable/V2.2/Documents.{type}.{subtype}:Update?{asset identifier}&CoreField.CT_RecordidSource{operator}[Contacts.Source.Default:CoreField.Identifier={unique identifier of Source Account record}]
Specify the asset type and subtype, provide an asset identifier, and then use an operator to add or remove a specified contact. Use this structure to add or remove metadata that is based on a linked field.
For example, suppose you have a Photographer field linked to your Staff contacts. To add or update the photographer of an asset, use the structure above and replace CT_RecordidSource
with the name of your field, and replace Contacts.Source.Default
with Contacts.Staff.Default
.
Note
Linked field calls include a sub-call that locates a record in the database. The sub-call is enclosed in square brackets.
For example, consider the following call:
/API/DataTable/V2.2/Documents.Image.Default:Update?CoreField.Identifier=ZZ12PAR&CoreField.CT_RecordidSource:=[API/DataTable/V2.2/Contacts.All:Read?CoreField.Identifier=ZZ1CT298]
In this call, the sub-call is:
API/DataTable/V2.2/Contacts.All:Read?CoreField.Identifier=DZZ1CT298
The sub-call evaluates the Contacts DataTable to find a standard Source account contact that has the unique identifier ZZ1CT298. You could use this structure to create a different sub-call that:
- Evaluates a different DataTable, such as Groups instead of Contacts.
- Evaluates a different account type, such as Staff instead of Source.
- Uses a different identifier, such as email address instead of unique ID.
Update
Example: Assign a source to an asset
This call identifies a Standard image with the identifier ZZ12PAR and the Source field (CoreField.CT_RecordidSource
). It then populates the Source field with the Contact record with the identifier ZZ1CT298.
/API/DataTable/V2.2/Documents.Image.Default:Update?CoreField.Identifier=ZZ12PAR&CoreField.CT_RecordidSource:=[API/DataTable/V2.2/Contacts.All:Read?CoreField.Identifier=ZZ1CT298]
Example call
curl --location --globoff --request POST 'https://mangovations.com/API/DataTable/V2.2/Documents.Image.Default:Update?CoreField.Identifier=ZZ12PAR&CoreField.CT_RecordidSource%3A=[API%2FDataTable%2FV2.2%2FContacts.All%3ARead%3FCoreField.Identifier%3DZZ1CT298]' \
--header 'Authorization: Bearer hfi2w6t6yMen5bzaFIKPx2OHiVT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yCztRV1ku1dqvnfj7RIbzSNJMzHQa2u6SJ49pQzPL4YVIB%2Fb8CiNgvS8F2LAVOCuw0U0rclxa5qtHKTRHvXH3%2Fy'
Response
<Result>
<APIRequestInfo>
<ProviderVersion>KOBE.R2.2065G.216363</ProviderVersion>
<ProviderIdentity>CUY-T-USW2-APP</ProviderIdentity>
<ProviderID>44ddde3ac27a33c394335f249d4007d4</ProviderID>
<Module>DataTable</Module>
<APIVersion>V2.2</APIVersion>
<Resource>Documents.Image.Default:Update</Resource>
<IsLoggedIn type="Boolean">True</IsLoggedIn>
<Status>LoggedIn</Status>
<UserLogin>ZZ1CT12218</UserLogin>
<Session>No session (production configuration)</Session>
<TimeoutPeriodMinutes type="Numeric">120</TimeoutPeriodMinutes>
</APIRequestInfo>
<RequestInterpretation>
<Filters type="List">
<Filter>
<Field>CoreField.Identifier</Field>
<Operator>=</Operator>
<OperatorDescription>Field must be equal to value</OperatorDescription>
<Value>ZZ12PAR</Value>
</Filter>
</Filters>
<Updates type="List">
<Update>
<Field>CoreField.CT_RecordidSource</Field>
<Operator>:=</Operator>
<OperatorDescription>Assign a value to a single-value field</OperatorDescription>
<Value>[API/DataTable/V2.2/Contacts.All:Read?CoreField.Identifier=ZZ1CT298]</Value>
</Update>
</Updates>
<IgnoredParameters type="List" />
</RequestInterpretation>
<ResponseSummary>
<NumberOfRecordsAffected type="Numeric">1</NumberOfRecordsAffected>
</ResponseSummary>
<Response>
<RecordsAffected type="List">
<Result>
<RecordID>2QDTWAGP1T3</RecordID>
<Code>SUCCESS</Code>
</Result>
</RecordsAffected>
</Response>
</Result>