Advertisement
Guest User

Untitled

a guest
Mar 14th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. ####################################################################
  2. $urlp = "$domain/api/v1/accounts/$account_id/reports/grade_export_csv"
  3. $headers = @{"Authorization"="Bearer "+$token}
  4. $ContentType = "application/json;"
  5. $postParam = @{"enrollment_term_id"="201820_1"}
  6.  
  7. $id = Invoke-WebRequest -Headers $headers -Method Post -Uri $urlp -Body $postParam | ConvertFrom-Json|Select-Object -ExpandProperty ID
  8.  
  9. Write-Output $id
  10.  
  11. $urlg = "$domain/api/v1/accounts/$account_id/reports/grade_export_csv/$id"
  12.  
  13. Start-Sleep 60
  14.  
  15. $report = Invoke-WebRequest -Headers $headers -Method Get -ContentType $ContentType -Uri $urlg |ConvertFrom-Json|Select-Object -ExpandProperty file_url
  16.  
  17. Write-Output $report
  18.  
  19. Invoke-WebRequest -Uri $report -OutFile $output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement