Skip to main content

Aprimo DAM PageHooks

PageHooks let you connect Aprimo DAM to your own applications or services. They appear as custom actions in the DAM UI and can send information to an external service, then show feedback or open a page based on the response. Use PageHooks to extend Aprimo with your own workflows — for example, enriching metadata, launching a process, or linking to an external system.


How PageHooks Work

PageHooks let you surface custom actions in the DAM UI that call an external application or service. The DAM UI sends a small payload and expects an HTTP response back.

Think of a PageHook as a server-side extension point triggered from the UI.


Where PageHooks Are Configured

Action Definition Model

  • Actions are declared in an Action definitions list with:

    • name: internal identifier
    • type: pageHook
    • (Optional) conditions: content type, user groups, permissions, field values
    • parameters: sendToken, endpoint URL, timeout, location

As a developer, you supply the URL Aprimo should call; admins wire the actions into menus and set conditions.

PageHook Action Parameters

  • sendToken:
    • "access-token": include access token in context of triggering user
  • url: your endpoint to invoke
  • location: how to open a returned URL "self" (same tab) or "new" (new tab). If omitted, new tab is used
  • timeout: max 30 seconds (default is 15)
  • httpMethod: Defines the HTTP method to use — supports both POST and GET. Defaults to POST if unspecified

What To Return To Aprimo

When sending a POST request return one of the following:

  • Basic success (HTTP 2xx; no body) → DAM shows a generic success notification

  • To display a custom success message in the DAM UI, return:

    { "msg": "Action Complete." }
  • To redirect the user to a new URL, return:

    { "url": "https://yourapp.example/action/123" }
    • DAM opens the URL in the same or new tab depending on the action configuration.
  • To show a custom error message in the DAM UI, return:

    { "errorMsg": "Action failed. Please check the logs for further details." }

Keep payloads tiny. The UI only needs a message and/or a URL.


Using Tokens in URLs

The url parameter supports tokenized metadata substitution, allowing dynamic URLs to be generated based on values from a record. Tokens use the following syntax:

{{field:Field_Name}}
tip

URL Tokenization only works when the PageHook's httpMethod attribute is GET.

For example:

{
"url": "https://example.com/{{field:External_ID}}"
}

When the PageHook executes, Aprimo replaces the token with the actual metadata value from the record before launching the URL.

Supported tokens:

  • field: Fetches the value from a metadata field.

This feature allows the DAM UI to dynamically link to external applications using metadata stored in Aprimo.


What Context Aprimo Sends

When the user triggers a PageHook action, the PageHooks run in a specific context:

  • Record: The request will contain the unique identifier of the record so your service can fetch additional metadata via the REST API.
  • Collection: You’ll receive the collection identifier.
  • Basket / multi-select (DAM UI only): Your action may apply to multiple selected items.

Handling Timeouts and Errors

  • Timeout: Keep your synchronous work under 30 seconds, otherwise the Aprimo UI will timeout and users will see an error. If your process takes longer, return a success message to Aprimo indicating the request has been received or redirect the user to a status page and perform heavy work asynchronously.
  • Observability: Log correlation IDs from the request, and return user-friendly errorMsg on known failures.

Best Practices for Designs

  • Speed: If you can’t finish fast, hand off to your app.
  • Clarity: Return a short message or redirect URL.
  • Tab choice: Use same-tab when the action affects the current context (e.g., enrich metadata and come back). Use new-tab for external tools or long-running jobs.
  • Bulk behavior: Communicate limits or per-item results; for multi-select, show a receipt page.

Example Configurations

GET Example
{
"name": "CustomGETAction",
"type": "pageHook",
"conditions": [],
"parameters": {
"sendToken": "auth-code",
"url": "https://client.example.com/edit/{{field:External_ID}}",
"location": "new",
"clientId": "ConfiguredIntegrationClientID",
"timeout": 15,
"httpMethod": "GET"
}
}
POST Example
{
"name": "CustomPOSTAction",
"type": "pageHook",
"conditions": [],
"parameters": {
"sendToken": "auth-code",
"url": "https://client.example.com/edit/123456",
"location": "new",
"clientId": "ConfiguredIntegrationClientID",
"timeout": 15,
"httpMethod": "POST"
}
}

Troubleshooting

The page is not opening in a new window

Ensure that the location property is set to new in the action configuration.

Getting “page not found” or incorrect record behavior

Ensure that the record contains a valid value for the metadata field referenced in the tokenized url.


DAM Admin UI

The DAM Admin UI also supports PageHooks for actions on records and collections. Key differences are mostly where and how actions are configured; the developer surface (endpoint, token, response) remains the same.

You can read more about Admin UI PageHooks in the Aprimo help guide in your environment.


FAQ for Developers

Q: How do I get more than 30 seconds? You don’t. Pivot to a handoff URL and process asynchronously.

Q: Can I change the visibility of actions at runtime? Use action conditions for role/content scoping. Your service should also enforce business rules.

Q: What happens if my endpoint returns both msg and url? Prefer URL semantics in your design; if you need both, place the message on your landing page.

Q: Can a PageHook modify DAM content? Yes—use the access token to call Aprimo REST APIs, respecting the invoking user’s permissions.