Skip to content

Commit acaf8c1

Browse files
committed
add readme for the application functions
1 parent 0da9e6d commit acaf8c1

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,72 @@ All properties are camel-cased for Javascript readability, and are converted on
143143
case by the internals of the API when converted to XML.
144144

145145

146+
## Applications
147+
### Create Voice Application
148+
149+
```Javascript
150+
var data = {
151+
appName:"test app",
152+
callInitiatedCallbackUrl: "http://example.com",
153+
callInitiatedMethod: "POST",
154+
callStatusCallbackUrl: "http://example.com",
155+
callStatusMethod: "POST"
156+
callbackCreds: {
157+
userId: 'my-id',
158+
password: 'my-password'
159+
}
160+
};
161+
162+
numbers.Application.createVoiceApplication(data, callback);
163+
```
164+
165+
### Create Messaging Application
166+
167+
```Javascript
168+
var data = {
169+
appName:"test app",
170+
msgCallbackUrl: "http://example.com",
171+
callbackCreds: {
172+
userId: 'my-id',
173+
password: 'my-password'
174+
}
175+
};
176+
177+
numbers.Application.createMessagingApplication(data, callback);
178+
```
179+
180+
### List All Applications
181+
182+
```Javascript
183+
numbers.Application.list(callback);
184+
```
185+
186+
### Get an Application
187+
```Javascript
188+
numbers.Application.get(id, callback);
189+
```
190+
191+
### Update an Application
192+
```Javascript
193+
numbers.Application.get(id, (err, app) => {
194+
app.appName = "new name";
195+
app.update(app, callback);
196+
});
197+
```
198+
199+
### Delete an Application
200+
```Javascript
201+
numbers.Application.get(id, (err, app) => {
202+
app.delete(callback)
203+
});
204+
```
205+
206+
### Get SipPeers Associated With and Application
207+
```Javascript
208+
numbers.Application.get(id, (err, app) => {
209+
app.getSipPeers(callback);
210+
});
211+
```
146212

147213
## Available Numbers
148214

@@ -1115,4 +1181,4 @@ try {
11151181
catch (e) {
11161182
console.log(e);
11171183
}
1118-
```
1184+
```

0 commit comments

Comments
 (0)