Discussions

Ask a Question
Back to All

I am trying to "Create a New Completion" and activity type in degreed is "Post". API call returns an error :"field content-type has the following problem: must be one of the following values: article, assessment, book, course, event, podcast, task, video". Is there a work around to this?

mark completion for a user

import requests

url = "https://api.degreed.com/api/v2/completions"

payload = { "data": {
"type": "completions",
"attributes": {
"is-verified": True,
"questions-correct": 0,
"percentile": 0,
"user-identifier-type": "*",
"user-id": "ALKnLZ",
"completed-at": "2023-10-30 00:00:00",
"content-type": "post",
"content-id": "eyBm9",
"content-id-type": "Id"
}
} }
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer Token
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)