Louai Kelani
Louai Kelani

Reputation: 164

Strapi v4: can't add an image to entry with API

I can’t figure out what I’m doing wrong. The upload works. The image gets added to the media library. But it's not added to the entry.

Here’s my screenshot (Postman request):

enter image description here

Upvotes: 2

Views: 2764

Answers (1)

J.Bandenieks
J.Bandenieks

Reputation: 66

what I can tell from the docs is that you might need to change ref field value to api::article.article

https://docs.strapi.io/developer-docs/latest/plugins/upload.html#upload-files-related-to-an-entry

I hope this helps! I had the same issue and this resolved my issue. Strapi docs aren't the easiest to get around :(

Upvotes: 1

Related Questions