Created
January 17, 2019 22:54
-
-
Save ottonomy/f57eedf634cc2a51404d53bab188bbd0 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
import json | |
import requests | |
def add_assertion(access_token, badgeclass_entity_id, data): | |
import pdb; pdb.set_trace(); | |
headers = {'Authorization': "Bearer " + access_token} | |
url = "https://api.badgr.io/v2/badgeclasses/{}/assertions".format(badgeclass_entity_id) | |
response = requests.request('POST', url, headers=headers, timeout=15, json=data) | |
print response.text | |
content = json.loads(response.text) | |
if not content["status"]["success"]: | |
print content["status"]["description"] | |
return content['result'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment