How do you send a success message in the api?
For example, lets say you have a logout endpoint in your api.
If an error occurs the output would be something like this:
{
errors: [{
"status": "401",
"title": "Unauthorized",
"detail": "Invalid credentials"
}]
}
How do you send a success message, saying congratulations you have logged in.
Do you add it to the data object:
{
"data":{
"type":"success",
"attributes":{
"info":{
"title":"success",
"message":"Congrats for logging in.",
"status":"200"
}
}
}
}
Or do you add it to the meta object:
{
"meta":{
"success":{
"title":"success",
"message":"Congrats for logging in.",
"status":"200"
}
}
}