Browse Source

authorization changes

master
Karan 3 years ago
parent
commit
09e4faf8ec
  1. 27
      src/app/pages/home/home.component.ts
  2. 4
      src/app/pages/home/home.service.ts

27
src/app/pages/home/home.component.ts

@ -103,8 +103,33 @@ export class HomeComponent {
} }
} }
console.log(this.arrayToBeSend); console.log(this.arrayToBeSend);
const phoneNumber: any = [];
for (let i = 0; i < this.arrayToBeSend.length; i++) {
console.log(this.arrayToBeSend[i]['PHONE NUMBER']);
phoneNumber.push(this.arrayToBeSend[i]['PHONE NUMBER']);
}
console.log(phoneNumber);
const body = {
messages: [
{
from: '447491163530',
to: phoneNumber,
messageId: 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da',
content: {
templateName: 'infobip_kz_test_hsm_2',
templateData: {
body: {
placeholders: ['BFL Credit Card'],
},
},
language: 'en_GB',
},
callbackData: 'Callback data',
},
],
};
this.subscriptions.push( this.subscriptions.push(
this.homeService.sendWhatsApp(this.arrayToBeSend).subscribe(
this.homeService.sendWhatsApp(body).subscribe(
(res) => { (res) => {
console.log(res); console.log(res);
}, },

4
src/app/pages/home/home.service.ts

@ -8,8 +8,8 @@ import { IHomeRequest, IHomeResponse } from '../../../app/model/home';
const httpOptions = { const httpOptions = {
headers: new HttpHeaders({ headers: new HttpHeaders({
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization:
'Basic 2b8cba9008e1da2f2733ff8300cf1973-dc928670-56f9-4a29-8725-69239d669e74',
authorization:
'App 2b8cba9008e1da2f2733ff8300cf1973-dc928670-56f9-4a29-8725-69239d669e74',
}), }),
}; };

Loading…
Cancel
Save