Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding new endpoint for starter brand #314

Merged
merged 5 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.')
})
});


});
Loading