Skip to content

Instantly share code, notes, and snippets.

@scottd3v
Created October 19, 2018 16:31
Show Gist options
  • Select an option

  • Save scottd3v/379a986cf47bdedfeca7fae1f73641d5 to your computer and use it in GitHub Desktop.

Select an option

Save scottd3v/379a986cf47bdedfeca7fae1f73641d5 to your computer and use it in GitHub Desktop.
Events API PowerShell Example
$JCAPIKey = '' # Enter API Key here
$StartDate = (Get-Date(Get-Date).AddDays(-1) -Format s)
$EndDate = (Get-Date -Format s)
$hdrs = @{"X-API-KEY" = "$JCAPIKey"}
$EventsAPI = "https://events.jumpcloud.com/events?startDate=$StartDate`Z&endDate=$EndDate`Z"
$events = Invoke-RestMethod -Method GET -Uri $EventsAPI -Header $hdrs
# To output to a file run the below command
$events | ConvertTo-Json | Out-File EventsData.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment