Skip to content

Commit

Permalink
Updated sending domains doc and examples for api format. Fixed callba…
Browse files Browse the repository at this point in the history
…ck in other docs.
  • Loading branch information
aydrian committed Jun 15, 2015
1 parent e0376e0 commit 3cebf27
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 36 deletions.
3 changes: 1 addition & 2 deletions docs/resources/recipientLists.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This library provides easy access to the [Recipient Lists](https://www.sparkpost
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **find(options, callback)**
Retrieve details about a specified recipient list by its id
* `options.id` - the id of the recipient list you want to look up **required**
Expand Down
19 changes: 3 additions & 16 deletions docs/resources/sendingDomains.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ This library provides easy access to the [Sending Domains](https://www.sparkpost
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **find(domainName, callback)**
Retrieve a sending domain by its domain name
* `domainName` - the name of the domain you want to look up **required**
* `domain` - the name of the domain you want to look up **required**
* `callback` - see all function
* **create(domainBody, callback)**
Create a new sending domain
Expand All @@ -24,22 +23,10 @@ This library provides easy access to the [Sending Domains](https://www.sparkpost
* `callback` - see all function
* **verify(options, callback)**
Validate the specified verification field types for a sending domain
* `options.domainName` - the name of the domain you want to verify **required**
* `options.domain` - the name of the domain you want to verify **required**
* `options.verifyDKIM` - initiates a check against the DKIM record default: `true`
* `options.verifySPF` - initiates a check against the SPF record default: `true`


### domainBody
| Field Name | Required? | Description | Data Type |
| ---------- | --------- | --------------------------------------------------------------- | --------- |
| domainName | yes | Name of the sending domain | String |
| privateKey | yes** | Private key used to create the DKIM Signature. | String |
| publicKey | yes** | Public key to be retrieved from the DNS of the sending domain. | String |
| selector | yes** | DomainKey selector that indicates the DKIM public key location. | String |
| headers | no | Header fields to be included in the DKIM signature | String |

** - If specifying a privateKey, publicKey, or selector, all three fields are required.

## Examples

```js
Expand Down
3 changes: 1 addition & 2 deletions docs/resources/suppressionList.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ This library provides easy access to the [Suppression List](https://www.sparkpos
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **checkStatus(email, callback)**
* `email` - `String` email address to check **required**
* `callback` - see search function
Expand Down
3 changes: 1 addition & 2 deletions docs/resources/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This library provides easy access to the [Templates](https://www.sparkpost.com/a
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **find(options, callback)**
Retrieve details about a specified template by its id
* `options.id` - the id of the template you want to look up **required**
Expand Down
3 changes: 1 addition & 2 deletions docs/resources/transmissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This library provides easy access to the [Transmissions](https://www.sparkpost.c
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **find(transmissionID, callback)**
Retrieve the details about a transmission by its ID
* `transmissionID` - the id of the transmission you want to look up **required**
Expand Down
3 changes: 1 addition & 2 deletions docs/resources/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ This library provides easy access to the [Webhooks](https://www.sparkpost.com/ap
* `callback` - executed after task is completed. **required**
* standard `callback(err, data)`
* `err` - any error that occurred
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - full response from request client
* **describe(options, callback)**
Retrieve details about a specified webhook by its id
* `options.id` - the id of the webhook you want to describe **required**
Expand Down
12 changes: 7 additions & 5 deletions examples/sendingDomains/create_sendingDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ var key = 'YOURAPIKEY'
, client = new SparkPost(key);

var domain = {
domainName: 'example1.com',
privateKey: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==',
publicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB',
selector: 'brisbane',
headers: 'from:to:subject:date'
domain: 'example1.com',
dkim: {
private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==',
public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB',
selector: 'brisbane',
headers: 'from:to:subject:date'
}
};

client.sendingDomains.create(domain, function(err, res) {
Expand Down
12 changes: 7 additions & 5 deletions examples/sendingDomains/update_sendingDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ var key = 'YOURAPIKEY'
, client = new SparkPost(key);

var domain = {
domainName: 'example1.com',
privateKey: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==',
publicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB',
selector: 'hello_selector',
headers: 'from:to:subject:date'
domain: 'example1.com',
dkim: {
private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==',
public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB',
selector: 'hello_selector',
headers: 'from:to:subject:date'
}
};

client.sendingDomains.update(domain, function(err, res) {
Expand Down

0 comments on commit 3cebf27

Please sign in to comment.