fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit cad03e145e - Show all commits

View file

@ -132,13 +132,16 @@ export class WhatsappDirectLine extends GBService {
let phoneId = this.whatsappServiceNumber.split(';')[0]; let phoneId = this.whatsappServiceNumber.split(';')[0];
let productId = this.whatsappServiceNumber.split(';')[1] let productId = this.whatsappServiceNumber.split(';')[1]
let url = `${this.INSTANCE_URL}/${productId}/setWebhook`; let url = `${this.INSTANCE_URL}/${phoneId}/config`;
WhatsappDirectLine.phones[phoneId] = this.botId; WhatsappDirectLine.phones[phoneId] = this.botId;
options = { options = {
url: url, url: url,
method: 'POST', method: 'POST',
body: { webhook: `${GBServer.globals.publicAddress}/webhooks/whatsapp/${this.botId}` }, body: {
webhook: `${GBServer.globals.publicAddress}/webhooks/whatsapp/${this.botId}`,
"ack_delivery": false
},
headers: { headers: {
'x-maytapi-key': this.whatsappServiceKey, 'x-maytapi-key': this.whatsappServiceKey,
'Content-Type': 'application/json', 'Content-Type': 'application/json',