Send a request to the Tibber GraphQL API.
Invoke-TibberQuery [-URI <Uri>] [-Query <String>] [-PersonalAccessToken <String>] [-UserAgent <String>]
[-Force] [-DebugResponse] [<CommonParameters>]
Invoke-TibberQuery [-Query <String>] [-PersonalAccessToken <String>] [-UserAgent <String>] [-Force]
[-DebugResponse] [-DynamicParameter] [<CommonParameters>]
Calling this function will return a custom object with data returned from the Tibber GraphQL API.
$query = @"
{
viewer {
homes {
id
}
}
}
"@
$response = Invoke-TibberQuery -Query $query
Write-Host "Home ID = $($response.viewer.homes[0].id)"
Specifies the URI for the request. Override default using the TIBBER_API_URI environment variable.
Type: Uri
Parameter Sets: URI
Aliases: URL
Required: False
Position: Named
Default value: $(
if ($env:TIBBER_API_URI) {
$env:TIBBER_API_URI
}
else {
'https://api.tibber.com/v1-beta/gql'
}
)
Accept pipeline input: False
Accept wildcard characters: False
Specifies the GraphQL query.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the access token to use for the communication. Override default using the TIBBER_ACCESS_TOKEN environment variable.
Type: String
Parameter Sets: (All)
Aliases: PAT, AccessToken, Token
Required: False
Position: Named
Default value: $(
if ($script:TibberAccessTokenCache) {
$script:TibberAccessTokenCache
}
elseif ($env:TIBBER_ACCESS_TOKEN) {
$env:TIBBER_ACCESS_TOKEN
}
)
Accept pipeline input: False
Accept wildcard characters: False
Specifies the user agent (appended to the default). Override default using the TIBBER_USER_AGENT environment variable.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $(
if ($script:TibberUserAgentCache) {
$script:TibberUserAgentCache
}
elseif ($env:TIBBER_USER_AGENT) {
$env:TIBBER_USER_AGENT
}
)
Accept pipeline input: False
Accept wildcard characters: False
Switch to force a refresh of any cached results.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill DebugResponse Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill DynamicParameter Description }}
Type: SwitchParameter
Parameter Sets: GetDynamicParameters
Aliases: DynamicParameters
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest