@agility/management-sdk 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,492 +1,492 @@
1
- # ContentMethods API Documentation
2
-
3
- The `ContentMethods` class provides comprehensive functionality for managing content items, including creation, publication, approval workflows, and retrieval operations.
4
-
5
- ## Function List
6
-
7
- | Function | Description |
8
- |----------|-------------|
9
- | [getContentItem](#getcontentitem) | Retrieves a specific content item by ID |
10
- | [publishContent](#publishcontent) | Publishes a content item |
11
- | [unPublishContent](#unpublishcontent) | Unpublishes a content item |
12
- | [batchWorkflowContent](#batchworkflowcontent) | Batch workflow operation on multiple content items |
13
- | [contentRequestApproval](#contentrequestapproval) | Requests approval for a content item |
14
- | [approveContent](#approvecontent) | Approves a content item |
15
- | [declineContent](#declinecontent) | Declines a content item |
16
- | [deleteContent](#deletecontent) | Deletes a content item |
17
- | [saveContentItem](#savecontentitem) | Saves a single content item |
18
- | [saveContentItems](#savecontentitems) | Saves multiple content items |
19
- | [getContentItems](#getcontentitems) | Retrieves content items with filtering (deprecated) |
20
- | [getContentList](#getcontentlist) | Retrieves content list with advanced filtering |
21
- | [getContentHistory](#getcontenthistory) | Retrieves content item history |
22
- | [getContentComments](#getcontentcomments) | Retrieves content item comments |
23
-
24
- ---
25
-
26
- ## getContentItem
27
-
28
- Retrieves a specific content item by ID and locale.
29
-
30
- ### Parameters
31
-
32
- | Parameter | Type | Required | Description |
33
- |-----------|------|----------|-------------|
34
- | contentID | number | Yes | The ID of the content item to retrieve |
35
- | guid | string | Yes | The website GUID |
36
- | locale | string | Yes | The locale code (e.g., 'en-us') |
37
-
38
- ### Returns
39
-
40
- `Promise<ContentItem>` - The content item object
41
-
42
- ### Usage Example
43
-
44
- ```typescript
45
- const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
46
- console.log(contentItem.fields.title);
47
- ```
48
-
49
- ---
50
-
51
- ## publishContent
52
-
53
- Publishes a content item through the batch workflow system.
54
-
55
- ### Parameters
56
-
57
- | Parameter | Type | Required | Description |
58
- |-----------|------|----------|-------------|
59
- | contentID | number | Yes | The ID of the content item to publish |
60
- | guid | string | Yes | The website GUID |
61
- | locale | string | Yes | The locale code |
62
- | comments | string | No | Optional comments for the publish operation |
63
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
64
-
65
- ### Returns
66
-
67
- `Promise<number[]>` - Array of content IDs that were published
68
-
69
- ### Usage Example
70
-
71
- ```typescript
72
- // Wait for completion (default)
73
- const publishedIds = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', 'Publishing update');
74
-
75
- // Return batch ID immediately for custom polling
76
- const batchId = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', null, true);
77
- ```
78
-
79
- ---
80
-
81
- ## unPublishContent
82
-
83
- Unpublishes a content item through the batch workflow system.
84
-
85
- ### Parameters
86
-
87
- | Parameter | Type | Required | Description |
88
- |-----------|------|----------|-------------|
89
- | contentID | number | Yes | The ID of the content item to unpublish |
90
- | guid | string | Yes | The website GUID |
91
- | locale | string | Yes | The locale code |
92
- | comments | string | No | Optional comments for the unpublish operation |
93
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
94
-
95
- ### Returns
96
-
97
- `Promise<number[]>` - Array of content IDs that were unpublished
98
-
99
- ### Usage Example
100
-
101
- ```typescript
102
- const unpublishedIds = await client.contentMethods.unPublishContent(123, 'your-guid', 'en-us', 'Temporary unpublish');
103
- ```
104
-
105
- ---
106
-
107
- ## batchWorkflowContent
108
-
109
- Performs a batch workflow operation on multiple content items. Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations.
110
-
111
- ### Parameters
112
-
113
- | Parameter | Type | Required | Description |
114
- |-----------|------|----------|-------------|
115
- | contentIDs | number[] | Yes | Array of content IDs to process |
116
- | guid | string | Yes | The website GUID |
117
- | locale | string | Yes | The locale code |
118
- | operation | WorkflowOperationType | Yes | The workflow operation (Publish, Unpublish, Approve, Decline, RequestApproval) |
119
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
120
-
121
- ### Returns
122
-
123
- `Promise<number[]>` - Array of content IDs that were processed
124
-
125
- ### Usage Example
126
-
127
- ```typescript
128
- import { WorkflowOperationType } from '@agility/management-sdk';
129
-
130
- // Publish multiple content items
131
- const contentIDs = [101, 102, 103];
132
- const publishedIds = await client.contentMethods.batchWorkflowContent(
133
- contentIDs,
134
- 'your-guid',
135
- 'en-us',
136
- WorkflowOperationType.Publish
137
- );
138
- console.log('Published content IDs:', publishedIds);
139
-
140
- // Unpublish multiple content items
141
- const unpublishedIds = await client.contentMethods.batchWorkflowContent(
142
- contentIDs,
143
- 'your-guid',
144
- 'en-us',
145
- WorkflowOperationType.Unpublish
146
- );
147
-
148
- // Request approval for multiple content items
149
- const approvalRequestedIds = await client.contentMethods.batchWorkflowContent(
150
- contentIDs,
151
- 'your-guid',
152
- 'en-us',
153
- WorkflowOperationType.RequestApproval
154
- );
155
-
156
- // Approve multiple content items
157
- const approvedIds = await client.contentMethods.batchWorkflowContent(
158
- contentIDs,
159
- 'your-guid',
160
- 'en-us',
161
- WorkflowOperationType.Approve
162
- );
163
-
164
- // Decline multiple content items
165
- const declinedIds = await client.contentMethods.batchWorkflowContent(
166
- contentIDs,
167
- 'your-guid',
168
- 'en-us',
169
- WorkflowOperationType.Decline
170
- );
171
- ```
172
-
173
- ---
174
-
175
- ## contentRequestApproval
176
-
177
- Requests approval for a content item through the workflow system.
178
-
179
- ### Parameters
180
-
181
- | Parameter | Type | Required | Description |
182
- |-----------|------|----------|-------------|
183
- | contentID | number | Yes | The ID of the content item |
184
- | guid | string | Yes | The website GUID |
185
- | locale | string | Yes | The locale code |
186
- | comments | string | No | Optional comments for the approval request |
187
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
188
-
189
- ### Returns
190
-
191
- `Promise<number[]>` - Array of content IDs that had approval requested
192
-
193
- ### Usage Example
194
-
195
- ```typescript
196
- const requestedIds = await client.contentMethods.contentRequestApproval(123, 'your-guid', 'en-us', 'Ready for review');
197
- ```
198
-
199
- ---
200
-
201
- ## approveContent
202
-
203
- Approves a content item in the workflow system.
204
-
205
- ### Parameters
206
-
207
- | Parameter | Type | Required | Description |
208
- |-----------|------|----------|-------------|
209
- | contentID | number | Yes | The ID of the content item to approve |
210
- | guid | string | Yes | The website GUID |
211
- | locale | string | Yes | The locale code |
212
- | comments | string | No | Optional comments for the approval |
213
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
214
-
215
- ### Returns
216
-
217
- `Promise<number[]>` - Array of content IDs that were approved
218
-
219
- ### Usage Example
220
-
221
- ```typescript
222
- const approvedIds = await client.contentMethods.approveContent(123, 'your-guid', 'en-us', 'Approved for publication');
223
- ```
224
-
225
- ---
226
-
227
- ## declineContent
228
-
229
- Declines a content item in the workflow system.
230
-
231
- ### Parameters
232
-
233
- | Parameter | Type | Required | Description |
234
- |-----------|------|----------|-------------|
235
- | contentID | number | Yes | The ID of the content item to decline |
236
- | guid | string | Yes | The website GUID |
237
- | locale | string | Yes | The locale code |
238
- | comments | string | No | Optional comments for the decline |
239
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
240
-
241
- ### Returns
242
-
243
- `Promise<number[]>` - Array of content IDs that were declined
244
-
245
- ### Usage Example
246
-
247
- ```typescript
248
- const declinedIds = await client.contentMethods.declineContent(123, 'your-guid', 'en-us', 'Needs revision');
249
- ```
250
-
251
- ---
252
-
253
- ## deleteContent
254
-
255
- Deletes a content item through the batch workflow system.
256
-
257
- ### Parameters
258
-
259
- | Parameter | Type | Required | Description |
260
- |-----------|------|----------|-------------|
261
- | contentID | number | Yes | The ID of the content item to delete |
262
- | guid | string | Yes | The website GUID |
263
- | locale | string | Yes | The locale code |
264
- | comments | string | No | Optional comments for the deletion |
265
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
266
-
267
- ### Returns
268
-
269
- `Promise<number[]>` - Array of content IDs that were deleted
270
-
271
- ### Usage Example
272
-
273
- ```typescript
274
- const deletedIds = await client.contentMethods.deleteContent(123, 'your-guid', 'en-us', 'Removing outdated content');
275
- ```
276
-
277
- ---
278
-
279
- ## saveContentItem
280
-
281
- Saves a single content item (create or update) through the batch workflow system.
282
-
283
- ### Parameters
284
-
285
- | Parameter | Type | Required | Description |
286
- |-----------|------|----------|-------------|
287
- | contentItem | ContentItem | Yes | The content item object to save |
288
- | guid | string | Yes | The website GUID |
289
- | locale | string | Yes | The locale code |
290
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
291
-
292
- ### Returns
293
-
294
- `Promise<number[]>` - Array of content IDs that were saved
295
-
296
- ### Usage Example
297
-
298
- ```typescript
299
- const contentItem = {
300
- contentID: 0, // 0 for new items
301
- fields: {
302
- title: 'New Article',
303
- content: 'Article content...'
304
- }
305
- };
306
-
307
- const savedIds = await client.contentMethods.saveContentItem(contentItem, 'your-guid', 'en-us');
308
- ```
309
-
310
- ---
311
-
312
- ## saveContentItems
313
-
314
- Saves multiple content items in a single batch operation.
315
-
316
- ### Parameters
317
-
318
- | Parameter | Type | Required | Description |
319
- |-----------|------|----------|-------------|
320
- | contentItems | ContentItem[] | Yes | Array of content item objects to save |
321
- | guid | string | Yes | The website GUID |
322
- | locale | string | Yes | The locale code |
323
- | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
324
-
325
- ### Returns
326
-
327
- `Promise<number[]>` - Array of content IDs that were saved
328
-
329
- ### Usage Example
330
-
331
- ```typescript
332
- const contentItems = [
333
- { contentID: 0, fields: { title: 'Article 1' } },
334
- { contentID: 0, fields: { title: 'Article 2' } }
335
- ];
336
-
337
- const savedIds = await client.contentMethods.saveContentItems(contentItems, 'your-guid', 'en-us');
338
- ```
339
-
340
- ---
341
-
342
- ## getContentItems
343
-
344
- Retrieves content items with basic filtering parameters (deprecated - use getContentList instead).
345
-
346
- ### Parameters
347
-
348
- | Parameter | Type | Required | Description |
349
- |-----------|------|----------|-------------|
350
- | referenceName | string | Yes | The reference name of the content model |
351
- | guid | string | Yes | The website GUID |
352
- | locale | string | Yes | The locale code |
353
- | listParams | ListParams | Yes | Pagination and filtering parameters |
354
-
355
- ### Returns
356
-
357
- `Promise<ContentList>` - The content list with items and pagination info
358
-
359
- ### Usage Example
360
-
361
- ```typescript
362
- const listParams = {
363
- take: 10,
364
- skip: 0,
365
- sortField: 'title',
366
- sortDirection: 'asc'
367
- };
368
-
369
- const contentList = await client.contentMethods.getContentItems('articles', 'your-guid', 'en-us', listParams);
370
- ```
371
-
372
- ---
373
-
374
- ## getContentList
375
-
376
- Retrieves content items with advanced filtering using POST request with filter object.
377
-
378
- ### Parameters
379
-
380
- | Parameter | Type | Required | Description |
381
- |-----------|------|----------|-------------|
382
- | referenceName | string | Yes | The reference name of the content model |
383
- | guid | string | Yes | The website GUID |
384
- | locale | string | Yes | The locale code |
385
- | listParams | ListParams | Yes | Pagination and filtering parameters |
386
- | filterObject | ContentListFilterModel | No | Advanced filter criteria |
387
-
388
- ### Returns
389
-
390
- `Promise<ContentList>` - The content list with items and pagination info
391
-
392
- ### Usage Example
393
-
394
- ```typescript
395
- const listParams = {
396
- take: 20,
397
- skip: 0,
398
- sortField: 'dateCreated',
399
- sortDirection: 'desc',
400
- showDeleted: false
401
- };
402
-
403
- const filterObject = {
404
- publishedState: 'published',
405
- searchText: 'important'
406
- };
407
-
408
- const contentList = await client.contentMethods.getContentList('articles', 'your-guid', 'en-us', listParams, filterObject);
409
- ```
410
-
411
- ---
412
-
413
- ## getContentHistory
414
-
415
- Retrieves the history of changes for a specific content item.
416
-
417
- ### Parameters
418
-
419
- | Parameter | Type | Required | Description |
420
- |-----------|------|----------|-------------|
421
- | locale | string | Yes | The locale code |
422
- | guid | string | Yes | The website GUID |
423
- | contentID | number | Yes | The ID of the content item |
424
- | take | number | No | Number of history entries to retrieve (default: 50) |
425
- | skip | number | No | Number of history entries to skip (default: 0) |
426
-
427
- ### Returns
428
-
429
- `Promise<ContentItemHistory>` - The content item history with pagination
430
-
431
- ### Usage Example
432
-
433
- ```typescript
434
- const history = await client.contentMethods.getContentHistory('en-us', 'your-guid', 123, 25, 0);
435
- console.log(history.items.length);
436
- ```
437
-
438
- ---
439
-
440
- ## getContentComments
441
-
442
- Retrieves comments for a specific content item.
443
-
444
- ### Parameters
445
-
446
- | Parameter | Type | Required | Description |
447
- |-----------|------|----------|-------------|
448
- | locale | string | Yes | The locale code |
449
- | guid | string | Yes | The website GUID |
450
- | contentID | number | Yes | The ID of the content item |
451
- | take | number | No | Number of comments to retrieve (default: 50) |
452
- | skip | number | No | Number of comments to skip (default: 0) |
453
-
454
- ### Returns
455
-
456
- `Promise<ItemComments>` - The content item comments with pagination
457
-
458
- ### Usage Example
459
-
460
- ```typescript
461
- const comments = await client.contentMethods.getContentComments('en-us', 'your-guid', 123, 10, 0);
462
- console.log(comments.items.length);
463
- ```
464
-
465
- ---
466
-
467
- ## Error Handling
468
-
469
- All methods throw `Exception` objects on failure:
470
-
471
- ```typescript
472
- try {
473
- const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
474
- } catch (error) {
475
- console.error('Failed to get content item:', error.message);
476
- }
477
- ```
478
-
479
- ---
480
-
481
- ## Navigation
482
- - [← Back to Main Documentation](../README.md)
483
- - [Authentication & Setup](./auth.md)
484
- - [AssetMethods](./asset-methods.md)
485
- - [BatchMethods](./batch-methods.md)
486
- - [ContainerMethods](./container-methods.md)
487
- - [InstanceMethods](./instance-methods.md)
488
- - [InstanceUserMethods](./instance-user-methods.md)
489
- - [ModelMethods](./model-methods.md)
490
- - [PageMethods](./page-methods.md)
491
- - [ServerUserMethods](./server-user-methods.md)
1
+ # ContentMethods API Documentation
2
+
3
+ The `ContentMethods` class provides comprehensive functionality for managing content items, including creation, publication, approval workflows, and retrieval operations.
4
+
5
+ ## Function List
6
+
7
+ | Function | Description |
8
+ |----------|-------------|
9
+ | [getContentItem](#getcontentitem) | Retrieves a specific content item by ID |
10
+ | [publishContent](#publishcontent) | Publishes a content item |
11
+ | [unPublishContent](#unpublishcontent) | Unpublishes a content item |
12
+ | [batchWorkflowContent](#batchworkflowcontent) | Batch workflow operation on multiple content items |
13
+ | [contentRequestApproval](#contentrequestapproval) | Requests approval for a content item |
14
+ | [approveContent](#approvecontent) | Approves a content item |
15
+ | [declineContent](#declinecontent) | Declines a content item |
16
+ | [deleteContent](#deletecontent) | Deletes a content item |
17
+ | [saveContentItem](#savecontentitem) | Saves a single content item |
18
+ | [saveContentItems](#savecontentitems) | Saves multiple content items |
19
+ | [getContentItems](#getcontentitems) | Retrieves content items with filtering (deprecated) |
20
+ | [getContentList](#getcontentlist) | Retrieves content list with advanced filtering |
21
+ | [getContentHistory](#getcontenthistory) | Retrieves content item history |
22
+ | [getContentComments](#getcontentcomments) | Retrieves content item comments |
23
+
24
+ ---
25
+
26
+ ## getContentItem
27
+
28
+ Retrieves a specific content item by ID and locale.
29
+
30
+ ### Parameters
31
+
32
+ | Parameter | Type | Required | Description |
33
+ |-----------|------|----------|-------------|
34
+ | contentID | number | Yes | The ID of the content item to retrieve |
35
+ | guid | string | Yes | The website GUID |
36
+ | locale | string | Yes | The locale code (e.g., 'en-us') |
37
+
38
+ ### Returns
39
+
40
+ `Promise<ContentItem>` - The content item object
41
+
42
+ ### Usage Example
43
+
44
+ ```typescript
45
+ const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
46
+ console.log(contentItem.fields.title);
47
+ ```
48
+
49
+ ---
50
+
51
+ ## publishContent
52
+
53
+ Publishes a content item through the batch workflow system.
54
+
55
+ ### Parameters
56
+
57
+ | Parameter | Type | Required | Description |
58
+ |-----------|------|----------|-------------|
59
+ | contentID | number | Yes | The ID of the content item to publish |
60
+ | guid | string | Yes | The website GUID |
61
+ | locale | string | Yes | The locale code |
62
+ | comments | string | No | Optional comments for the publish operation |
63
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
64
+
65
+ ### Returns
66
+
67
+ `Promise<number[]>` - Array of content IDs that were published
68
+
69
+ ### Usage Example
70
+
71
+ ```typescript
72
+ // Wait for completion (default)
73
+ const publishedIds = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', 'Publishing update');
74
+
75
+ // Return batch ID immediately for custom polling
76
+ const batchId = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', null, true);
77
+ ```
78
+
79
+ ---
80
+
81
+ ## unPublishContent
82
+
83
+ Unpublishes a content item through the batch workflow system.
84
+
85
+ ### Parameters
86
+
87
+ | Parameter | Type | Required | Description |
88
+ |-----------|------|----------|-------------|
89
+ | contentID | number | Yes | The ID of the content item to unpublish |
90
+ | guid | string | Yes | The website GUID |
91
+ | locale | string | Yes | The locale code |
92
+ | comments | string | No | Optional comments for the unpublish operation |
93
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
94
+
95
+ ### Returns
96
+
97
+ `Promise<number[]>` - Array of content IDs that were unpublished
98
+
99
+ ### Usage Example
100
+
101
+ ```typescript
102
+ const unpublishedIds = await client.contentMethods.unPublishContent(123, 'your-guid', 'en-us', 'Temporary unpublish');
103
+ ```
104
+
105
+ ---
106
+
107
+ ## batchWorkflowContent
108
+
109
+ Performs a batch workflow operation on multiple content items. Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations.
110
+
111
+ ### Parameters
112
+
113
+ | Parameter | Type | Required | Description |
114
+ |-----------|------|----------|-------------|
115
+ | contentIDs | number[] | Yes | Array of content IDs to process |
116
+ | guid | string | Yes | The website GUID |
117
+ | locale | string | Yes | The locale code |
118
+ | operation | WorkflowOperationType | Yes | The workflow operation (Publish, Unpublish, Approve, Decline, RequestApproval) |
119
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
120
+
121
+ ### Returns
122
+
123
+ `Promise<number[]>` - Array of content IDs that were processed
124
+
125
+ ### Usage Example
126
+
127
+ ```typescript
128
+ import { WorkflowOperationType } from '@agility/management-sdk';
129
+
130
+ // Publish multiple content items
131
+ const contentIDs = [101, 102, 103];
132
+ const publishedIds = await client.contentMethods.batchWorkflowContent(
133
+ contentIDs,
134
+ 'your-guid',
135
+ 'en-us',
136
+ WorkflowOperationType.Publish
137
+ );
138
+ console.log('Published content IDs:', publishedIds);
139
+
140
+ // Unpublish multiple content items
141
+ const unpublishedIds = await client.contentMethods.batchWorkflowContent(
142
+ contentIDs,
143
+ 'your-guid',
144
+ 'en-us',
145
+ WorkflowOperationType.Unpublish
146
+ );
147
+
148
+ // Request approval for multiple content items
149
+ const approvalRequestedIds = await client.contentMethods.batchWorkflowContent(
150
+ contentIDs,
151
+ 'your-guid',
152
+ 'en-us',
153
+ WorkflowOperationType.RequestApproval
154
+ );
155
+
156
+ // Approve multiple content items
157
+ const approvedIds = await client.contentMethods.batchWorkflowContent(
158
+ contentIDs,
159
+ 'your-guid',
160
+ 'en-us',
161
+ WorkflowOperationType.Approve
162
+ );
163
+
164
+ // Decline multiple content items
165
+ const declinedIds = await client.contentMethods.batchWorkflowContent(
166
+ contentIDs,
167
+ 'your-guid',
168
+ 'en-us',
169
+ WorkflowOperationType.Decline
170
+ );
171
+ ```
172
+
173
+ ---
174
+
175
+ ## contentRequestApproval
176
+
177
+ Requests approval for a content item through the workflow system.
178
+
179
+ ### Parameters
180
+
181
+ | Parameter | Type | Required | Description |
182
+ |-----------|------|----------|-------------|
183
+ | contentID | number | Yes | The ID of the content item |
184
+ | guid | string | Yes | The website GUID |
185
+ | locale | string | Yes | The locale code |
186
+ | comments | string | No | Optional comments for the approval request |
187
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
188
+
189
+ ### Returns
190
+
191
+ `Promise<number[]>` - Array of content IDs that had approval requested
192
+
193
+ ### Usage Example
194
+
195
+ ```typescript
196
+ const requestedIds = await client.contentMethods.contentRequestApproval(123, 'your-guid', 'en-us', 'Ready for review');
197
+ ```
198
+
199
+ ---
200
+
201
+ ## approveContent
202
+
203
+ Approves a content item in the workflow system.
204
+
205
+ ### Parameters
206
+
207
+ | Parameter | Type | Required | Description |
208
+ |-----------|------|----------|-------------|
209
+ | contentID | number | Yes | The ID of the content item to approve |
210
+ | guid | string | Yes | The website GUID |
211
+ | locale | string | Yes | The locale code |
212
+ | comments | string | No | Optional comments for the approval |
213
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
214
+
215
+ ### Returns
216
+
217
+ `Promise<number[]>` - Array of content IDs that were approved
218
+
219
+ ### Usage Example
220
+
221
+ ```typescript
222
+ const approvedIds = await client.contentMethods.approveContent(123, 'your-guid', 'en-us', 'Approved for publication');
223
+ ```
224
+
225
+ ---
226
+
227
+ ## declineContent
228
+
229
+ Declines a content item in the workflow system.
230
+
231
+ ### Parameters
232
+
233
+ | Parameter | Type | Required | Description |
234
+ |-----------|------|----------|-------------|
235
+ | contentID | number | Yes | The ID of the content item to decline |
236
+ | guid | string | Yes | The website GUID |
237
+ | locale | string | Yes | The locale code |
238
+ | comments | string | No | Optional comments for the decline |
239
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
240
+
241
+ ### Returns
242
+
243
+ `Promise<number[]>` - Array of content IDs that were declined
244
+
245
+ ### Usage Example
246
+
247
+ ```typescript
248
+ const declinedIds = await client.contentMethods.declineContent(123, 'your-guid', 'en-us', 'Needs revision');
249
+ ```
250
+
251
+ ---
252
+
253
+ ## deleteContent
254
+
255
+ Deletes a content item through the batch workflow system.
256
+
257
+ ### Parameters
258
+
259
+ | Parameter | Type | Required | Description |
260
+ |-----------|------|----------|-------------|
261
+ | contentID | number | Yes | The ID of the content item to delete |
262
+ | guid | string | Yes | The website GUID |
263
+ | locale | string | Yes | The locale code |
264
+ | comments | string | No | Optional comments for the deletion |
265
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
266
+
267
+ ### Returns
268
+
269
+ `Promise<number[]>` - Array of content IDs that were deleted
270
+
271
+ ### Usage Example
272
+
273
+ ```typescript
274
+ const deletedIds = await client.contentMethods.deleteContent(123, 'your-guid', 'en-us', 'Removing outdated content');
275
+ ```
276
+
277
+ ---
278
+
279
+ ## saveContentItem
280
+
281
+ Saves a single content item (create or update) through the batch workflow system.
282
+
283
+ ### Parameters
284
+
285
+ | Parameter | Type | Required | Description |
286
+ |-----------|------|----------|-------------|
287
+ | contentItem | ContentItem | Yes | The content item object to save |
288
+ | guid | string | Yes | The website GUID |
289
+ | locale | string | Yes | The locale code |
290
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
291
+
292
+ ### Returns
293
+
294
+ `Promise<number[]>` - Array of content IDs that were saved
295
+
296
+ ### Usage Example
297
+
298
+ ```typescript
299
+ const contentItem = {
300
+ contentID: 0, // 0 for new items
301
+ fields: {
302
+ title: 'New Article',
303
+ content: 'Article content...'
304
+ }
305
+ };
306
+
307
+ const savedIds = await client.contentMethods.saveContentItem(contentItem, 'your-guid', 'en-us');
308
+ ```
309
+
310
+ ---
311
+
312
+ ## saveContentItems
313
+
314
+ Saves multiple content items in a single batch operation.
315
+
316
+ ### Parameters
317
+
318
+ | Parameter | Type | Required | Description |
319
+ |-----------|------|----------|-------------|
320
+ | contentItems | ContentItem[] | Yes | Array of content item objects to save |
321
+ | guid | string | Yes | The website GUID |
322
+ | locale | string | Yes | The locale code |
323
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
324
+
325
+ ### Returns
326
+
327
+ `Promise<number[]>` - Array of content IDs that were saved
328
+
329
+ ### Usage Example
330
+
331
+ ```typescript
332
+ const contentItems = [
333
+ { contentID: 0, fields: { title: 'Article 1' } },
334
+ { contentID: 0, fields: { title: 'Article 2' } }
335
+ ];
336
+
337
+ const savedIds = await client.contentMethods.saveContentItems(contentItems, 'your-guid', 'en-us');
338
+ ```
339
+
340
+ ---
341
+
342
+ ## getContentItems
343
+
344
+ Retrieves content items with basic filtering parameters (deprecated - use getContentList instead).
345
+
346
+ ### Parameters
347
+
348
+ | Parameter | Type | Required | Description |
349
+ |-----------|------|----------|-------------|
350
+ | referenceName | string | Yes | The reference name of the content model |
351
+ | guid | string | Yes | The website GUID |
352
+ | locale | string | Yes | The locale code |
353
+ | listParams | ListParams | Yes | Pagination and filtering parameters |
354
+
355
+ ### Returns
356
+
357
+ `Promise<ContentList>` - The content list with items and pagination info
358
+
359
+ ### Usage Example
360
+
361
+ ```typescript
362
+ const listParams = {
363
+ take: 10,
364
+ skip: 0,
365
+ sortField: 'title',
366
+ sortDirection: 'asc'
367
+ };
368
+
369
+ const contentList = await client.contentMethods.getContentItems('articles', 'your-guid', 'en-us', listParams);
370
+ ```
371
+
372
+ ---
373
+
374
+ ## getContentList
375
+
376
+ Retrieves content items with advanced filtering using POST request with filter object.
377
+
378
+ ### Parameters
379
+
380
+ | Parameter | Type | Required | Description |
381
+ |-----------|------|----------|-------------|
382
+ | referenceName | string | Yes | The reference name of the content model |
383
+ | guid | string | Yes | The website GUID |
384
+ | locale | string | Yes | The locale code |
385
+ | listParams | ListParams | Yes | Pagination and filtering parameters |
386
+ | filterObject | ContentListFilterModel | No | Advanced filter criteria |
387
+
388
+ ### Returns
389
+
390
+ `Promise<ContentList>` - The content list with items and pagination info
391
+
392
+ ### Usage Example
393
+
394
+ ```typescript
395
+ const listParams = {
396
+ take: 20,
397
+ skip: 0,
398
+ sortField: 'dateCreated',
399
+ sortDirection: 'desc',
400
+ showDeleted: false
401
+ };
402
+
403
+ const filterObject = {
404
+ publishedState: 'published',
405
+ searchText: 'important'
406
+ };
407
+
408
+ const contentList = await client.contentMethods.getContentList('articles', 'your-guid', 'en-us', listParams, filterObject);
409
+ ```
410
+
411
+ ---
412
+
413
+ ## getContentHistory
414
+
415
+ Retrieves the history of changes for a specific content item.
416
+
417
+ ### Parameters
418
+
419
+ | Parameter | Type | Required | Description |
420
+ |-----------|------|----------|-------------|
421
+ | locale | string | Yes | The locale code |
422
+ | guid | string | Yes | The website GUID |
423
+ | contentID | number | Yes | The ID of the content item |
424
+ | take | number | No | Number of history entries to retrieve (default: 50) |
425
+ | skip | number | No | Number of history entries to skip (default: 0) |
426
+
427
+ ### Returns
428
+
429
+ `Promise<ContentItemHistory>` - The content item history with pagination
430
+
431
+ ### Usage Example
432
+
433
+ ```typescript
434
+ const history = await client.contentMethods.getContentHistory('en-us', 'your-guid', 123, 25, 0);
435
+ console.log(history.items.length);
436
+ ```
437
+
438
+ ---
439
+
440
+ ## getContentComments
441
+
442
+ Retrieves comments for a specific content item.
443
+
444
+ ### Parameters
445
+
446
+ | Parameter | Type | Required | Description |
447
+ |-----------|------|----------|-------------|
448
+ | locale | string | Yes | The locale code |
449
+ | guid | string | Yes | The website GUID |
450
+ | contentID | number | Yes | The ID of the content item |
451
+ | take | number | No | Number of comments to retrieve (default: 50) |
452
+ | skip | number | No | Number of comments to skip (default: 0) |
453
+
454
+ ### Returns
455
+
456
+ `Promise<ItemComments>` - The content item comments with pagination
457
+
458
+ ### Usage Example
459
+
460
+ ```typescript
461
+ const comments = await client.contentMethods.getContentComments('en-us', 'your-guid', 123, 10, 0);
462
+ console.log(comments.items.length);
463
+ ```
464
+
465
+ ---
466
+
467
+ ## Error Handling
468
+
469
+ All methods throw `Exception` objects on failure:
470
+
471
+ ```typescript
472
+ try {
473
+ const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
474
+ } catch (error) {
475
+ console.error('Failed to get content item:', error.message);
476
+ }
477
+ ```
478
+
479
+ ---
480
+
481
+ ## Navigation
482
+ - [← Back to Main Documentation](../README.md)
483
+ - [Authentication & Setup](./auth.md)
484
+ - [AssetMethods](./asset-methods.md)
485
+ - [BatchMethods](./batch-methods.md)
486
+ - [ContainerMethods](./container-methods.md)
487
+ - [InstanceMethods](./instance-methods.md)
488
+ - [InstanceUserMethods](./instance-user-methods.md)
489
+ - [ModelMethods](./model-methods.md)
490
+ - [PageMethods](./page-methods.md)
491
+ - [ServerUserMethods](./server-user-methods.md)
492
492
  - [WebhookMethods](./webhook-methods.md)