FeatureFuel
5

Add Full Asset URL to API Response

Source: directus/directus#24390 · opened by @xndyz
Summary Currently, when retrieving file/image information through the Directus API, only basic fields like the asset ID are returned. This requires developers to manually construct the full asset URL by combining the storage URL prefix with the asset ID. [Discord thread discussion](1328027479142695025) Basic Example _No response_ Motivation This creates several issues: 1. Developers need to maintain the storage URL prefix across their codebase 2. Every query involving asset fields needs to be manually expanded to get required fields like filename_disk 3. The current approach leads to unnecessary boilerplate code for a very common operation 4. The pattern is not immediately obvious to new developers, creating a learning curve Detailed Design Add a new field (e.g., storage_url or public_url) to the API response for file assets that includes the complete, ready-to-use URL for the asset. This URL should combine: The public URL prefix The /assets/ path The asset ID Th…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests