title: Using oauth2.0 tokens with R's httr package
body: <h1>Problem</h1>
  <p>The package <code>httr</code> provides CURL wrappers in R (see <a href="https://cran.r-project.org/web/packages/httr/httr.pdf" rel="noreferrer">package documentation</a>).</p>
  <p>I'm brand new to HTTP and APIs. My trouble is getting oauth2.0 authentication to work. I have tried various syntax and get either errors or status 401.</p>
  <p><strong>What is the correct way to use an oauth2.0 token and make a <code>GET()</code> request using <code>httr</code>?</strong></p>
  <h1>Code Attempts</h1>
  <pre><code># Set UP
    
    url = &quot;https://canvas.{institution}.edu/api/v1/courses&quot;
    key = &quot;{secret_key}&quot;
  
  # 1
    GET(url, sign_oauth2.0(key)) 
    # Error: Deprecated: supply token object to config directly
  
  # 2
    GET(url, config(sign_oauth2.0 = key)) 
    # unknown option: sign_oauth2.0
  
  # 3
    GET(url, config = list(sign_oauth2.0 = key)) 
    # Status 401
  </code></pre>