craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.22k stars 627 forks source link

3.3.13 breaks Element API endpoint #5167

Closed rogertinch closed 4 years ago

rogertinch commented 4 years ago

Description

Updated to 3.3.13 and our Element API endpoints started to return 404 errors.

Steps to reproduce

  1. Check an endpoint to verify a good response
  2. Update to 3.3.13
  3. Recheck endpoint to get 404 error

Additional info

narration-sd commented 4 years ago

It might be something else, but if you're using the standard site.com/api connection for your Element Api, you could try simply curl your.site.com/api, substituting your site, and see what you get.

If the result's something like this:

{"name":"Forbidden","message":"Invalid authorization token.","code":0,"status":403}

then you're possibly accessing Craft's new internal GraphQL instead of your expected Element API. (the actual status can vary with version, would be 40x)

If that's the case, I'd have a look at your config/routes.php file, and either change or add appropriately so that you have a different route for the internal Gql.

Something like the following:

return [
    'gql' => 'graphql/api'
];

Again, it could well be something else, and then the Craft people will help you, but since it's Friday, thought to suggest...

narration-sd commented 4 years ago

Or, could also be your Element API plugin managed to disable or de-install on the upgrade...

brandonkelly commented 4 years ago

Element API is still working fine on my end with Craft 3.3.13. If you write into support@craftcms.com we can help troubleshoot from there.