Skip to content

Commit

Permalink
Merge pull request #314 from plivo/sp-brand
Browse files Browse the repository at this point in the history
adding new endpoint for starter brand
  • Loading branch information
renoldthomas-plivo authored Sep 22, 2023
2 parents 9688457 + a64aba7 commit eb193fc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log


## [v4.57.0](https://github.com/plivo/plivo-node/tree/v4.57.0) (2023-09-21)
**Support starter brand**
- OTP validation
- starter brand creation

## [v4.56.2](https://github.com/plivo/plivo-node/tree/v4.56.2) (2023-09-01)
**Bug fix - Unable to build TypeScript on Version 4.56.0**
- Fix TypeScript build error
Expand All @@ -12,6 +18,7 @@
**Feature - Added New Param 'carrier_fees', 'carrier_fees_rate', 'destination_network' in Get Message and List Message APIs**
- Added new params on message get and list response


## [v4.55.0](https://github.com/plivo/plivo-node/tree/v4.55.0) (2023-08-10)
**Verify Service API's**
- Create Session API - To initiate a session
Expand Down
12 changes: 12 additions & 0 deletions lib/resources/brand.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ export class BrandCreationResponse {

}

/**
* Trigger OTP for Starter brand
* @method
* @param {object} brandID
* @promise {object} return {@link PlivoGenericResponse} object
* @fail {Error} return Error
*/
trigger_otp(brandId) {
let params = {}
return super.customexecuteAction(action+brandId+'/OTP/', 'POST', params);
}

/**
* get BrandUsecases by given id
* @method
Expand Down
10 changes: 10 additions & 0 deletions lib/rest/request-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,16 @@ export function Request(config) {
}
});
}
else if (action == '10dlc/Brand/BRPXS6E/OTP/' && method == 'POST'){
resolve({
response: {},
body: {
"api_id": "dbc70630-3296-11ed-9b52-0242ac110004",
"brand_id": "BRPXS6E",
"message": "Message sent to XXXXXXXX1234, reply YES to confirm registration."
}
});
}
else if(action == 'Profile/' && method == 'GET'){
resolve({
response: {},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plivo",
"version": "4.56.2",
"version": "4.57.0",
"description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML",
"homepage": "https://github.com/plivo/plivo-node",
"files": [
Expand Down
7 changes: 7 additions & 0 deletions test/brand.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,12 @@ import {
})
});

it('trigger brand otp', function() {
return client.brand.trigger_otp('BRPXS6E')
.then(function(brand) {
assert.equal(brand.message, 'Message sent to XXXXXXXX1234, reply YES to confirm registration.')
})
});


});

0 comments on commit eb193fc

Please sign in to comment.