G2 templates, question mark and accredible scripts. HackerRank notes.

This commit is contained in:
Norm Rasmussen
2023-06-08 16:53:46 -04:00
parent 20ef5dab44
commit b5a86e1abb
8 changed files with 247 additions and 63 deletions

View File

@ -1,15 +1,57 @@
import requests
url = "https://api.accredible.com/v1/credentials"
# POST
attributes = {
# id: this can be any string. perhaps we set it to an email for easy ref?
recipient.name: "{{ learner.name }}",
recipient.email: "{{ learner.email }}",
group_id: 461982,
name: "Credential Name",
issued_on: "date",
expired_on: "date",
complete: "bool",
private: "bool",
}
def create_cred():
url = "https://api.accredible.com/v1/credentials"
headers = {
"Content-Type": "application/json",
"Authorization": "Token token=2eb7a23015c751f973ac7db2590bd100",
}
payload = {
"credential": {
"recipient": {
"name": "Norm Test",
"email": "norm+accredtest2@northpass.com",
# "id": "TEST21234",
},
"name": "Skuid Test Credential",
"group_id": 461982,
"issued_on": "07/08/2023",
"expired_on": "07/08/2024",
"complete": True,
"private": True,
},
}
try:
response = requests.post(url, headers=headers, json=payload)
text = response.text
# data = response.json()
print(f"Text Response: {text}")
# print(f"Json Response: {data}")
except TypeError as e:
print(f"Error! It is {e}")
finally:
print("Completed!")
# The public URL lives at: https://www.credential.net/013b920d-b7e6-436a-97ae-245e30f916b6
# Within the payload it is data["credentials"]["url"]
def get_cred():
url = "https://api.accredible.com/v1/issuer/groups/461982"
# url = "https://api.accredible.com/v1/credentials"
headers = {
"Content-Type": "application/json",
"Authorization": "Token token=2eb7a23015c751f973ac7db2590bd100",
}
response = requests.get(url, headers=headers)
text = response.text
# data = response.json()
print(f"Text Response: {text}")
# print(f"Json Response: {data}")
if __name__ == "__main__":
# get_cred()
create_cred()

View File

@ -0,0 +1,23 @@
import requests
def get_results():
url = "https://ondemand.questionmark.com/deliveryodata/406287/Results"
params = "?$filter=ParticipantName eq tom.leggett%40questionmark.com"
# params = "?$filter=AssessmentID eq 352630000352630L"
url_params = f"{url}{params}"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Basic bm9ydGhwYXNzX2FwaTpobWUycXl4KlRGVSphcHkuZnBr"
}
# response = requests.get(url, headers=headers)
response = requests.get(url_params, headers=headers)
print(response)
print(response.text)
if __name__ == "__main__":
get_results()

View File

@ -0,0 +1,54 @@
{
"credential": {
"id": 75178584,
"name": "Skuid - Certified Builder",
"description": "The Skuid - Certified Builder credential is awarded to candidates who prove and exhibit adequate skills with Skuid\u2019s low code app development toolkit. \n",
"approve": true,
"grade": null,
"complete": true,
"issued_on": "2023-08-07",
"allow_supplemental_references": null,
"allow_supplemental_evidence": null,
"course_link": "https://www.skuid.com/certification",
"custom_attributes": {},
"private": false,
"expired_on": "2024-08-07",
"group_name": "Skuid - Certified Builder",
"group_id": 461982,
"url": "https://www.credential.net/013b920d-b7e6-436a-97ae-245e30f916b6",
"encoded_id": "5l4f619x",
"accredible_internal_id": 75178584,
"seo_image": "https://api.accredible.com/v1/frontend/credential_seo_image/75178584",
"certificate": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/75178584"
}
},
"badge": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_badge_image/75178584"
}
},
"uuid": "013b920d-b7e6-436a-97ae-245e30f916b6",
"recipient": {
"name": "Norm Test",
"email": "norm+accredtest@northpass.com",
"id": "TEST1234",
"meta_data": null
},
"meta_data": null,
"evidence_items": [],
"references": [],
"issuer": {
"name": "Skuid",
"description": "Humanize enterprise software. We believe there is a better way for operational leaders to drive high-performance impact \u2014 delivering business agility with applications that people love to use.",
"url": "www.skuid.com",
"id": 93595
}
}
}
{"credential":{"id":75180495,"name":"Skuid - Certified Builder","description":"The Skuid - Certified Builder credential is awarded to candidates who prove and exhibit adequate skills with Skuids low code app development toolkit. \n","approve":true,"grade":null,"complete":true,"issued_on":"2023-08-07","allow_supplemental_references":null,"allow_supplemental_evidence":null,"course_link":"https://www.skuid.com/certification","custom_attributes":{},"private":true,"expired_on":"2024-08-07","group_name":"Skuid - Certified Builder","group_id":461982,"url":"https://www.credential.net/77d45054-327c-4a9b-8dec-3447166a02a6?key=464c66f5b28849fe3bf595a5cf1fa95ca046e63b439834fdbbdd739d3ae396da","encoded_id":"6mu07tba","accredible_internal_id":75180495,"seo_image":"https://api.accredible.com/v1/frontend/credential_seo_image/75180495?key=464c66f5b28849fe3bf595a5cf1fa95ca046e63b439834fdbbdd739d3ae396da","certificate":{"image":{"preview":"https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/75180495?key=464c66f5b28849fe3bf595a5cf1fa95ca046e63b439834fdbbdd739d3ae396da"}},"badge":{"image":{"preview":"https://api.accredible.com/v1/frontend/credential_badge_image/75180495?key=464c66f5b28849fe3bf595a5cf1fa95ca046e63b439834fdbbdd739d3ae396da"}},"uuid":"77d45054-327c-4a9b-8dec-3447166a02a6","recipient":{"name":"Norm Test","email":"norm+accredtest2@northpass.com","id":"TEST21234","meta_data":null},"meta_data":null,"private_key":"464c66f5b28849fe3bf595a5cf1fa95ca046e63b439834fdbbdd739d3ae396da","evidence_items":[],"references":[],"issuer":{"name":"Skuid","description":"Humanize enterprise software. We believe there is a better way for operational leaders to drive high-performance impact — delivering business agility with applications that people love to use.","url":"www.skuid.com","id":93595}}}