As stated in the title, if following the JSON API Specifications, how to handle requests and responses for non-resource data.
For example, what would look like a login request and its response ?
Request :
POST /session HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"jsonapi": {
"version": "1.0"
},
"data": {
"grant_type": "password",
"username": "john.doe",
"password": "foobar"
}
}
Response :
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"jsonapi": {
"version": "1.0"
},
"data": null,
"meta": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",
"token_type": "Bearer",
"expires_in": 86400
}
}