Update plugins/sangmata.js
Browse files- plugins/sangmata.js +47 -0
plugins/sangmata.js
CHANGED
@@ -99,6 +99,53 @@ SangmataRoutes.post("/api/v2/sangmata/tracker", authenticateApiKey, async (req,
|
|
99 |
}
|
100 |
});
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
SangmataRoutes.get("/api/v2/sangmata/tracker/:user_id", authenticateApiKey, async (req, res) => {
|
103 |
try {
|
104 |
const { user_id } = req.params;
|
|
|
99 |
}
|
100 |
});
|
101 |
|
102 |
+
/**
|
103 |
+
* @swagger
|
104 |
+
* /api/v2/sangmata/tracker/{user_id}:
|
105 |
+
* get:
|
106 |
+
* summary: Retrieve a user's first name history
|
107 |
+
* tags: [Sangmata]
|
108 |
+
* description: Fetches the historical first names and latest username of a tracked user.
|
109 |
+
* security:
|
110 |
+
* - apiKeyAuth: []
|
111 |
+
* parameters:
|
112 |
+
* - in: header
|
113 |
+
* name: x-api-key
|
114 |
+
* required: true
|
115 |
+
* description: API key for authentication.
|
116 |
+
* schema:
|
117 |
+
* type: string
|
118 |
+
* - in: path
|
119 |
+
* name: user_id
|
120 |
+
* required: true
|
121 |
+
* description: The Telegram user ID to fetch tracking data for.
|
122 |
+
* schema:
|
123 |
+
* type: integer
|
124 |
+
* example: 123456789
|
125 |
+
* responses:
|
126 |
+
* 200:
|
127 |
+
* description: Successfully retrieved user tracking data.
|
128 |
+
* content:
|
129 |
+
* application/json:
|
130 |
+
* schema:
|
131 |
+
* type: object
|
132 |
+
* properties:
|
133 |
+
* user_id:
|
134 |
+
* type: integer
|
135 |
+
* example: 123456789
|
136 |
+
* username:
|
137 |
+
* type: string
|
138 |
+
* example: "new_user"
|
139 |
+
* first_name_history:
|
140 |
+
* type: array
|
141 |
+
* items:
|
142 |
+
* type: string
|
143 |
+
* example: ["John", "Johnny", "Jonathan"]
|
144 |
+
* 404:
|
145 |
+
* description: User not found.
|
146 |
+
* 500:
|
147 |
+
* description: Internal server error.
|
148 |
+
*/
|
149 |
SangmataRoutes.get("/api/v2/sangmata/tracker/:user_id", authenticateApiKey, async (req, res) => {
|
150 |
try {
|
151 |
const { user_id } = req.params;
|