Get-ITGlueDocument

SYNOPSIS

List all documents for a particular organization / Retrieve complete information of a document including its sections / Retrieve complete information of a document including its sections in the specified organization

SYNTAX

ByOrganization (Default)

Get-ITGlueDocument [-OrganizationId] <long> [-FilterArchived <bool>]
 [-FilterDocumentFolderId <long>] [-PageNumber <long>] [-PageSize <long>] [-Sort <string>]
 [-AllResults] [-Raw]

ByOrganizationById

Get-ITGlueDocument [-OrganizationId] <long> [-Id] <long> [-Include <string>] [-Raw]

ById

Get-ITGlueDocument [-Id] <long> [-Include <string>] [-Raw]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

Parameter set [ ByOrganization ] - The Get-ITGlueDocument cmdlet invokes the GET method of the /organizations/{organization_id}/relationships/documents endpoint (List all documents for a particular organization)

Returns a list of documents for a specified organization.

Filtering by document_folder_id:

Omit filter[document_folder_id] - returns only root-level documents filter[document_folder_id]=null - returns all documents (no filter applied) filter[document_folder_id]=0 - returns only root-level documents filter[document_folder_id]= - returns documents inside the specified folder filter[document_folder_id]=1,2,3 - returns documents in folders 1, 2, or 3 filter[document_folder_id]=0,1,2 - returns root-level documents plus documents in folders 1 and 2 filter[document_folder_id]=null,1,2 - returns documents in folders 1 and 2 (null tokens are stripped in comma-separated context)

Note: Omitting the filter and passing filter=null have different effects (root-level only vs. all documents). This asymmetry is intentional and kept for backward compatibility with the previous API default behavior.

Filtering by archived:

Omit filter[archived] - returns archived and non-archived documents filter[archived]=false - returns only non-archived documents filter[archived]=true - returns only archived documents

Can be combined with filter.

Example return value:

