From 6523b8d8222d459593f7bf0060a438260f69e0bc Mon Sep 17 00:00:00 2001 From: Steven Staley Date: Tue, 1 Oct 2019 14:02:29 -0400 Subject: [PATCH 1/2] [SE-231] Added documentation to Readme & changelog and upodated version number --- CHANGELOG.md | 5 +++++ README.md | 1 + package.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3700a29..6f8257a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] - Security patches to dev-dependencies [#237](https://github.com/SparkPost/node-sparkpost/pull/237) by @jgzamora +## [2.1.4] - 2019-10-01 +### Added +- Events API functionality by @sstaley-sparkpost +- Example for [searching the events/message API](/examples/events/search_message.js) by @sstaley-sparkpost. + ## [2.1.3] - 2018-10-24 ### Fixed - Template preview draft option [bug](https://github.com/SparkPost/node-sparkpost/issues/233) by @jgzamora diff --git a/README.md b/README.md index 047e21e..243cb09 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ Click on the desired API to see usage and more information * [Inbound Domains](/docs/resources/inboundDomains.md) - `client.inboundDomains` ([examples](/examples/inboundDomains)) * [Message Events](/docs/resources/messageEvents.md) - `client.messageEvents` ([examples](/examples/messageEvents)) +* [Events](/docs/resources/events.md) - `client.events` ([examples](/examples/events)) * [Recipient Lists](/docs/resources/recipientLists.md) - `client.recipientLists` ([examples](/examples/recipientLists)) * [Relay Webhooks](/docs/resources/relayWebhooks.md) - `client.relayWebhooks` ([examples](/examples/relayWebhooks)) * [Sending Domains](/docs/resources/sendingDomains.md) - `client.sendingDomains` ([examples](/examples/sendingDomains)) diff --git a/package.json b/package.json index 87d39ac..c5f466b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sparkpost", - "version": "2.1.3", + "version": "2.1.4", "description": "A Node.js wrapper for interfacing with your favorite SparkPost APIs", "main": "./lib/sparkpost.js", "scripts": { From 22fcb97fa1c878544d627f3af5a2d3fa28034460 Mon Sep 17 00:00:00 2001 From: Steven Staley Date: Tue, 1 Oct 2019 14:16:29 -0400 Subject: [PATCH 2/2] [SE-231] Adding markdown documentation for events api --- docs/resources/events.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/resources/events.md diff --git a/docs/resources/events.md b/docs/resources/events.md new file mode 100644 index 0000000..5054c24 --- /dev/null +++ b/docs/resources/events.md @@ -0,0 +1,24 @@ +# Events + +This library provides easy access to the [Events](https://developers.sparkpost.com/api/events) resource. + +*Note: All methods return promises and accept an optional last argument callback. [Read about how we handle callbacks and promises](/docs/async.md).* + +## Methods +* **searchMessage([params, callback])**
+ Search for events of type message using the given parameters (NOTE: all params are optional): + * `params` - a hash of [Events URI Parameters](https://developers.sparkpost.com/api/events.html#events-get-search-for-message-events) + +## Date/Time Parameter Format + +The `from` and `to` search parameters accept date stamps of the form: + + `YYYY-MM-DDTHH:MM` + +For example: `2016-11-14T16:15`. + +Note: timestamps are expressed in the timezone specified by the `timezone` parameter or UTC by default. + +## Examples + +Visit our examples section to see all of [our events resource examples](/examples/events).