You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- updated rest.li client to use resourcePath with path key
placeholders, which is easier to use for sub-resources
- updated batchFinder method to explicitly require a
finderCriteria argument
@@ -161,7 +161,8 @@ All methods of the API client require passing in a request options object, all o
161
161
162
162
| Parameter | Type | Required? | Description |
163
163
|---|---|---|---|
164
-
|`BaseRequestOptions.resource`| String | Yes | The API resource name, which should begin with a forward slash (e.g. "/adAccounts") |
164
+
|`BaseRequestOptions.resourcePath`| String | Yes | <p>The resource path after the base URL, beginning with a forward slash. If the path contains keys, add curly-brace placeholders for the keys and specify the path key-value map in the `pathKeys` argument.</p><p>Examples:</p><ul><li>`resourcePath: "/me"`</li><li>`resourcePath: "/adAccounts/{id}"`</li><li>`resourcePath: "/socialActions/{actionUrn}/comments/{commentId}"`</li><li>`resourcePath: "/campaignConversions/{key}`</li></ul> |
165
+
|`BaseRequestOptions.pathKeys`| Object | No | <p>If there are path keys that are part of the `resourcePath` argument, the key placeholders must be specified in the provided `pathKeys` map. The path key values can be strings, numbers, or objects, and these will be properly encoded.</p><p>Examples:</p><ul><li>`pathKeys: {"id": 123"}`</li><li>`pathKeys: {"actionUrn":"urn:li:share:123","commentId":987`}</li><li>`pathKeys: {"key": {"campaign": "urn:li:sponsoredCampaign:123", "conversion": "urn:lla:llaPartnerConversion:456"}}`</li></ul> |
165
166
|`BaseRequestOptions.queryParams`| Object | No | A map of query parameters. The parameter keys and values will be correctly encoded by this method, so these should not be encoded. |
166
167
|`BaseRequestOptions.accessToken`| String | Yes | The access token that should provide the application access to the specified API |
167
168
|`BaseRequestOptions.versionString`| String | No | An optional version string of the format "YYYYMM" or "YYYYMM.RR". If specified, the version header will be passed and the request will use the versioned APIs base URL |
@@ -180,7 +181,6 @@ Makes a Rest.li GET request to fetch the specified entity on a resource. This me
180
181
| Parameter | Type | Required? | Description |
181
182
|---|---|---|---|
182
183
|`params`| Object extends [BaseRequestOptions](#base-request-options)| Yes | Standard request options |
183
-
|`params.id`| String \|\| Number \|\| Object | No | The id or key of the entity to fetch. For simple resources, this is not specified. |
184
184
185
185
**Resolved Response Object:**
186
186
@@ -192,8 +192,10 @@ Makes a Rest.li GET request to fetch the specified entity on a resource. This me
192
192
**Example:**
193
193
```js
194
194
restliClient.get({
195
-
resource:'/adAccounts',
196
-
id:123,
195
+
resourcePath:'/adAccounts/{id}',
196
+
pathKeys: {
197
+
id:123
198
+
},
197
199
queryParams: {
198
200
fields:'id,name'
199
201
},
@@ -227,7 +229,7 @@ Makes a Rest.li BATCH_GET request to fetch multiple entities on a resource. This
227
229
**Example:**
228
230
```js
229
231
restliClient.batchGet({
230
-
resource:'/adCampaignGroups',
232
+
resourcePath:'/adCampaignGroups',
231
233
id: [123, 456, 789],
232
234
accessToken:MY_ACCESS_TOKEN,
233
235
versionString:'202210'
@@ -257,7 +259,7 @@ Makes a Rest.li GET_ALL request to fetch all entities on a resource.
257
259
**Example:**
258
260
```js
259
261
restliClient.getAll({
260
-
resource:'/fieldsOfStudy',
262
+
resourcePath:'/fieldsOfStudy',
261
263
queryParams: {
262
264
start:0,
263
265
count:15
@@ -292,7 +294,7 @@ Makes a Rest.li FINDER request to find entities by some specified criteria.
292
294
**Example:**
293
295
```js
294
296
restliClient.finder({
295
-
resource:'/adAccounts',
297
+
resourcePath:'/adAccounts',
296
298
finderName:'search'
297
299
queryParams: {
298
300
search: {
@@ -322,7 +324,8 @@ Makes a Rest.li BATCH_FINDER request to find entities by multiple sets of criter
322
324
| Parameter | Type | Required? | Description |
323
325
|---|---|---|---|
324
326
|`params`| Object extends [BaseRequestOptions](#base-request-options)| Yes | Standard request options |
325
-
|`params.batchFinderName`| String | Yes | The Rest.li batch finder name. This will be included in the request query parameters. |
327
+
|`params.finderName`| String | Yes | The Rest.li batch finder name. This will be included in the request query parameters. |
328
+
|`params.finderCriteria`| Object | Yes | An object with `name` and `value` properties, representing the required batch finder criteria information. `name` should be the batch finder criteria parameter name, and `value` should be a list of finder param objects. The batch finder results are correspondingly ordered according to this list. The batch finder criteria will be encoded and added to the request query parameters. |
326
329
327
330
**Resolved Response Object:**
328
331
@@ -340,9 +343,10 @@ Makes a Rest.li BATCH_FINDER request to find entities by multiple sets of criter
@@ -524,7 +529,6 @@ When an entity has nested fields that can be modified, passing in the original a
524
529
| Parameter | Type | Required? | Description |
525
530
|---|---|---|---|
526
531
|`params`| Object extends [BaseRequestOptions](#base-request-options)| Yes | Standard request options |
527
-
|`params.id`| String \|\| Number \|\| Object | No | The id or key of the entity to update. For simple resources, this is not specified. |
528
532
|`params.patchSetObject`| Object | No | The value of the entity with only the modified fields present. If specified, this will be directly sent as the patch object. |
529
533
|`params.originalEntity`| Object | No | The value of the original entity. If specified and `patchSetObject` is not provided, this will be used in conjunction with `modifiedEntity` to compute the patch object. |
530
534
|`params.modifiedEntity`| Object | No | The value of the modified entity. If specified and `patchSetObject` is not provided, this will be used in conjunction with `originalEntity` to compute the patch object. |
@@ -538,8 +542,10 @@ When an entity has nested fields that can be modified, passing in the original a
538
542
**Example:**
539
543
```js
540
544
restliClient.partialUpdate({
541
-
resource:'/adAccounts',
542
-
id:123,
545
+
resourcePath:'/adAccounts/{id}',
546
+
pathKeys: {
547
+
id:123
548
+
},
543
549
patchSetObject: {
544
550
name:'TestAdAccountModified',
545
551
reference:'urn:li:organization:456'
@@ -576,7 +582,7 @@ Makes a Rest.li BATCH_PARTIAL_UPDATE request to partially update multiple entite
576
582
**Example:**
577
583
```js
578
584
restliClient.batchPartialUpdate({
579
-
resource:'/adCampaignGroups',
585
+
resourcePath:'/adCampaignGroups',
580
586
id: [123, 456],
581
587
patchSetObjects: [
582
588
{ status:'ACTIVE' },
@@ -603,7 +609,6 @@ Makes a Rest.li DELETE request to delete an entity.
603
609
| Parameter | Type | Required? | Description |
604
610
|---|---|---|---|
605
611
|`params`| Object extends [BaseRequestOptions](#base-request-options)| Yes | Standard request options |
606
-
|`params.id`| String \|\| Number \|\| Object | No | The id or key of the entity to delete. For simple resources, this is not specified. |
607
612
608
613
**Resolved Response Object:**
609
614
@@ -614,8 +619,10 @@ Makes a Rest.li DELETE request to delete an entity.
614
619
**Example:**
615
620
```js
616
621
restliClient.delete({
617
-
resource:'/adAccounts',
618
-
id:123,
622
+
resourcePath:'/adAccounts/{id}',
623
+
pathKeys: {
624
+
id:123
625
+
},
619
626
versionString:'202210',
620
627
accessToken:MY_ACCESS_TOKEN
621
628
}).then(response=> {
@@ -645,7 +652,7 @@ Makes a Rest.li BATCH_DELETE request to delete multiple entities at once.
645
652
**Example:**
646
653
```js
647
654
restliClient.batchDelete({
648
-
resource:'/adAccounts',
655
+
resourcePath:'/adAccounts',
649
656
ids: [123, 456],
650
657
versionString:'202210',
651
658
accessToken:MY_ACCESS_TOKEN
@@ -676,7 +683,7 @@ Makes a Rest.li ACTION request to perform an action on a specified resource.
0 commit comments