Example of failed request¶
When backend admin session does not exists.
Request:
curl --location --request GET 'https://demo.ddev.site/api/demo/photos/1' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Cookie: fe_typo_user=53574eb0bafe1c0a4d8a2cfc0cf726dd \ --header 'X-CSRF-TOKEN: 53574eb0bafe1c0a4d8a2cfc0cf726dd'
Response:
{ "error": "Admin user is required." }
When backend session exists, but request cookie (be_typo_user) is incorrect:
Response:
{ "error": "BE session mismatch." }
Warning
The response code will be 403