title: Paylocity API Access Token
body: <p>I have been trying to retreive the access token for the paylocity API. I am able to get it through postman with the client id and client secret however when I try and retrieve it with Python I get the message {"error":"invalid_client"}. This is the code that I am using</p>
  
  <pre><code>import json
  import base64
  import requests
  
  url = "https://api.paylocity.com/IdentityServer/connect/token"
  
  client_id = ''
  
  client_secret = ''
  
  auth = (f'{client_id}:{client_secret}')
  
  
  
  headers = {
      'content-type': "application/x-www-form-urlencoded",
          'Authorization': f"Basic {auth}"
          }
  
  body =  "grant_type=client_credentials&amp;scope=WebLinkAPI"
  
  response = requests.request("POST", url, data=body, headers=headers)
  
  print (response.text)
  </code></pre>