Skip to content

Instantly share code, notes, and snippets.

@kjegru
Created December 28, 2019 20:12
Show Gist options
  • Save kjegru/9729056ffff00cda9eae993a3bd1854e to your computer and use it in GitHub Desktop.
Save kjegru/9729056ffff00cda9eae993a3bd1854e to your computer and use it in GitHub Desktop.
Use Sheety as an API for Powershell. Using pokemons as an example.
$url = "https://v2-api.sheety.co/randomstringnameforGoogleSheet/test/pokemons"
$contentType = "application/json"
$method = "POST" # GET DELETE PUT alternatively
$json = @"
{
"pokemon": {
"id": 723,
"number": 722,
"name": "Weepinball",
"areasOfEncounter": "Route 12 + Route 13 + Route 12 (XY)",
"encounterType": "Grass",
"caught": "true"
}
}
"@
Invoke-RestMethod -Method $method -Uri $url -ContentType $contentType -Body $json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment