Get-ITGlueDocumentSection

SYNOPSIS

List all sections for a document / Retrieve a specific section

SYNTAX

ByDocument (Default)

Get-ITGlueDocumentSection [-DocumentId] <long> [-FilterDocumentId <long>] [-FilterId <long>]
 [-FilterResourceType <string>] [-Sort <string>] [-Raw]

ByDocumentById

Get-ITGlueDocumentSection [-DocumentId] <long> [-Id] <long> [-Raw]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

Parameter set [ ByDocument ] - The Get-ITGlueDocumentSection cmdlet invokes the GET method of the /documents/{document_id}/relationships/sections endpoint (List all sections for a document)

Returns a list of sections for the specified document, ordered by sort. Sections are polymorphic and contain different attributes based on resource_type.

For Text and Step sections, two content attributes are provided:

  • “content”: The raw HTML as stored (with relative image paths)
  • “rendered-content”: Processed HTML with S3 URLs for inline images (use for display)

Example return value:

{ “data”: [ { “id”: “1”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Heading”, “resource-id”: 10, “level”: 1, “content”: “Introduction”, “sort”: 0, “created-at”: “2024-01-10T10:00:00.000Z”, “updated-at”: “2024-01-10T10:00:00.000Z” } }, { “id”: “2”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Text”, “resource-id”: 15, “content”: “ This is “, “rendered-content”: “ This is “, “sort”: 1, “created-at”: “2024-01-10T10:05:00.000Z”, “updated-at”: “2024-01-10T10:05:00.000Z” } }, { “id”: “3”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Step”, “resource-id”: 20, “content”: “ Step 1: “, “rendered-content”: “ Step 1: “, “duration”: 5, “reset-count”: false, “document-gallery-id”: 5, “sort”: 2, “created-at”: “2024-01-10T10:10:00.000Z”, “updated-at”: “2024-01-10T10:10:00.000Z”, “document-images”: [ { “id”: “8”, “type”: “document-images”, “attributes”: { “name”: “step-image.png”, “size”: 24576, “created-at”: “2024-01-10T10:05:00.000Z”, “updated-at”: “2024-01-10T10:05:00.000Z”, “document-id”: 20, “document-gallery-id”: 5, “target”: { “type”: “gallery”, “id”: 5 }, “original-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/008/original/step-image.png”, “slim-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/008/slim/step-image.png”, “thumbnail-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/008/thumbnail/step-image.png”, “inline-resource-url”: null } } ] } }, { “id”: “4”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Gallery”, “resource-id”: 25, “document-gallery-id”: 6, “sort”: 3, “created-at”: “2024-01-10T10:15:00.000Z”, “updated-at”: “2024-01-10T10:15:00.000Z”, “document-images”: [ { “id”: “9”, “type”: “document-images”, “attributes”: { “name”: “gallery-image-1.jpg”, “size”: 102400, “created-at”: “2024-01-10T10:12:00.000Z”, “updated-at”: “2024-01-10T10:12:00.000Z”, “document-id”: null, “document-gallery-id”: 6, “target”: { “type”: “gallery”, “id”: 6 }, “original-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/009/original/gallery-image-1.jpg”, “slim-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/009/slim/gallery-image-1.jpg”, “thumbnail-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/009/thumbnail/gallery-image-1.jpg”, “inline-resource-url”: null } }, { “id”: “10”, “type”: “document-images”, “attributes”: { “name”: “gallery-image-2.jpg”, “size”: 98304, “created-at”: “2024-01-10T10:13:00.000Z”, “updated-at”: “2024-01-10T10:13:00.000Z”, “document-id”: null, “document-gallery-id”: 6, “target”: { “type”: “gallery”, “id”: 6 }, “original-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/010/original/gallery-image-2.jpg”, “slim-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/010/slim/gallery-image-2.jpg”, “thumbnail-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/010/thumbnail/gallery-image-2.jpg”, “inline-resource-url”: null } } ] } } ] }

Parameter set [ ByDocumentById ] - The Get-ITGlueDocumentSection cmdlet invokes the GET method of the /documents/{document_id}/relationships/sections/{id} endpoint (Retrieve a specific section)

Returns details of a specific document section. The attributes returned depend on the resource_type.

For Text and Step sections, two content attributes are provided:

  • “content”: The raw HTML as stored (with relative image paths - use for editing)
  • “rendered-content”: Processed HTML with S3 URLs for inline images (use for display)

Example return value (Text section with inline image):

{ “data”: { “id”: “5”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Text”, “resource-id”: 30, “content”: “ Detailed explanation “, “rendered-content”: “ Detailed explanation “, “sort”: 2, “created-at”: “2024-01-10T11:00:00.000Z”, “updated-at”: “2024-01-10T11:30:00.000Z” } } }

Example return value (Step section with images):

{ “data”: { “id”: “6”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Step”, “resource-id”: 35, “content”: “ Follow these steps carefully. “, “rendered-content”: “ Follow these steps carefully. “, “duration”: 5, “reset-count”: true, “document-gallery-id”: 12, “sort”: 4, “created-at”: “2024-01-10T12:00:00.000Z”, “updated-at”: “2024-01-10T12:30:00.000Z”, “document-images”: [ { “id”: “20”, “type”: “document-images”, “attributes”: { “name”: “procedure-image.png”, “size”: 51200, “created-at”: “2024-01-10T12:01:00.000Z”, “updated-at”: “2024-01-10T12:01:00.000Z”, “document-id”: null, “document-gallery-id”: 12, “target”: { “type”: “gallery”, “id”: 12 }, “original-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/020/original/procedure-image.png”, “slim-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/020/slim/procedure-image.png”, “thumbnail-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/020/thumbnail/procedure-image.png”, “inline-resource-url”: null } }, { “id”: “21”, “type”: “document-images”, “attributes”: { “name”: “procedure-image-2.png”, “size”: 48000, “created-at”: “2024-01-10T12:02:00.000Z”, “updated-at”: “2024-01-10T12:02:00.000Z”, “document-id”: null, “document-gallery-id”: 12, “target”: { “type”: “gallery”, “id”: 12 }, “original-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/021/original/procedure-image-2.png”, “slim-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/021/slim/procedure-image-2.png”, “thumbnail-src”: “https://s3.region.amazonaws.com/bucket/document/developer/images/000/000/021/thumbnail/procedure-image-2.png”, “inline-resource-url”: null } } ] } } }

EXAMPLES

EXAMPLE 1

Get-ITGlueDocumentSection -DocumentId 12345

Returns the result of the /documents/{document_id}/relationships/sections endpoint

EXAMPLE 2

Get-ITGlueDocumentSection -DocumentId 12345 -Id 12345

Returns the result of the /documents/{document_id}/relationships/sections/{id} endpoint

PARAMETERS

-DocumentId

Required for nested relationships route

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases:
- document_id
ParameterSets:
- Name: ByDocumentById
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
- Name: ByDocument
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-FilterDocumentId

Filter by document id

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDocument
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-FilterId

Filter by id

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDocument
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-FilterResourceType

Filter by resource type

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDocument
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Id

Defines the ID of the item

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDocumentById
  Position: 1
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Raw

Returns the full API response (data, meta, links, & included) instead of only the data

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Sort

Notes: To Invert order use -, eg: -name Comma separated values

Allowed values: ‘sort’, ‘id’, ‘created_at’, ‘updated_at’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDocument
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Int64

OUTPUTS

NOTES

Endpoint : GET /documents/{document_id}/relationships/sections Endpoint : GET /documents/{document_id}/relationships/sections/{id}