Files
Global-Jain/resources/docs/1.0/notifications.md
2025-11-05 10:37:10 +05:30

5.6 KiB

Push Notification Register information

Details for the push notification register information

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /user/store-device-token | Authorization : Bearer {token} |

URL Params

None

Data Params

{
    "os":"android",
    "device_id":"5449785443479876464346464",
    "fcm_token":"rda456487sdsaddasda457a8da78ad9a4aew4e6w87eqw9e9qw446qw5e78e9"
}

{success} Success Response

####Code 200 ####Content

{   
    "message": "Device Token Saved Successfully!"
    "status": 200,
}

{danger} Unauthenticated Response

####Code 403 or 404 ####Content

{
    "message": "Something went wrong!"
    "status": 403,
}

Delete device token

Details for delete device token api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /user/delete-device-token | Authorization : Bearer {token} |

URL Params

None

Data Params

{
    "os":1, //1: Andriod, 2: ios
    "device_id":"5449785443479876464346464"
}

{success} Success Response

####Code 200 ####Content

{   
    "message": "Device Token Deleted Successfully!"
    "status": 200,
}

{danger} Unauthenticated Response

####Code 403 or 404 ####Content

{
    "message": "Token not found!"
    "status": 403,
}

Delete existing device token

Details for delete existing device token api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /user/delete-existing-token | Default |

URL Params

None

Data Params

{
    "os": 1, //1: Andriod, 2: ios
    "device_id": "5449785443479876464346464"
}

{success} Success Response

####Code 200 ####Content

{   
    "message": "Device Token Deleted Successfully!"
    "status": 200,
}

Notification list

Details for the notification list information

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | GET | /user/notification-list | Authorization : Bearer {token} |

URL Params

None

Data Params

None

{success} Success Response

####Code 200 ####Content

{
    "current_page": 1,
    "last_page": 1,
    "per_page": 10,
    "next_page_url": null,
    "last_page_url": "http://127.0.0.1:8000/api/v1/user/notification-list?page=1",
    "total": 5,
    "count": 5,
    "prev_page_url": null,
    "hasMorePages": false,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 9,
                "user_id": 2,
                "title": "Your friend request has been accepted by Admin!",
                "type": "FriendRequestAccepted",
                "message": "Admin accepted your friend request!",
                "extra_fields": {
                    "name": "Test",
                    "avatar": "http://127.0.0.1:8000/images/misc/placeholder.png",
                    "from_id": 1,
                    "created_at": "2022/02/17 16:15:39"
                },
                "status": "0",
                "created_at": "2022/02/17 16:15:39",
                "updated_at": "2022-02-17T10:45:39.000000Z"
            }
        ]
    }
    "status": 200
}

{danger} Unauthenticated Response

####Code 403 or 404 ####Content

{
    "message": "Something went wrong!"
}

Unread notification & messages count

Details for the unread notification & messages count information

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | GET | /user/unread-counts | Authorization : Bearer {token} |

URL Params

None

Data Params

None

{success} Success Response

####Code 200 ####Content

{
    "data": {
        "unread_message_count": 1,
        "unread_notification_count": 0
    },
    "status": 200
}

{danger} Unauthenticated Response

####Code 403 or 404 ####Content

{
    "message": "Something went wrong!"
    "status": 403
}

Delete notification information

Details for the delete notification information

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | GET | /user/delete-notification/{id} | Authorization : Bearer {token} |

URL Params

1 //Notification Id

Data Params

None

{success} Success Response

####Code 200 ####Content

{
    "message": "Notification deleted successfully!"
}

{danger} Unauthenticated Response

####Code 403 or 404 ####Content

{
    "message": "Something went wrong!"
}