Contentful logo

Contentful Community

The resource could not be found on creating an asset

I get “The resource could not be found.” error when trying to create an asset with the below data.
And the requestId is “0de6d43897731cfcba57c87ae2f4288f”
I don’t get why the error is saying ‘resourc not found’ while you can access https://www.peta.org/wp-content/uploads/2010/06/iStock_000008440542XSmall1.jpg
Can you please tell me what I am doing wrong?

URL = https://cdn.contentful.com/spaces/r5nx9ek8zq03/environments/staging/assets/wtrHxeu3zEoEce2MokCSi

Method = POST

Headers

{
    "Authorization": "Bearer my-management-token",
    "Content-Type": "application/vnd.contentful.management.v1+json"
}

Body

{
	"fields": {
		"title": {
			"en-US": "Thumbnail of color bomb"
		},
		"file": {
			"en-US": {
				"contentType": "image/jpg",
				"fileName": "iStock_000008440542XSmall1.jpg",
				"upload": "https://www.peta.org/wp-content/uploads/2010/06/iStock_000008440542XSmall1.jpg"
			}
		}
	}
}

Thanks in advance!

Hi @ansun.shin1,

Could you clarify which endpoint you’re sending this request to? Does it refer to this section?

It seems like the URL of your request in pointing instead to our Delivery API (cdn.contentful.com) whereas it should be api.contentful.com for the Management API.

Let me know if that makes sense.

Oh you’re right. I was being like an idiot :joy:
Thank you so much for the quick answer!

Have a great holiday :star_struck:

No problem at all, I’m glad it helped :smile:

1 Like