{ “data”: [ { “id”: “1”, “type”: “documents”, “attributes”: { “organization-id”: 2, “organization-name”: “Test Organization”, “resource-url”: “http://test-msp.itglue.localhost:8080/2/docs/1”, “restricted”: true, “my-glue”: false, “name”: “Forbidden Fly”, “created-at”: “2023-07-17T16:38:21.000Z”, “updated-at”: “2023-08-01T19:53:37.000Z”, “public”: false, “document-folder-id”: null, “is-uploaded”: false, “user-id”: 1, “published-by”: 1, “published-at”: “2023-08-01T19:53:37.000Z”, “archived”: false, “content”: “— serialized document content —”, “support-office-online”: false, “office-online-resource-url”: “http://test-msp.itglue.localhost:8080/2/docs/1” }, “relationships”: {} }, { “id”: “4”, “type”: “documents”, “attributes”: { “organization-id”: 2, “organization-name”: “Test Organization”, “resource-url”: “http://test-msp.itglue.localhost:8080/2/docs/4”, “restricted”: false, “my-glue”: false, “name”: “Asldkfml”, “created-at”: “2023-07-27T21:36:58.000Z”, “updated-at”: “2023-07-27T21:37:43.000Z”, “public”: false, “document-folder-id”: null, “is-uploaded”: false, “user-id”: 1, “published-by”: 1, “published-at”: “2023-07-27T21:37:43.000Z”, “archived”: false, “content”: “— serialized document content —”, “support-office-online”: false, “office-online-resource-url”: “http://test-msp.itglue.localhost:8080/2/docs/4” }, “relationships”: {} } ] }

Parameter set [ ById ] - The Get-ITGlueDocument cmdlet invokes the GET method of the /documents/{id} endpoint (Retrieve complete information of a document including its sections)

Endpoint to retrieve complete document information including all sections and embedded content.

The response includes a “sections” attribute containing an array of all document sections (Document::Text, Document::Heading, Document::Gallery, Document::Step) in sort order.

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

  • “content”: Raw HTML as stored (with relative image paths like /org_id/docs/doc_id/developer/images/img_id)
  • “rendered-content”: Processed HTML with S3 URLs for inline images (use for display purposes)

Example return value:

{ “data”: { “id”: “8”, “type”: “documents”, “attributes”: { “organization-id”: 8, “organization-name”: “Gislason LLC”, “resource-url”: “http://tenant1.itglue.com/8/docs/8”, “restricted”: false, “my-glue”: false, “name”: “Gluten-free single-origin coffee mustache lo-fi before they sold out.”, “created-at”: “2021-01-28T23:50:22.000Z”, “updated-at”: “2021-01-28T23:50:22.000Z”, “public”: false, “document-folder-id”: null, “is-uploaded”: false, “user-id”: 1, “published-by”: 1, “published-at”: “2021-01-28T23:50:22.000Z”, “support-office-online”: false, “office-online-resource-url”: “http://tenant1.itglue.com/8/docs/8”, “sections”: [ { “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 text with “, “rendered-content”: “ This is text with “, “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 instructions “, “rendered-content”: “ Step 1 instructions “, “duration”: 600, “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”: 8, “document-gallery-id”: 5, “target”: { “type”: “gallery”, “id”: 5 }, “original-src”: “https://s3.amazonaws.com/bucket/developer/images/8/original/step-image.png”, “slim-src”: “https://s3.amazonaws.com/bucket/developer/images/8/slim/step-image.png”, “thumbnail-src”: “https://s3.amazonaws.com/bucket/developer/images/8/thumbnail/step-image.png”, “inline-resource-url”: null } } ] } }, { “id”: “4”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Gallery”, “resource-id”: 25, “document-gallery-id”: 10, “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.png”, “size”: 34567, “created-at”: “2024-01-10T10:12:00.000Z”, “updated-at”: “2024-01-10T10:12:00.000Z”, “document-id”: 8, “document-gallery-id”: 10, “target”: { “type”: “gallery”, “id”: 10 }, “original-src”: “https://s3.amazonaws.com/bucket/developer/images/9/original/gallery-image.png”, “slim-src”: “https://s3.amazonaws.com/bucket/developer/images/9/slim/gallery-image.png”, “thumbnail-src”: “https://s3.amazonaws.com/bucket/developer/images/9/thumbnail/gallery-image.png”, “inline-resource-url”: null } } ] } } ] } } }

Parameter set [ ByOrganizationById ] - The Get-ITGlueDocument cmdlet invokes the GET method of the /organizations/{organization_id}/relationships/documents/{id} endpoint (Retrieve complete information of a document including its sections in the specified organization)

Endpoint to retrieve complete document information including all sections and embedded content.

The response includes a “sections” attribute containing an array of all document sections (Document::Text, Document::Heading, Document::Gallery, Document::Step) in sort order.

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

  • “content”: Raw HTML as stored (with relative image paths like /org_id/docs/doc_id/developer/images/img_id)
  • “rendered-content”: Processed HTML with S3 URLs for inline images (use for display purposes)

Example return value:

{ “data”: { “id”: “8”, “type”: “documents”, “attributes”: { “organization-id”: 8, “organization-name”: “Gislason LLC”, “resource-url”: “http://tenant1.itglue.com/8/docs/8”, “restricted”: false, “my-glue”: false, “name”: “Gluten-free single-origin coffee mustache lo-fi before they sold out.”, “created-at”: “2021-01-28T23:50:22.000Z”, “updated-at”: “2021-01-28T23:50:22.000Z”, “public”: false, “document-folder-id”: null, “is-uploaded”: false, “user-id”: 1, “published-by”: 1, “published-at”: “2021-01-28T23:50:22.000Z”, “support-office-online”: false, “office-online-resource-url”: “http://tenant1.itglue.com/8/docs/8”, “sections”: [ { “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 text with “, “rendered-content”: “ This is text with “, “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 instructions “, “rendered-content”: “ Step 1 instructions “, “duration”: 600, “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”: 8, “document-gallery-id”: 5, “target”: { “type”: “gallery”, “id”: 5 }, “original-src”: “https://s3.amazonaws.com/bucket/developer/images/8/original/step-image.png”, “slim-src”: “https://s3.amazonaws.com/bucket/developer/images/8/slim/step-image.png”, “thumbnail-src”: “https://s3.amazonaws.com/bucket/developer/images/8/thumbnail/step-image.png”, “inline-resource-url”: null } } ] } }, { “id”: “4”, “type”: “document-sections”, “attributes”: { “resource-type”: “Document::Gallery”, “resource-id”: 25, “document-gallery-id”: 10, “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.png”, “size”: 34567, “created-at”: “2024-01-10T10:12:00.000Z”, “updated-at”: “2024-01-10T10:12:00.000Z”, “document-id”: 8, “document-gallery-id”: 10, “target”: { “type”: “gallery”, “id”: 10 }, “original-src”: “https://s3.amazonaws.com/bucket/developer/images/9/original/gallery-image.png”, “slim-src”: “https://s3.amazonaws.com/bucket/developer/images/9/slim/gallery-image.png”, “thumbnail-src”: “https://s3.amazonaws.com/bucket/developer/images/9/thumbnail/gallery-image.png”, “inline-resource-url”: null } } ] } } ] } } }

EXAMPLES

EXAMPLE 1

Get-ITGlueDocument -OrganizationId 12345

Returns the result of the /organizations/{organization_id}/relationships/documents endpoint

EXAMPLE 2

Get-ITGlueDocument -OrganizationId 12345 -PageNumber 2 -PageSize 10

Returns the second page of 10 items from the /organizations/{organization_id}/relationships/documents endpoint

EXAMPLE 3

Get-ITGlueDocument -OrganizationId 12345 -AllResults

Returns every item from the /organizations/{organization_id}/relationships/documents endpoint by requesting every page of the results

EXAMPLE 4

Get-ITGlueDocument -Id 12345

Returns the result of the /documents/{id} endpoint

EXAMPLE 5

Get-ITGlueDocument -OrganizationId 12345 -Id 12345

Returns the result of the /organizations/{organization_id}/relationships/documents/{id} endpoint

PARAMETERS

-AllResults

Returns all items from the endpoint by requesting every page of the results

When PageSize is not defined 1000 items are requested with each page

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

-FilterArchived

Filter by archived

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

-FilterDocumentFolderId

Filter by document folder id

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByOrganization
  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: ByOrganizationById
  Position: 1
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: ById
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Include

Notes: Comma separated values

Allowed values: ‘attachments’, ‘related_items’

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

-OrganizationId

Only required for nested relationships route

Notes: Must be a valid Organization Id in your Account

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

-PageNumber

Defines the page number to return

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

-PageSize

Defines the number of items to return with each page

The maximum page size is 1000

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByOrganization
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  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: ‘name’, ‘created_at’, ‘updated_at’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByOrganization
  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 /organizations/{organization_id}/relationships/documents Endpoint : GET /documents/{id} Endpoint : GET /organizations/{organization_id}/relationships/documents/{id}