Reputation: 87
https://app.gong.io/settings/api/documentation#overview
import base64
auth = <my_pass>
auth2 = auth.encode('ascii')
base64_bytes = base64.b64encode(auth2)
headers = {"Authorization" : "base64_bytes"}
response = requests.get("https://api.gong.io/v2/users",headers)
print(response)
In the Gong API Page (you must be a technical administrator in Gong), click "Create" to receive an Access Key and an Access Key Secret. Use the Basic Authorization HTTP header (as per RFC) to access the Public API as shown below: Authorization: Basic To create the basic token, combine the Access Key and the Access Key Secret with colon (:) and then encode in Base64 as following: Base64( : )
Upvotes: 2
Views: 1504
Reputation: 452
Here we go: keep it simple :-)
import requests
#This sets up the https connection
url = "https://api.gong.io/v2/users"
access_key = <access_key>
secret_key = <secret_key>
r = requests.get(url, auth=(access_key,secret_key))
print(r.text)
Upvotes: 4