Created
January 20, 2019 12:30
-
-
Save kassuts/eb4f546b00adc8ce8dadac78baec070b to your computer and use it in GitHub Desktop.
This file contains 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
def aylien_api_connect(params, app_id, app_key, api_version): | |
# Define the API endpoint you would like to use - in this case "concepts". | |
endpoint = "concepts" | |
headers = { | |
'Accept': 'application/json', | |
'Content-type': 'application/x-www-form-urlencoded', | |
'X-AYLIEN-TextAPI-Application-ID': app_id, | |
'X-AYLIEN-TextAPI-Application-Key': app_key, | |
'User-Agent': "Aylien Text API Python " + api_version | |
} | |
url = 'https://api.aylien.com/api/v1' + "/" + endpoint | |
response = requests.post(url, headers=headers, params=params) | |
content = json.loads(response.content) | |
return content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment