Skip to content

Commit 01aec6c

Browse files
changed: config examples in readme
1 parent 77b1866 commit 01aec6c

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Check out the development progress in a [DynamicsWebApi v2 Project](https://gith
2828

2929
**Want to help?** - Let me know. I desperately need help with documentation and examples.
3030

31-
New patches `v.1.7.7+` will contain deprecations, watch out for them in the code and replace them as per recommendations (if they are available). Otherwise, let me know!
31+
New patches `v.1.7.8+` will contain deprecation warnings, watch out for them in the code and replace them as per recommendations (if available). Otherwise, let me know!
3232

3333
v2 will be written in TypeScript and include numerous optimizations.
3434
There will be breaking changes between v1 and v2:
@@ -184,7 +184,10 @@ const acquireToken = (dynamicsWebApiCallback) => {
184184

185185
//create DynamicsWebApi
186186
const dynamicsWebApi = new DynamicsWebApi({
187-
webApiUrl: `${serverUrl}/api/data/v9.2/`,
187+
serverUrl: serverUrl,
188+
dataApi: {
189+
version: '9.2'
190+
}
188191
onTokenRefresh: acquireToken
189192
});
190193

@@ -205,14 +208,17 @@ To initialize a new instance of DynamicsWebApi with a configuration object, plea
205208
#### Web browser
206209

207210
```js
208-
const dynamicsWebApi = new DynamicsWebApi({ webApiVersion: '9.1' });
211+
const dynamicsWebApi = new DynamicsWebApi({ dataApi: { version: '9.1' } });
209212
```
210213

211214
#### Node.js
212215

213216
```js
214217
const dynamicsWebApi = new DynamicsWebApi({
215-
webApiUrl: 'https://myorg.api.crm.dynamics.com/api/data/v9.1/',
218+
serverUrl: 'https://myorg.api.crm.dynamics.com/',
219+
dataApi: {
220+
version: '9.1'
221+
}
216222
onTokenRefresh: acquireToken
217223
});
218224
```
@@ -221,7 +227,7 @@ You can set a configuration dynamically if needed:
221227

222228
```js
223229
//or can be set dynamically
224-
dynamicsWebApi.setConfig({ webApiVersion: '9.1' });
230+
dynamicsWebApi.setConfig({ dataApi: { version: '9.1' } });
225231
```
226232

227233
#### Configuration Parameters
@@ -2114,7 +2120,10 @@ In order to let DynamicsWebApi know that you are using proxy you have two option
21142120

21152121
```js
21162122
const dynamicsWebApi = new DynamicsWebApi({
2117-
webApiUrl: 'https://myorg.api.crm.dynamics.com/api/data/v9.1/',
2123+
serverUrl: 'https://myorg.api.crm.dynamics.com/',
2124+
dataApi: {
2125+
version: '9.2'
2126+
}
21182127
onTokenRefresh: acquireToken,
21192128
proxy: {
21202129
url: 'http://localhost:12345',

0 commit comments

Comments
 (0)