I’d like to use the kirby api endpoint
/api/pages/:id/files from a controller.
I’m logged in as an admin and have the following in my controller. However the response I get still says: Unauthenticated. What am I missing here?
$token = csrf(); $result = Remote::get(site()->url() . '/api/pages' . $page->uid() . '/files', [ 'headers' => [ 'X-CSRF: ' . $token ] ]);