Invoke-ConfluenceRestMethod¶
SYNOPSIS¶
Call the Confluence REST API using a stored (or supplied) context.
SYNTAX¶
__AllParameterSets¶
Invoke-ConfluenceRestMethod [-ApiEndpoint] <string> [[-ApiVersion] <string>] [[-Method] <string>]
[[-Body] <Object>] [[-Form] <hashtable>] [[-Query] <hashtable>] [[-Context] <Object>] [-All]
ALIASES¶
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION¶
The single generic entry point that every other Confluence function is built on. It resolves the credential context, builds the HTTP Basic auth header, sends the request, and surfaces API errors as terminating errors. With -All it transparently follows v2 cursor pagination and returns the aggregated 'results'. Error messages include Atlassian's 'X-Failure-Category' response header when present (for example FAILURE_CLIENT_SCOPE_CHECK), which distinguishes a missing-scope rejection from other failures. Pass -Debug to emit the full request and response (status, headers, and body); the Authorization header is redacted.
EXAMPLES¶
EXAMPLE 1¶
Invoke-ConfluenceRestMethod -ApiEndpoint '/wiki/api/v2/spaces' -Query @{ limit = 1 }
Calls the spaces endpoint directly and returns the raw response.
PARAMETERS¶
-All¶
Follow pagination and return every item from the 'results' collections.
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: ''
-ApiEndpoint¶
The API path beginning with /wiki/, e.g.
/wiki/api/v2/pages.
A full absolute URL is also accepted (used when following pagination links).
When -ApiVersion is supplied this is treated as a path relative to that
API family's root (e.g.
-ApiVersion v2 -ApiEndpoint 'spaces').
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ApiVersion¶
Optional API family.
Uses the internal map to prepend the version prefix
(v1 -> /wiki/rest/api, v2 -> /wiki/api/v2) to a relative -ApiEndpoint.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Body¶
The request body as a hashtable/object (serialized to JSON) or a pre-serialized JSON string.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Context¶
The context to use: an object, a context name, or $null for the default.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 6
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Form¶
A multipart/form-data payload (used for attachment uploads).
Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Method¶
The HTTP method. Defaults to GET.
Type: System.String
DefaultValue: GET
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Query¶
Query-string parameters as a hashtable.
Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
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¶
OUTPUTS¶
System.Object¶
{{ Fill in the Description }}