External API Lookup

You can add an External API Lookup extension to your stack to allow you to fetch resources from third-party/external apps using APIs and display the resources in a field in Contentstack. Using this extension, content managers can select one or more resources from a list of possible values while creating an entry.

This step-by-step guide explains how to create an External API Lookup extension for your content types:

  1. Add the ‘External API Lookup’ custom field to your Stack
  2. Use your custom field
  1. Add the ‘External API Lookup’ custom field to your stack

      Create New Extension.png
    2. Select Custom Field.
      select extension type - custom field
      • Title: Provide a suitable title for your extension field. For example, ‘External API Lookup’.
      • Field Data Type: Select the data type in which the input data of the field should be saved in Contentstack. Select ‘Text’ in this case.
      • Multiple: Leave this checkbox unchecked.
      • External source code: In this field, you need to enter the extension code. To get the code, download it from here.
      • Config Parameter: Provide values for the config parameters if you have used any in your source code. For the External API Lookup extension, you need to provide the Rest API endpoint that fetches the list. Here’s an example:
            "url": "https://jsonplaceholder.typicode.com/users/

        Here's how the configuration page looks like:

        API Lookup Extension Edit page.png
    4. Click on Save. This creates your extension.

    Now, let’s understand how you can start using your extension in your content type.

  2. Use your custom field


    1. Create a content type by clicking on the + New Content Type. Enter the relevant details for the content type and click on Create and Add fields.
      Create Content Type.png
    2. Add the Custom field in your content type.
      Add 'Custom Field'.png
    3. Select External API Lookup from the dropdown and set the other properties of your custom field.
      Select 'External API Lookup' from dropdown.png



    This will create your Content Type. Now, go to the content type and create a new entry. Enter the relevant details. In the External API Lookup field, select any value while creating an entry for this content type as shown below:

    External API Lookup Extension Demo.png

On This Page