@andrey4emk/npm-app-back-b24 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sendMessage/wappi.js +5 -5
package/package.json
CHANGED
package/sendMessage/wappi.js
CHANGED
|
@@ -218,24 +218,24 @@ export class Wappi {
|
|
|
218
218
|
|
|
219
219
|
let token = this.telegaAuth.token;
|
|
220
220
|
let profile_id = this.telegaAuth.profile_id;
|
|
221
|
-
let url = `https://wappi.pro/tapi/sync/contact/add`;
|
|
222
|
-
|
|
221
|
+
let url = `https://wappi.pro/tapi/sync/contact/add?profile_id=${profile_id}`;
|
|
222
|
+
console.log("addContactTelegramWappi token,profile_id и url:");
|
|
223
|
+
console.log(token, profile_id, url);
|
|
223
224
|
try {
|
|
224
225
|
let res = await fetch(url, {
|
|
225
226
|
method: "POST",
|
|
226
227
|
headers: {
|
|
227
228
|
"Content-Type": "application/json",
|
|
228
229
|
Authorization: token,
|
|
229
|
-
profile_id: profile_id,
|
|
230
230
|
},
|
|
231
231
|
body: JSON.stringify({
|
|
232
|
-
|
|
232
|
+
recipient: phone,
|
|
233
233
|
name: contactName,
|
|
234
234
|
}),
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
let data = await res.json();
|
|
238
|
-
|
|
238
|
+
console.log("addContactTelegramWappi data:", data);
|
|
239
239
|
if (data.status !== "done") {
|
|
240
240
|
return { error: true, message: `Ошибка создания контакта ${phone} в Telegram`, data: data };
|
|
241
241
|
} else {
|