New-ITGlueDocument
SYNOPSIS
Create a document / Create a document for a particular organization
SYNTAX
Create (Default)
New-ITGlueDocument -Data <Object> [-Raw] [-WhatIf] [-Confirm]
ByOrganization
New-ITGlueDocument [-OrganizationId] <long> -Data <Object> [-Raw] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
Parameter set [ Create ] - The New-ITGlueDocument cmdlet invokes the POST method of the /documents endpoint (Create a document)
Creates a new document under the organization specified in the ID parameter. Returns the created object if successful.
The request body must contain a JSON object. Attachments are optional and can be omitted.
Example with attachments (line breaks in values are added for readability):
{ “data”: { “type”: “documents”, “attributes”: { “organization_id”: 2, “name”: “test_document_name”, “public”: true, “is_uploaded”: “true”, “document_folder_id”: 45 }, “relationships”: { “attachments”: { “data”: [ { “type”: “attachments”, “attributes”: { “attachment”: { “content”: “SGVsbG8sIHdvcmxkIQ==”, “file_name”: “HellowWorld.txt” } } } ] } } } }
Example without attachments:
{ “data”: { “type”: “documents”, “attributes”: { “organization_id”: 2, “name”: “Simple Document”, “public”: false, “is_uploaded”: “true”, “document_folder_id”: 45 } } }
To create multiple documents, the JSON object will look something like:
{ “data”: [ { “type”: “documents”, “attributes”: {…}, “relationships”: {…} }, { “type”: “documents”, “attributes”: {…} } ] }
Parameter set [ ByOrganization ] - The New-ITGlueDocument cmdlet invokes the POST method of the /organizations/{organization_id}/relationships/documents endpoint (Create a document for a particular organization)
Creates a new document under the organization specified in the ID parameter. Returns the created object if successful.
The request body must contain a JSON object. Attachments are optional and can be omitted.
Example with attachments (line breaks in values are added for readability):
{ “data”: { “type”: “documents”, “attributes”: { “organization_id”: 2, “name”: “test_document_name”, “public”: true, “is_uploaded”: “true”, “document_folder_id”: 45 }, “relationships”: { “attachments”: { “data”: [ { “type”: “attachments”, “attributes”: { “attachment”: { “content”: “SGVsbG8sIHdvcmxkIQ==”, “file_name”: “HellowWorld.txt” } } } ] } } } }
Example without attachments:
{ “data”: { “type”: “documents”, “attributes”: { “organization_id”: 2, “name”: “Simple Document”, “public”: false, “is_uploaded”: “true”, “document_folder_id”: 45 } } }
To create multiple documents, the JSON object will look something like:
{ “data”: [ { “type”: “documents”, “attributes”: {…}, “relationships”: {…} }, { “type”: “documents”, “attributes”: {…} } ] }
This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it
EXAMPLES
EXAMPLE 1
New-ITGlueDocument -Data @{} -WhatIf
Shows the POST request to the /documents endpoint without sending it
EXAMPLE 2
New-ITGlueDocument -OrganizationId 12345 -Data @{} -WhatIf
Shows the POST request to the /organizations/{organization_id}/relationships/documents 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) - documents
- attributes (object):
- archived (boolean)
- document_folder_id (integer) - Not permitted in PUT/PATCH, optional in POST
- id (integer) - Required identifier for bulk updates
- is_uploaded (boolean) - Not permitted in PUT/PATCH, optional in POST
- my_glue (boolean)
- name (string)
- organization_id (integer) - Not required when using nested relationship routes
- public (boolean)
- restricted (boolean)
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByOrganization
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Create
Position: Named
IsRequired: true
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: ByOrganization
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 Endpoint : POST /organizations/{organization_id}/relationships/documents