Test-BirdWeatherAPIKey

SYNOPSIS

Test the BirdWeather connection & credentials

SYNTAX

Test (Default)

Test-BirdWeatherAPIKey [[-BaseURI] <string>] [[-Token] <string>] [[-Api] <string>]

ALIASES

This cmdlet has the following aliases,

  • Test-BWAPIKey

DESCRIPTION

The Test-BirdWeatherAPIKey cmdlet tests the base URI & the station token or API key that are defined by the Add-BirdWeatherBaseURI & Add-BirdWeatherAPIKey cmdlets

Helpful when needing to validate general functionality or when using RMM deployment tools

The REST API is tested when a station token is defined (or -Token is used), otherwise the GraphQL API is tested. Use -Api to choose the API

REST    - makes a single GET request to the /stations/{token}/stats endpoint which only
          returns the detection & species counts of the station
GraphQL - makes a single request that only asks for the type name of the root query. The
          API key is optional because the public data can be read without one

EXAMPLES

EXAMPLE 1

Test-BirdWeatherAPIKey

Tests the base URI & credentials that are defined by the Add-BirdWeatherBaseURI & Add-BirdWeatherAPIKey cmdlets

EXAMPLE 2

Test-BirdWeatherAPIKey -BaseURI https://myapi.gateway.celerium.org

Tests the defined base URI & the credentials that were defined by the Add-BirdWeatherAPIKey cmdlet

The full test uri in this example is: https://myapi.gateway.celerium.org/api/v1/stations/{token}/stats

EXAMPLE 3

Test-BirdWeatherAPIKey -Token 21934

Tests the REST API with the station ID 21934

EXAMPLE 4

Test-BirdWeatherAPIKey -Api GraphQL

Tests the GraphQL API The full test uri is: https://app.birdweather.com/graphql

PARAMETERS

-Api

Define the API to test

By default REST is tested when a station token is available, otherwise GraphQL

Allowed values: ‘REST’, ‘GraphQL’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 2
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-BaseURI

Define the base URI (the host) for the BirdWeather API connection using BirdWeather’s URI or a custom URI. A REST or GraphQL url is converted to the host

By default the value used is the one defined by the Add-BirdWeatherBaseURI function

Type: System.String
DefaultValue: $BirdWeatherModuleBaseUri
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Token

Define the station token to test with the REST API

By default the station token defined by Add-BirdWeatherAPIKey is used When an administrator API token is in use, this must be the station ID

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  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

NOTES

N/A