Set-ITGlueDocumentSection

SYNOPSIS

Update a section

SYNTAX

__AllParameterSets

Set-ITGlueDocumentSection [-DocumentId] <long> [-Id] <long> -Data <Object> [-Raw] [-WhatIf]
 [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

The Set-ITGlueDocumentSection cmdlet invokes the PATCH method of the /documents/{document_id}/relationships/sections/{id} endpoint (Update a section)

Updates an existing section. Only attributes specific to the section’s resource_type can be updated. The resource_type itself cannot be changed.

A PATCH request does not require all attributes - only those you want to update. Any attributes you don’t specify will remain unchanged.

IMPORTANT: The “rendered-content” attribute is READ-ONLY and automatically generated. Do not attempt to include it in your update requests - it will be ignored. When updating content, use only the “content” attribute with your HTML, and the “rendered-content” will be automatically regenerated with processed inline image URLs.

The request body must contain a JSON object, for example:

Update Text section content:

{ “data”: { “type”: “document-sections”, “attributes”: { “content”: “ Updated text content. “ } } }

Update Heading level and content:

{ “data”: { “type”: “document-sections”, “attributes”: { “content”: “Updated Heading”, “level”: 2 } } }

Update Step attributes:

{ “data”: { “type”: “document-sections”, “attributes”: { “content”: “ Updated step instructions. “, “duration”: 5, “reset-count”: true } } }

Update section sort order:

{ “data”: { “type”: “document-sections”, “attributes”: { “sort”: 5 } } }

This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it

EXAMPLES

EXAMPLE 1

Set-ITGlueDocumentSection -DocumentId 12345 -Id 12345 -Data @{} -WhatIf

Shows the PATCH request to the /documents/{document_id}/relationships/sections/{id} endpoint without sending it

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Data

Defines the data of the JSON:API request body. Accepts a hashtable, an object, or a JSON string

The value is sent as the data property of the request body, such as @{ type = ‘organizations’; attributes = @{ name = ‘Example’ } }. An object with a single data property & a JSON string are sent as is

Body properties:

  • type (string) - document-sections
  • attributes (object):
    • content (string) - HTML content for Text and Step sections
    • duration (integer) - Duration in minutes for Step sections
    • id (integer) - Required identifier for updates
    • level (integer) - Heading level (1-6)
    • reset_count (boolean) - Whether to reset count for Step sections
    • resource_type (string) - Type of section resource (Document::Text, Document::Heading, Document::Gallery, Document::Step)
    • sort (integer) - Sort order of the section
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DocumentId

Required for nested relationships route

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

-Id

Defines the ID of the item

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  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: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  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 : PATCH /documents/{document_id}/relationships/sections/{id}