How do I use the access token to properly access the API endpoints, in python using requests and oauthlib?

Tuesday, November 19, 2019 - 21:19
Praveen Kuruganti

Here's a snippet of what I'm trying to get: I'm trying to get the response that contains the field IDs. I'm able to generate the ACCESS_TOKEN (the one that expires an hour after its generation). How do I put everything in place

import requests
from requests_oauthlib import OAuth1
from pprint import pprint

KEY = "[from My Apps]"
SECRET = "[from My Apps]"
ACCESS_TOKEN = "[fetched from a separate .py file]"

url = "https://api.awhere.com/v2/fields/"
auth = OAuth1(KEY, SECRET)
response = requests.get(url, params={}) # how do I pass them in params
pprint(response.json())
del auth

Answer Count: 
1

Praveen,

Our support team reviewed your app ID and found that you were still on the trial so we corrected that. If the issues still persist after those changes let us know either by replying below or emailing us at customersupport@awhere.com.

In the meantime have you reviewed the documentation regarding fields? - https://developer.awhere.com/api/reference/fields/get-fields

Look forward to hearing back from you! -Adam

Thursday, November 21, 2019 - 04:29
Adam Horton