Call external API

The Call external API automation runs custom JavaScript, allowing you to do anything from calling an API to building custom integrations. For example, you might use a script to send information to and receive information from an external service, automatically populating a field with AI-generated text or pulling in data from a home-grown system. Behind the scenes, these results are accomplished when a custom script automates API calls.

A Call external API script can be prompted by any system trigger. For example, the script could run when a user saves a particular kind of asset, changes a specific field, or clicks a custom button. Triggers can be part of a user’s day-to-day use of the DAM or part of a project-based workflow, such as one of the steps associated with a marketing campaign, photoshoot, or video production process.

The following examples are just a sampling of events that could trigger an automation and run the Call external API script:

  • An asset’s embargo or expiration date is reached.
  • A user updates an asset’s Visibility Class.
  • An asset is moved or uploaded to a particular folder.

Scripts can also be triggered by dynamic endpoints, allowing you to receive webhook data from external systems and emit custom webhooks with a dedicated action.

Run scripts synchronously or asynchronously

A triggered script can run immediately (synchronously) or in the background (asynchronously).

  • When a script runs synchronously, users see the results of the script immediately, before taking more action in the DAM. This behavior is ideal when a user needs information to complete a task. For example, a script might retrieve a product SKU or a localized product name from an external system, allowing the marketing team to combine images and product information in an ad campaign graphic.
  • When a script runs asynchronously, information is processed outside of the user’s session and you can specify a number of retries. This behavior is ideal when immediate processing might impact system performance, delay a user, or create a loop.
    For example, you could set the When a record is saved workflow trigger on the Visibility Class field. When a user changes an asset’s Visibility Class and saves the record, the trigger can prompt the Call external API action. The Call external API action can then update other metadata fields on the asset. In this scenario, the asynchronous option prevents the script from attempting to update the asset metadata while the record is still in the process of being saved and is therefore locked.

Integrated development environment

The Call external API automation has a simple integrated development environment (IDE), which provides a variety of tools that make it easy to connect your script with other Orange Logic functionality. For example, if you want your script to run in the background, use conditions to limit when your script runs, or create or modify related assets based on the result of a script, you can do so without writing custom code. You can also use placeholders and utilities to quickly incorporate standard Orange Logic metadata and actions into your script.

If you need to develop more complex automations, you can convert the Call external API to Javascript. Then, edit in your preferred IDE so you can follow your standard CI/CD process.

Call external API IDE

Call external API IDE

📘

Note

The Call external API JavaScript executes in a JINT runtime on an Orange Logic .NET C# server. You cannot use any frameworks outside of the placeholders and utilities developed by Orange Logic.