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.
Comments
Similar requests
Allow replacement of S3 Bucket URL with a CDN URL
25 votes · 0 comments
Store asset transformations for reference when serving assets from outside of the studio app
3 votes · 0 comments
Live Preview option to automatically add a time-limited token to the query (incl. ENV vars)
18 votes · 0 comments
Direct Asset URL to Storage (S3, Azure, Cloudinary, etc)
70 votes · 0 comments
API Testing UI (Swagger-like) with Role-Based Simulation
5 votes · 0 comments
No comments yet.