vachaspathi's picture
Update app.py
d81b820 verified
raw
history blame contribute delete
898 Bytes
import requests
def get_refresh_token():
# Enter your details here
client_id = "1000.LLAMSAGIOJMDZ60MWXQ4WNQT75X36Y"
client_secret = "128ca46b343eab042ccaa7d1576fbfea8bac70ebc0"
redirect_uri = "www.google.com"
grant_token = "1000.28da754f6d096692e8d17f9566d405ac.313dd0f71361747bbb59a6948eab8011"
# scope = ZohoCRM.modules.ALL
url = "https://accounts.zoho.com/oauth/v2/token"
# Use 'https://accounts.zoho.in/oauth/v2/token' if you are using Zoho India (.in domain)!
data = {
"grant_type": "authorization_code",
"client_id": client_id,
"client_secret": client_secret,
"redirect_uri": redirect_uri,
"code": grant_token
}
response = requests.post(url, data=data)
print("Status Code:", response.status_code)
print("Response:")
print(response.json())
if __name__ == "__main__":
get_refresh_token()