title: REST API cURL Token - Paylocity
body: <p>This should be very simple, but for the life of me I can not form my cURL request so that Paylocity will accept it. <a href="https://www.paylocity.com/integrations/apis/" rel="nofollow noreferrer">https://www.paylocity.com/integrations/apis/</a></p>
  
  <p>I keep getting HTTP/1.1 400 Bad Request with json response {"error":"invalid_client"}, which I believe indicates that the data I am sending is not formatted properly. If I mess with the data I can get different response codes. In this case I am simply trying to obtain a bearer token.</p>
  
  <pre><code>curl  -v https://apisandbox.paylocity.com/IdentityServer/connect/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization:Basic &lt;base64 encoded  clientid:clientsecret&gt;' \
  -d  'grant_type = client_credentials&amp;scope = WebLinkAPI'
  </code></pre>
  
  <p>Anything obviously wrong with the above?</p>