# Notification serveice api docs v1 ## API documentation for notification service v1 <span style="color:red">`base_url`</span>: `https://api-dev.loopfreight.io/lf-notification/api/v1` # Module: Notification ## 1. Module: Notification ### 1.1 User Token created by user * **Description:** User can create a user token by inputing device token * **Permission role**: any * **Method**:`POST` * **Api path**:`/user-token/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `deviceToken`: `string`| `jhghj` |`true`| * **Request Body**: ```json= { "deviceToken":"jhghj" } ``` * **Response**: ```status_code: 201``` ```json= { "message": "User Token created successfully.", "data": { "id": 10, "createdAt": "2022-01-18T08:04:15.399Z", "updatedAt": "2022-01-18T08:29:52.872Z", "user": { "role": "admin", "email": null, "phone": "+8801344118462", "gender": "male", "userId": "01FQZYJD7PWJTC1A1CAMYXNKEB", "fullName": "Abdus Salam Zaigirdar", "createdAt": "2021-12-28T07:20:13.301Z", "profilePicture": null }, "web": "", "android": "jhghj", "ios": "", "status": "active" } } ``` ### 1.2 Notification get by user * **Description:** User can get all notification from his profile. * **Permission role**: any * **Method**:`GET` * **Api path**:`/notification/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Field Name | Sample Data | | -------- | -------- | | `page`: `number`| `1` | | `limit`: `number`| `10` | | `isRead`: `string`| `true` ,`false` | * **Request Body**: ``` no respose body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Notification list get successfully.", "count": 0, "data": [] } ``` ### 1.3 Notification all read by user * **Description:** User can mark all notification from his panel * **Permission role**: any * **Method**:`PUT` * **Api path**:`/notification/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Field**: | Field Name | Sample Data | | -------- | -------- | | `id`: `number`| `all` | * **Request Body**: ```json= { "id": "all" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Notification updated successfully.", "data": {} } ```