Adding Endpoints, Resources, and Models

Referencing User Configurations in Resources

To pass configurations to a resource, you'll need to define a parameter that contains the value of the configuration. You'll then need to reference that parameter in your vendor path. In this example, we're extending the Pardot element to GET email clicks. 

The vendor path requires an API version, which is different for every account and is stored in configurations.

Here, we add a parameter that accesses the `provider.version` configuration value and sets the path variable to `providerVersion`. We'll then remove the hardcoded version value and replace it with our path variable.

Adding Models to Extended Resources (Support for VDRs)

When adding resources to an element, also known as extending an element, request/response models should be added to the new resource.  Without models, the new resource cannot support VDRs. 

  1. Open the resources tab for the element
  2. For the resource in question, use the 'try it out' functionality to make a request.
  3. Copy the response. 
  4. Click Cancel to exit 'Try It Out'.
  5. Edit the resource.
  6. Click on 'Response Model'. 
  7. Click on 'Generate From Sample Payload'.
  8. Paste the response from #2 above, then generate the model and save .

Frequency of Model Changes for a Given Resource

Models for a resource in an element rarely change. Typically, changes only occur when the provider updates/changes either their API or the data their API expects/returns.

Infinity Models

Every element consists of objects which contain different resources. Any object can contain resources such as GET, GET/ {id}, POST, PATCH etc. In the example shown below, accounts is the object and it contains five resources.
Each of these resources have models that contain its metadata. Although the metadata in a model is mostly similar to that of the models of other resources, making a change to even a single field of the metadata could be a task because the user would need to make that change for all the models of all the resources available for an object. 

Infinity Models provide an easy way to build or edit models without having to manually work on JSONs or make the same changes at multiple places. It works at object level and can be found at the resources page.

This feature is made of a table consisting all the fields in a model of an object and its details.

It also has buttons and widgets that help you navigate through building or editing a model.

Using Infinity Models, you can manipulate each of the properties of a model using the above table and widgets, allowing you to customize the models of each resource available for the different objects in an element.

Virtual Data Resource Transformations on Elements

To create transformations on your custom Element Builder elements, you are required to have models on the desired resources because we use the models to generate metadata for the Virtual Data Resources (VDRs). 

To generate models: 

  1. Grab a sample response payload from the desired resource.
  2. In the model section, use the "Generate from Payload" functionality.