New-ITGlueDocumentSection
SYNOPSIS
Create a new section
SYNTAX
__AllParameterSets
New-ITGlueDocumentSection [-DocumentId] <long> -Data <Object> [-Raw] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
The New-ITGlueDocumentSection cmdlet invokes the POST method of the /documents/{document_id}/relationships/sections endpoint (Create a new section)
Creates a new section in the specified document. The resource_type attribute determines which type of section is created and which additional attributes are required.
Resource Types and their specific attributes:
- Document::Text: content
- Document::Heading: content, level (1-6)
- Document::Gallery: (no additional attributes)
- Document::Step: content, duration (optional), reset-count (optional)
IMPORTANT: The “rendered-content” attribute is READ-ONLY and automatically generated for Text and Step sections. Do not include it in your request - it will be ignored. When creating or updating sections, use only the “content” attribute with your HTML.
The request body must contain a JSON object with the resource-type attribute.
Example request (Text section):
{ “data”: { “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Text”, “content”: “ This is new text content. “ } } }
Example request (Heading section):
{ “data”: { “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Heading”, “content”: “Chapter 1”, “level”: 1 } } }
Example request (Step section):
{ “data”: { “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Step”, “content”: “ Perform this step. “, “duration”: 5, “reset-count”: false } } }
Example request (Gallery section):
{ “data”: { “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Gallery” } } }
Note: Step sections automatically create an associated gallery for images.
This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it
EXAMPLES
EXAMPLE 1
New-ITGlueDocumentSection -DocumentId 12345 -Data @{} -WhatIf
Shows the POST request to the /documents/{document_id}/relationships/sections 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: ''
-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 : POST /documents/{document_id}/relationships/sections