Create new collection type issue can't receive data

System Information
  • Strapi Version: 4.0.0
  • Operating System: Window
  • Database: -
  • Node Version: v14.17.3
  • NPM Version: 6.14.13
  • Yarn Version:

Hi I’m new with Strapi, please help, so I created new collection types, I had to change my collection name from events to event since the “events” word give me an error because of the plural.

I also already updated or allowed: users & permission roles for public and authenticated

After creating the event collection, I tried to check on my localhost: http://localhost:1337/event

However, I can’t receive the data, it shows me:
{“data”:null,“error”:{“status”:404,“name”:“NotFoundError”,“message”:“Not Found”,“details”:{}}}

I’m not sure what else can be done, what am I missing?

Here are some screenshots:

Hi. Can you try accessing the data via this route http://localhost:1337/api/event


Hi Dev, thanks for your reply, i’m able to access if I’m using this: http://localhost:1337/api/events

I’m not sure why do we need to access with api? in the previous version before this, without api is working

1 Like

Were you able to solve the issue? I’m having the same issue as well.

I have the same issue, and using /api doesn’t give me the data.

and i have data in the content type.

Found the answer here:

thanks Elie i had the same problem. :grinning:

I have not succesfully been able to rename a colletcion type.
The issues is that the entry name is used in multiple places including the database. So when you change the name in the UI, it changes the api model name in the .json file, but not the name of the json file itself event.settings.json {“collectionName”: “event”}

event.settings.json {“collectionName”: “events”}
nor does it change the database table name

The best thing to do i found, is to:

  • create a new collection in the UI replace
  • copy the old model folder (root>api>event)
  • change the api model folder name representing the new collection name
  • go through the files in the folder and change all occurances off the old collection name into the new one

No obviously this is a bit of work, so decide wether its easier to just built a new collection model from the uit (if its a simple one) or do this workaround if you have an extensive model built.