Log:
AH01071: Got error 'PHP message: PHP Warning: Attempt to read property "id" on array in /var/www/vhosts/example.com/example.com/vendor/sycho/json-api/src/AbstractSerializer.php on line 38; PHP message: PHP Warning: Attempt to read property "id" on array in /var/www/vhosts/example.com/example.com/vendor/sycho/json-api/src/AbstractSerializer.php on line 38'
Curl Respond:
HTTP/1.1 201 Created
Server: nginx
Date: Thu, 23 Jan 2025 10:50:29 GMT
Content-Type: application/vnd.api+json
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/8.2.27
X-CSRF-Token: ***
Set-Cookie: flarum_session=***; Path=/; Expires=Thu, 23 Jan 2025 12:50:29 GMT; Max-Age=7200; Secure; HttpOnly; SameSite=Lax
Cache-Control: max-age=0
Expires: Thu, 23 Jan 2025 10:50:29 GMT
X-Powered-By: PleskLin
{"data":{"type":"notifications","id":"","attributes":{"message":"Bu bir test bildirimidir!","status":"Notifications sent successfully","userIds":[1,2]}}}
Body:
{
"data": {
"type": "notifications",
"id": "",
"attributes": {
"message": "Bu bir test bildirimidir!",
"status": "Notifications sent successfully",
"userIds": [1, 2]
}
}
}
SQL:
data:
Issue:
I am developing an extension that allows sending special notifications to desired members via API from the administration panel.
Everything seems to be working fine, but custom notifications are not appearing in the forum interface.