Last active
July 1, 2025 05:05
-
-
Save kperry2215/3bb97309eb4b1730c00e9d4b18918876 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.