Permalink
Browse files

Merge pull request #13 from jharlap/patch-1

Fixing typo in viewAddresses URL, adding ability to view application addresses by type or number
  • Loading branch information...
2 parents 5c2a246 + 87aa167 commit 498a2402accf982d3291c05fa9b4ebd1c9980f30 @mheadd mheadd committed Feb 20, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/tropo-provisioning.js
View
9 lib/tropo-provisioning.js
@@ -50,8 +50,13 @@ TropoProvision.prototype.viewSpecificApplication = function(applicationID) {
return this.makeApiCall('GET', provisioningUrlHost, path, null);
};
-TropoProvision.prototype.viewAddresses = function(applicationID) {
- var path = provisioningUrlPath + 'applications/' + applicationID + '/addreses';
+TropoProvision.prototype.viewAddresses = function(applicationID, type, address) {
+ var path = provisioningUrlPath + 'applications/' + applicationID + '/addresses';
+ var validTypes = ['number', 'sip', 'aim', 'skype'];
+ if ((type != null) && validTypes.indexOf(type) >= 0) {
+ path += '/' + type;
+ if(address != null) path += '/' + address;
+ }
return this.makeApiCall('GET', provisioningUrlHost, path, null);
};

0 comments on commit 498a240

Please sign in to comment.