Unable to connect to strapi end points (404 Not found error)

System Information
  • **Strapi Version4.4.5:
  • **Operating SystemWindows:
  • **DatabaseStrapi:
  • **Node Version16.18.0:
  • **NPM Version8.19.2:
  • Yarn Version:

Hello Everyone,

I am new to Strapi. I am trying to connect to endpoints through browser but getting 404 error.

I created a simple collection type.
I gave this collection a public permission:

Still getting 404
image

And the contents are in publish state:

According to documentation “For each Content-Type, the following endpoints are automatically generated:”

Not sure why then I am unable to access the contents? 

Thank you.


image

Try /api/blogs

1 Like

Thanks /api/blogs work

hi all, I’m having the same problem , I did a quickstart strapi installation, created some content , but am unable to access it via get requests
when I try o access the published content with http://localhost:1337/api/contentpanels
I see:
{
“data”: null,
“error”: {
“status”: 404,
“name”: “NotFoundError”,
“message”: “Not Found”,
“details”: {}
}
}

might be a problem if you have typescript enabled but used a template by strapi. Templates are for some reason in vanilla Javascript so template files are .js, change these to .ts and it solved this problem for me.

I am using strepi get api but when i try using it in react js its throwing errow // Status Code:

404 Not Found . please help

State what u tried, examples with code etc, otherwise i can’t help u

1 Like

use the plural /blogs. You’ll get the meta information like this one:

{
    "data": [],
    "meta": {
        "pagination": {
            "page": 1,
            "pageSize": 25,
            "pageCount": 0,
            "total": 0
        }
    }
}

And then access to ids
blogs/1

I don’t know if all you guys found the solution to this. But I was able to solve this by updating the permissions of the api. In “Strapi Dashboard” select “Settings”, then in section “Users & Permissions Plugin” select “Roles” and edit the “Public” role by clicking on the small pencil. Find the api you want to access and set the permissions accordingly. You should be able to see the content by entering …/api/your_api_names (in plural).