API interaction (Python)
Simple example on how to interact with the Extrahorizon API using python
from requests_oauthlib import OAuth1Session
import os
def handler(event, context):
exhConsumerKey = os.environ['API_OAUTH_CONSUMER_KEY']
exhConsumerSecret = os.environ['API_OAUTH_CONSUMER_SECRET']
exhAccessToken = os.environ['API_OAUTH_TOKEN']
exhTokenSecret = os.environ['API_OAUTH_TOKEN_SECRET']
oauth = OAuth1Session(client_key=exhConsumerKey,
client_secret=exhConsumerSecret,
resource_owner_key=exhAccessToken,
resource_owner_secret=exhTokenSecret)
result = oauth.get('https://<your.extrahorizon.url>/users/v1/me')
print(result.content)Getting credentials
Setting up an OAUTH1 session
Executing an API call
Last updated