Skip to content

Commit 3df410f

Browse files
Merge pull request #370 from avinashp-plivo/add-business-contact-email
Add business contact email
2 parents 74116f4 + 451c52c commit 3df410f

File tree

5 files changed

+53
-12
lines changed

5 files changed

+53
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Change Log
2+
## [v4.75.5](https://github.com/plivo/plivo-node/tree/v4.75.5) (2026-01-13)
3+
**Feature - Profile API business_contact_email support**
4+
- Added `business_contact_email` parameter support to Profile `create` and `update` methods for PUBLIC entity types
5+
26
## [v4.75.4](https://github.com/plivo/plivo-node/tree/v4.75.4) (2026-01-06)
37
**Feature - Typescript definition for list endpoints function**
48
- Added Typescript definition for `list endpoints` function params

lib/resources/profile.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ export class ProfileResponse {
113113
* @param {string} website
114114
* @param {object} address
115115
* @param {object} authorized_contact
116+
* @param {string} business_contact_email
116117
* @return profileResponse response output
117118
*/
118-
create(profile_alias,plivo_subaccount,customer_type,entity_type, company_name,ein,vertical,ein_issuing_country,stock_symbol,stock_exchange, alt_business_id_type, website, address, authorized_contact){
119+
create(profile_alias,plivo_subaccount,customer_type,entity_type, company_name,ein,vertical,ein_issuing_country,stock_symbol,stock_exchange, alt_business_id_type, website, address, authorized_contact, business_contact_email){
119120
let params = {}
120121
params.profile_alias=profile_alias;
121122
params.plivo_subaccount=plivo_subaccount;
@@ -131,6 +132,7 @@ export class ProfileResponse {
131132
params.website=website;
132133
params.address=address;
133134
params.authorized_contact=authorized_contact;
135+
params.business_contact_email=business_contact_email;
134136
let client = this[clientKey];
135137
return new Promise((resolve, reject) => {
136138
client('POST', action, params)
@@ -147,12 +149,14 @@ export class ProfileResponse {
147149
* update a new Profile
148150
*
149151
* @param {string} profile_uuid
150-
* @param {object } address
151-
* @param {object } authorized_contact
152-
* @param {string} entity_type
153-
* @param {string} vertical
154-
* @param {string} company_name
155-
* @param {string} website
152+
* @param {object} params - params object containing:
153+
* @param {object} [params.address] - address object
154+
* @param {object} [params.authorized_contact] - authorized_contact object
155+
* @param {string} [params.entity_type] - entity_type
156+
* @param {string} [params.vertical] - vertical
157+
* @param {string} [params.company_name] - company_name
158+
* @param {string} [params.website] - website
159+
* @param {string} [params.business_contact_email] - business_contact_email
156160
* @return profileResponse response output
157161
*/
158162
update(profile_uuid, params){

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plivo",
3-
"version": "4.75.4",
3+
"version": "4.75.5",
44
"description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML",
55
"homepage": "https://github.com/plivo/plivo-node",
66
"files": [

test/profile.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,41 @@ import {
3232
});
3333

3434
it('create profile', function () {
35-
var authorized_contact = {"first_name":"Hello", "last_name":"Test", "email":"vishnu@plivo.com", "title":"bro", "seniority":"admin"}
36-
var address = {"street":"123", "city":"Band", "state":"NY", "postal_code":"10001", "country":"US"}
37-
return client.profile.create("vishnu104", "SECONDARY", "RESELLER","PRIVATE_PROFIT","ABC Inc", "111111111", "PROFESSIONAL", "US", "ABC","NASDAQ","NONE", "google.com", address,authorized_contact)
35+
var authorized_contact = {
36+
"first_name": "John",
37+
"last_name": "Doe",
38+
"email": "test@example.com",
39+
"title": "CEO",
40+
"seniority": "C_LEVEL"
41+
}
42+
var address = {
43+
"street": "123 Main Street",
44+
"city": "San Francisco",
45+
"state": "CA",
46+
"postal_code": "94105",
47+
"country": "US"
48+
}
49+
var business_contact_email = "employee@company.com"
50+
return client.profile.create(
51+
"Test Profile",
52+
"",
53+
"DIRECT",
54+
"PUBLIC",
55+
"Test Company Inc",
56+
"12-3456789",
57+
"TECHNOLOGY",
58+
"US",
59+
"TEST",
60+
"NASDAQ",
61+
"NONE",
62+
"https://testcompany.com",
63+
address,
64+
authorized_contact,
65+
business_contact_email
66+
)
3867
.then(function (profile) {
3968
assert.equal(profile.profileUuid, '43d0616e-d50a-445a-a84e-310a089f0618')
4069
})
4170
});
71+
4272
});

types/resources/profile.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class ProfileInterface extends PlivoResource {
6868
* @param {string} website
6969
* @param {object} address
7070
* @param {object} authorized_contact
71+
* @param {string} business_contact_email
7172
* @return profileResponse response output
7273
*/
7374
create(
@@ -84,7 +85,8 @@ export class ProfileInterface extends PlivoResource {
8485
alt_business_id_type: string,
8586
website: string,
8687
address: object,
87-
authorized_contact: object
88+
authorized_contact: object,
89+
business_contact_email?: string
8890
): Promise<ProfileResponse>;
8991

9092
/**
@@ -108,6 +110,7 @@ export class ProfileInterface extends PlivoResource {
108110
vertical?: string;
109111
company_name?: string;
110112
website?: string;
113+
business_contact_email?: string;
111114
}
112115
): Promise<ProfileResponse>;
113116
[clientKey]: symbol;

0 commit comments

Comments
 (0)