Skip to content

Commit

Permalink
Merge pull request #275 from plivo/message-expiry
Browse files Browse the repository at this point in the history
message expiry param support for send message api, get and list api
  • Loading branch information
narayana-plivo authored Jan 18, 2023
2 parents 57ce72a + d8333b6 commit b17833f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Change Log
## [v4.38.0](https://github.com/plivo/plivo-node/tree/v4.38.0) (2023-01-18)
**Feature - Added New Param(Message Expiry) in Send Message API**
- Added new param(Message Expiry) in Send Message API

## [v4.37.0](https://github.com/plivo/plivo-node/tree/v4.37.0) (2022-12-16)
**Update Campaign Request**
- Update Campaign Request endpoint added

## [v4.36.0](https://github.com/plivo/plivo-node/tree/v4.36.0) (2022-12-06)
**Delete Brand and Campaign Request**
- Delete Brand and Campaign Request endpoint added

## [v4.37.0](https://github.com/plivo/plivo-node/tree/v4.37.0) (2022-12-16)
**Update Campaign Request**
Expand Down
7 changes: 6 additions & 1 deletion lib/resources/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class MessageGetResponse {
this.totalAmount = params.totalAmount;
this.totalRate = params.totalRate;
this.units = params.units;
this.powerpackID = params.powerpackId
this.powerpackID = params.powerpackId;
}
}

Expand Down Expand Up @@ -155,6 +155,7 @@ export class MessageInterface extends PlivoResourceInterface {
* @param {string} [optionalParams.url] The URL to which with the status of the message is sent.
* @param {string} [optionalParams.method] The method used to call the url. Defaults to POST.
* @param {list} [optionalParams.media_urls] For sending mms, specify the media urls in list of string
* @param {int} [optionalParams.message_expiry] The method used to expiry the message specified time.
* @param {boolean} [optionalParams.log] If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true.
* @promise {object} return {@link PlivoGenericMessage} object if success
* @fail {Error} return Error
Expand Down Expand Up @@ -193,6 +194,7 @@ export class MessageInterface extends PlivoResourceInterface {
var log = src.log;
var trackable = src.trackable;
var src = src.src;
var messageExpiry = src.messageExpiry
}

let errors = validate([{
Expand Down Expand Up @@ -249,6 +251,9 @@ export class MessageInterface extends PlivoResourceInterface {
if (trackable) {
params.trackable = trackable;
}
if (messageExpiry){
params.message_expiry = messageExpiry;
}
}

if (src) {
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.37.0",
"version": "4.38.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

0 comments on commit b17833f

Please sign in to comment.