Skip to main content

Introduction

Managing asset statuses efficiently is a common requirement in workflows involving digital asset management systems. This guide demonstrates how to automate the process of searching for assets, filtering them based on their last update date, retrieving available statuses, and updating the status of selected assets. By following these examples, you can streamline your asset management tasks and integrate them into your existing workflows. Authentication is a critical step in interacting with the Mudstack API. Each request requires an authorization token, which is obtained using your API key and secret. Additionally, the x-workspace-id and x-account-id headers must be included in every request to ensure proper scoping. This example is particularly useful for scenarios such as:
  • Keeping track of assets that require immediate attention.
  • Automating status updates for assets based on predefined criteria.
  • Integrating asset management with other systems or workflows.
This example demonstrates how to:
  1. Authenticate and retrieve an authorization token.
  2. Search for assets in a specific path using the /workspaces/assets/search endpoint.
  3. Filter out assets that are more than 2 weeks old.
  4. Retrieve all asset statuses using the /workspaces/assetStatuses endpoint and find the status with the name “In Progress”.
  5. Assign the status_id of the “In Progress” status to each filtered asset and update them using the /workspaces/assets/{asset_id} endpoint.

Steps

Step 1: Authenticate and Retrieve an Authorization Token

Use the /auth/token endpoint to retrieve an authorization token. Replace <your_account_id>, <your_key>, and <your_secret> with your account ID, API key, and secret, respectively.

Step 2: Search for Assets in a Specific Path

Use the /workspaces/assets/search endpoint to search for assets in a specific path. Replace <your_token>, <workspace_id>, and <account_id> with your authorization token, workspace ID, and account ID, respectively.
Response Example:

Step 3: Filter Assets Older Than 2 Weeks

Filter the assets by comparing the updated_at field to the current date. This ensures only assets updated within the last 2 weeks are processed.

Step 4: Retrieve Asset Statuses and Find “In Progress”

Use the /workspaces/assetStatuses endpoint to retrieve all asset statuses. Identify the status with the name “In Progress”.
Response Example:

Step 5: Update Assets with the “In Progress” Status

For each filtered asset, assign the status_id of the “In Progress” status and update the asset using the /workspaces/assets/{asset_id} endpoint.
Response Example:

Explore More Examples

Looking for more examples? Check out the following guides to learn about other use cases: