title: Unclear on making an API call
body: <p>I am looking for some help with how to use the Egnyte API to make a call using PowerShells invoke-restmethod to list files/folders - <a href="https://developers.egnyte.com/docs/read/File_System_Management_API_Documentation#List-File-or-Folder" rel="nofollow noreferrer">https://developers.egnyte.com/docs/read/File_System_Management_API_Documentation#List-File-or-Folder</a> </p>
  
  <p>From their documentation I must first get a oauth2 token which I am unsure how to do so and then authenticate and make the call.</p>
  
  <p>I've come up with the following below however I'm not sure how to proceed...</p>
  
  <pre><code>#credentials
  $username = "username"
  $password = "password"
  $apikey = "api-key"
  $token = "token"
  
  #auth to Egnyte
  -Username $username -Password $password -AccessKey $apikey -token $token
  
  Invoke-RestMethod -Uri https://EgnyteDomain.egnyte.com/pubapi/v1/fs/
  </code></pre>