Skip to content

Instantly share code, notes, and snippets.

@kperry2215
Last active July 1, 2025 05:05
Show Gist options
  • Save kperry2215/3bb97309eb4b1730c00e9d4b18918876 to your computer and use it in GitHub Desktop.
Save kperry2215/3bb97309eb4b1730c00e9d4b18918876 to your computer and use it in GitHub Desktop.
import requests
r= requests.post(url = "https://auth.accela.com/oauth2/token",
headers={"Content-Type": "application/x-www-form-urlencoded",
"x-accela-appid": str(client_id)},
data = {"grant_type" :"password",
"client_id": str(client_id),
"client_secret": str(client_secret),
"redirect_uri": "http://localhost/myapp/",
"username": username,
"password": password,
"environment": "PROD",
"scope": "records"}, verify=False).json()
agencies = requests.get("https://apis.accela.com/v4/agencies",
headers={"Authorization": r['access_token']}, verify=False).json()
# Loop through the agencies and get the records???
for agency in agencies['result']:
req = requests.get("https://apis.accela.com/v4/records",
headers={'x-accela-appid': str(client_id),
'x-accela-agency': agency['name'],
"Authorization": r['access_token']},
verify=False)
print(req.status_code)
@kperry2215
Copy link
Author

@clay-jacob I have solved the issue! I did not link to my Denver account in the Accela Civic Portal. Once I did, I was able to successfully pull data. Thank you for pointing me in the right direction!

@mostro98
Copy link

mostro98 commented Jul 1, 2025

Hi @kperry2215 , I have a similar issue. Would you mind a brief explanation on how to link my account to an agency? Do you have the link? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment