API Groupings allows you to group data within an API Resource. From a code perspective, this means you can create nested structures within a parent object.

For example, if you want to pull all Contacts along with the related Account IDs in one single call, you can create an API Grouping to nest two API Resources within each other. This mechanism also works with calls coming into your Fonteva app. Data pulled from an External Application and trigger Contacts to be created or updated and related to a specific Account ID

To create the above API Grouping:

  1. From the API Service Detail, [Click] .
  2. [Enter] the following information:
    • Name
    • API Resource - The appropriate API Resource with the parent object.
    • API Object - The data you want to be nested within the parent object (e.g.: Contacts)
    • Target Related Lookup Field - the field that relates the parent object to the data you want to be nested (e.g.: AccountID)
  3. [Click] .

The output of the above example would look like this:

{
	data : [
		{
			id : 'ACCOUNTID',
			name : 'ACCOUNTNAME',
			contacts : [
				{
					id : 'CONTACTID',
					primaryContact : false,
					desc : 'LONG DESCRIPTION',
					accountReferenceId : 'ACCOUNTID',
					user : {
						address : {
							street : '102 Main Street'
						}
					}
				},
				{
					
					primaryContact : true,
					desc : 'LONG DESCRIPTION2',
					user : {
						address : { 
							street : '123 Main Street'
						}
					}
				}
			}
		}
	}
}			
CODE

 

In the above output, one contact related to the AccountID object would be updated, and a 2nd contact would be created as a new contact when this data is sent to Fonteva.

See Framework__API_Grouping__c and Framework_Api_Grouping for more information.