Configuring Element API 1.2.1 Plugin I'm running Craft CMS 2.6.2972 so I had to use the older Element API plugin.

I have downloaded the zip and then copied just the "elementapi" file in the zip to the plugin's folder.

Then I installed the plugin in the admin panel.

Then I made a file craft/config/elementapi.php with the contents

&lt;?php
namespace Craft;

return [
    'endpoints' =&gt; [
        'news.json' =&gt; [
            'elementType' =&gt; 'Entry',
            'criteria' =&gt; ['section' =&gt; 'news'],
        ]
    ]
];


But if I hit the URL &lt;myserver&gt;/api/news.json then I get the following error:

2017/05/12 17:31:47 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in C:\inetpub\wwwroot\craft\app\controllers\TemplatesController.php:59 Stack trace:
#0 [internal function]: Craft\TemplatesController-&gt;actionRender('api/news.json', Array)
#1 C:\inetpub\wwwroot\craft\app\framework\web\actions\CAction.php(109): ReflectionMethod-&gt;invokeArgs(Object(Craft\TemplatesController), Array)
#2 C:\inetpub\wwwroot\craft\app\framework\web\actions\CInlineAction.php(47): CAction-&gt;runWithParamsInternal(Object(Craft\TemplatesController), Object(ReflectionMethod), Array)
#3 C:\inetpub\wwwroot\craft\app\framework\web\CController.php(308): CInlineAction-&gt;runWithParams(Array)
#4 C:\inetpub\wwwroot\craft\app\framework\web\CController.php(286): CController-&gt;runAction(Object(CInlineAction))
#5 C:\inetpub\wwwroot\craft\app\framework\web\CController.php(265): CController-&gt;runActionWithFilters(Object(CInlineAction), Array)
#6 C:\inetpub\wwwroot\craft\app\framework\web\CWebApplication.php(282): CController-&gt;run('render')
#7 C:\inetpub\wwwroot\craft\app\framework\web\CWebApplication.php(141): CWebApplication-&gt;runController('templates/rende...')
#8 C:\inetpub\wwwroot\craft\app\etc\web\WebApp.php(290): CWebApplication-&gt;processRequest()
#9 C:\inetpub\wwwroot\craft\app\framework\base\CApplication.php(185): Craft\WebApp-&gt;processRequest()
#10 C:\inetpub\wwwroot\craft\app\index.php(62): CApplication-&gt;run()
#11 C:\inetpub\wwwroot\public\index.php(14): require_once('C:\\inetpub\\wwwr...')
#12 {main} REQUEST_URI=/api/news.json
---


What might be wrong?

This is running on IIS and I've added .json to the mime types for the site.

This error is the same error as an unhandled link/route. So seems like it's not picking up the config or I have the wrong URL. The plugin did install ok.
If you're hitting /api/news.json in the browser, you'd want to define the endpoint as 'api/news.json' as well.  i.e.

&lt;?php
namespace Craft;

return [
    'endpoints' =&gt; [
        'api/news.json' =&gt; [
            'elementType' =&gt; 'Entry',
            'criteria' =&gt; ['section' =&gt; 'news'],
        ]
    ]
];