I have created API in kirby. I am calling it from postman. But getting below response:
{
"status": "error",
"message": "Unauthenticated",
"code": 403,
"exception": "Kirby\\Exception\\PermissionException",
"key": "error.permission",
"file": "/kirby/config/api/authentication.php",
"line": 11,
"details": [],
"route": "faqs"
}
API code is site/plugins/api/index.php as below:
<?php
Kirby::plugin('my/api', [
'api' => [
'routes' => [
[
'pattern' => 'faqs',
'action' => function () {
return [
'hello' => 'sunny'
];
}
]
]
]
]);
How to fix this