Image URL not showing on API Call Strapi v4

I’m only getting id and attributes. Within the attributes there is no image, media or anything. Also no relational fields are showing either.

{
id: 2,
attributes: {
title: ‘Test Title’,
body: ‘Test Body’,
date: null,
createdAt: ‘2021-11-30T20:52:09.206Z’,
updatedAt: ‘2021-11-30T20:57:26.724Z’,
publishedAt: ‘2021-11-30T20:57:26.720Z’
}
}

3 Likes

Never mind, found the answer. Should’ve watched the V4 deep dive more closely, about the REST API at around the 5:07 mark. Strapi auto filters relations. To get relations if anyone is wondering is to use the populate field in the call. Example to get all relations is : GET /api/books?populate=*

8 Likes

I am working on a migration from our current CMS to Strapi . Is there a way to post images to ‘/upload’ from an external URL

I just tried out uploading image from url and accessing via the upload/file api call and it looks like it works. It might be that you need to open up some of the security settings for upload files.

thanks the information