curl --request POST \
--url https://edpire.com/api/v1/assessments/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://edpire.com/api/v1/assessments/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://edpire.com/api/v1/assessments/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://edpire.com/api/v1/assessments/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://edpire.com/api/v1/assessments/{id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://edpire.com/api/v1/assessments/{id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://edpire.com/api/v1/assessments/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "published",
"share_code": "ABC123",
"warnings": {
"empty_exercises": 0,
"empty_questions": 1,
"questions_without_answer_input": 2,
"questions_with_empty_option": 0,
"nothing_to_answer": false
}
},
"error": {
"message": "<string>"
},
"meta": {}
}{
"data": null,
"error": {
"message": "<string>"
},
"meta": null
}{
"data": null,
"error": {
"message": "<string>"
},
"meta": null
}{
"data": "<unknown>",
"error": {
"message": "<string>"
},
"meta": {}
}Publish Assessment
Publishes the assessment and returns its share code.
The response carries a warnings object describing content a learner
could not answer. These are advisory and the assessment publishes
anyway, because a text-only block is sometimes deliberate. Surface them
in your own admin: a question with nothing to answer is worth 0 points,
so an assessment made of them grades every learner 0% with nothing to
explain why.
Organisations that cannot tolerate that can require complete questions,
in which case this endpoint returns 422 instead of publishing. The
same rule covers later edits made in the Edpire builder: an edit to a
live assessment that fails the check is held back, and learners, the
embedded player and every content endpoint of this API keep serving the
last version that passed.
curl --request POST \
--url https://edpire.com/api/v1/assessments/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://edpire.com/api/v1/assessments/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://edpire.com/api/v1/assessments/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://edpire.com/api/v1/assessments/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://edpire.com/api/v1/assessments/{id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://edpire.com/api/v1/assessments/{id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://edpire.com/api/v1/assessments/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "published",
"share_code": "ABC123",
"warnings": {
"empty_exercises": 0,
"empty_questions": 1,
"questions_without_answer_input": 2,
"questions_with_empty_option": 0,
"nothing_to_answer": false
}
},
"error": {
"message": "<string>"
},
"meta": {}
}{
"data": null,
"error": {
"message": "<string>"
},
"meta": null
}{
"data": null,
"error": {
"message": "<string>"
},
"meta": null
}{
"data": "<unknown>",
"error": {
"message": "<string>"
},
"meta": {}
}Authorizations
API key starting with edp_live_. Pass via Authorization: Bearer edp_live_xxx.
Scopes: read:assessments, write:assessments, read:results, write:submissions.
Path Parameters
Assessment UUID