ONYX REST documentation

(2025.06.1 build 202506031026)

Methods:

temporary
run
version
notify
info
registerTest
registerStudent
armSite
initiateSite
disarmSite
getResultValues
getResultVariables
testControl
deregisterTest
remainingTestTime
notificationState
testTime
sysinfo

temporary

Requests the latest temporary saved export file.

Parameter:

NameTypeOptional?Description
uniqueIdLongfalseUnique ID for this test run. Must be unique per student and test.
parametersMap<String,String>falseGeneric parameter map. Keys and values are both strings. This is currently only used to filter the return values. Only the given keys are returned by the method, except some system return values, which are alwys returned.

Returns:

Type:Map<String,String>
KeyDescription
datetimepatternPattern to parse datetimes
onyxStartupDatetime of ONYX system startup
lastAccessDatetime of last user action
lastSavedDatetime of latest export
stateUsers current state
  • ACTIVE: user did interact in timeout time
  • INACTIVE: user did not interact in timeout time
  • SAVED: temporary results were transmitted
resultsBase64results.zip, file contents Base64 encoded
errorOnly set in case of errors, will deliver detailled error message.

run

Starts a test (simple registration mode, deprecated). Use registerTest/registerStudent instead!

Parameter:

NameTypeOptional?Description
uniqueIdStringfalseUnique ID for this test run. Must be unique per student and test.
contentPackagebyte[]falseContains the content package (test.zip file). The files contents must be transmitted as byte array without any escaping.
languageStringfalseUsers language for display. One of "de", "en".
templateIdStringfalseONYX template ID. This is lecacy stuff and also contains all display parameters.
serviceNameStringfalseName of the system using ONYX. Must be configured in ONYX to be able to use it.
allowShowSolutionbooleanfalseTest flow parameter: May student see the correct solutions after entering the answers?
parametersMap<String,String>trueAdditional parameters. See registerStudent documentation.

Returns:

Type:HashMap<String,String>
KeyDescription
runtrue if successful, false otherwise
blockedExecution result. Less than 0 in case of error, larger than 0 in case of success.

version

Requests the current version of ONYX REST API.

Parameter:

NameTypeOptional?Description
parametersMap<String,String>falseGeneric parameter map. Keys and values are both strings. This is currently only used to filter the return values. Only the given keys are returned by the method, except some system return values, which are alwys returned.

Returns:

Type:Map<String,String>
KeyDescription
versionONYX version
buildONYX build date

notify

Send message to active test users

Parameter:

NameTypeOptional?Description
uniqueIdsListfalseList of user IDs
messageStringfalseMessage to display
parametersMap<String,String>falseAdditional parameters (currently ignored)

Returns:

Type:Boolean
KeyDescription
successTrue if message was displayed.

info

Requests information about the given session.

Parameter:

NameTypeOptional?Description
uniqueIdLongfalseUnique ID for this test run. Must be unique per student and test.
parametersMap<String,String>falseGeneric parameter map. Keys and values are both strings. This is currently only used to filter the return values. Only the given keys are returned by the method, except some system return values, which are alwys returned.

Returns:

Type:Map<String,String>
KeyDescription
lastAccessDatetime of last user action
datetimepatternPattern to parse datetimes
inactivityPeriodMsMilliseconds to wait until users are marked as inactive
onyxStartupDatetime of ONYX system startup
errorOnly set in case of errors, will deliver detailled error message.

registerTest

Registers a test to be run for multiple students at ONYX test player.

Parameter:

NameTypeOptional?Description
testSessionIdLongfalseUnique ID for this test.
providerIdStringfalseName of the system using ONYX. Must be configured in ONYX to be able to use it.
contentPackagebyte[]falseContains the content package (test.zip file). The files contents must be transmitted as byte array without any escaping.
parametersMap<String,String>falseAdditional parameters.
  • showSolution: (true/false) Deprecated. Use more specific parameters for that. Show items correct solution, the correctness of users answer and item score.
  • showFeedback: (true/false) Deprecated. Use more specific parameters for that. Show test and item feedback.
  • testShowFeedback: (true/false) Show test feedback. Also triggers show item feedback.
  • testShowPassed: (true/false) Show test passed information.
  • testShowScore: (true/false) Show total test score.
  • itemShowFeedback: (true/false) Show item feedback
  • itemShowCorrect: (true/false) Show users answer correctness for item
  • itemShowScore: (true/false) Show item score to user
  • itemShowSolution: (true/false) Show correct solution for item
  • isSurvey: (true/false) Is this a survey?
  • suspendAllowed: (true/false) Suspend allowed for this test?
  • dontShowItemTitles: (true/false) True = Do not show item titles.
  • templateid: (String) Template ID (currently not used)
  • ltiUrl: (String) URL to forward the user to after test finished.
  • published: (true/false) Is this a published run from ONYX editor?
  • editorltitest: (true/false) Was this run started using LTI by ONYX editor?

Returns:

Type:Long
KeyDescription
resultCodeResult code. 42 is OK, lower than zero or greater than 42 is error.

registerStudent

Registers a student to run a registered test at ONYX test player.

Parameter:

NameTypeOptional?Description
testSessionIdLongfalseUnique ID for the test as registered using registerTest.
studentIdLongfalseUnique identifier of the student in that test session.
payloadbyte[]trueContains the users former results as file (results.zip file). The files contents must be transmitted as byte array without any escaping.
parametersMap<String,String>falseAdditional parameters.
  • language: Users language for display
  • status: One of the test states:
    1. WAITING
    2. WORKING
    3. FINISHED
    4. RESUME_ALLOWED
    5. NOT_ENTERED
    6. CANCELED
    7. RESUME_REQUESTED
    8. RESUMED
    9. DISCONNECTED
    10. SUSPENDED
    11. RESUME_SUSPENDED
  • Others: Override the ones given by registerTest:
    • showSolution: (true/false) Deprecated. Use more specific parameters for that. Show items correct solution, the correctness of users answer and item score.
    • showFeedback: (true/false) Deprecated. Use more specific parameters for that. Show test and item feedback.
    • testShowFeedback: (true/false) Show test feedback. Also triggers show item feedback.
    • testShowPassed: (true/false) Show test passed information.
    • testShowScore: (true/false) Show total test score.
    • itemShowFeedback: (true/false) Show item feedback
    • itemShowCorrect: (true/false) Show users answer correctness for item
    • itemShowScore: (true/false) Show item score to user
    • itemShowSolution: (true/false) Show correct solution for item
    • isSurvey: (true/false) Is this a survey?
    • suspendAllowed: (true/false) Suspend allowed for this test?
    • dontShowItemTitles: (true/false) True = Do not show item titles.
    • templateid: (String) Template ID (currently not used)
    • ltiUrl: (String) URL to forward the user to after test finished.
    • published: (true/false) Is this a published run from ONYX editor?
    • editorltitest: (true/false) Was this run started using LTI by ONYX editor?

Returns:

Type:Long
KeyDescription
resultCodeResult code. 42 is OK, lower than zero or greater than 42 is error.

armSite

Requests communication information (such as tokens) for ONYX reporter communication.

Parameter:

NameTypeOptional?Description
versionIntegerfalseAPI version (currently 3)
userIdStringfalseUsers ID
optionalRoleIntegertrueUsers role (assessor, tutor, student)
secretToShareStringfalseShared secret as agreed before.
optionalUserLastNameStringtrueUsers first name for display
optionalUserFirstNameStringtrueUsers last name for display
additionalParamsHashMap<String,String>falseAdditional parameters
  • providerID: provider ID as configured in ONYX to be able to send the new results back to LMS
  • assessmentID: in case of manual assessment of single student results, to be able to send the new results back to LMS

Returns:

Type:String
KeyDescription
reporterSessionIdReporter session ID, LMS can use this to render IFrame URL

initiateSite

Initiates ONYX reporter communication.

Parameter:

NameTypeOptional?Description
versionIntegerfalseAPI version (currently 3)
sessionIdStringfalseReporter session ID
secretToShareStringfalseShared secret as agreed before.
studentsListfalse
optionalContentPackagebyte[]trueContains the content package (test.zip file). The files contents must be transmitted as byte array without any escaping.
additionalParamsHashMap<String,String>falseAdditional parameters.
  • csv: Do not prepare a view, return CSV export of delivered results instead. All other parameters are ignored. In that case also the follwinig parameters should be given:
    • lang:users locale
    • anonymize:true/false - do not print out any sensible data
    • maxAttempts: Maximum attempts value as configured outside the ONYX system, e.g. by the LMS
  • showSolution: (true/false) Deprecated. Use more specific parameters for that. Show items correct solution, the correctness of users answer and item score.
  • showFeedback: (true/false) Deprecated. Use more specific parameters for that. Show test and item feedback.
  • testShowFeedback: (true/false) Show test feedback. Also triggers show item feedback.
  • testShowPassed: (true/false) Show test passed information.
  • testShowScore: (true/false) Show total test score.
  • itemShowFeedback: (true/false) Show item feedback
  • itemShowCorrect: (true/false) Show users answer correctness for item
  • itemShowScore: (true/false) Show item score to user
  • itemShowSolution: (true/false) Show correct solution for item
  • isSurvey: (true/false) Is this a survey?
  • suspendAllowed: (true/false) Suspend allowed for this test?
  • dontShowItemTitles: (true/false) True = Do not show item titles.
  • templateid: (String) Template ID (currently not used)
  • ltiUrl: (String) URL to forward the user to after test finished.
  • published: (true/false) Is this a published run from ONYX editor?
  • editorltitest: (true/false) Was this run started using LTI by ONYX editor?

Returns:

Type:String
KeyDescription
resultNormal mode: URL to reporter GUI to show the requested view (may be an error page). CSV mode: Base64 encoded CSV file content.

disarmSite

Ends ONYX reporter communication.

Parameter:

NameTypeOptional?Description
versionIntegerfalseAPI version (currently 3)
sessionIdStringfalseReporter session ID
secretToShareStringfalseShared secret as agreed before.
additionalParamsHashMap<String,String>falseAdditional parameters. Currently ignored.

Returns:

Type:Boolean
KeyDescription
successResulting state

getResultValues

Requests results values (SCORE = 2, ...) from ONYX reporter. Requires student results.

Parameter:

NameTypeOptional?Description
versionIntegerfalseAPI version (currently 3)
sessionIdStringfalseReporter session ID
secretToShareStringfalseShared secret as agreed before.
requestedValuesHashMap<String,String>falseFilter map. Only variables with names matching keys in that map will be returned. The values (if not null) are handled as default values. If a requested parameter is not found, it is returned nontheless, with the default value as value.
additionalParamsHashMap<String,String>falseAdditional parameters.
  • all: Requests result variables for all students which were given in initiateSite request. Key is in format studentId<space>variableName then. If not given only the last students result variables are returned.

Returns:

Type:Map<String,String>
KeyDescription
variableTest variables, key is the variable name, value their value.

getResultVariables

Requests test variables (SCORE, ...) from ONYX reporter (not their values!). Only requires a test.

Parameter:

NameTypeOptional?Description
versionIntegerfalseAPI version (currently 3)
contentPackagebyte[]falseContains the content package (test.zip file). The files contents must be transmitted as byte array without any escaping.
additionalParamsHashMap<String,String>falseAdditional parameters. Currently ignored.

Returns:

Type:Map<String,String>
KeyDescription
variableMap of result vars and their type

testControl

Allows to control the test flow for students which are currently executing their tests at ONYX test player.

Parameter:

NameTypeOptional?Description
testSessionIdLongfalseUnique ID for the test as registered using registerTest.
studentIdsStudentIdsWrapperfalseUnique identifiers of the students to handle. All must have been registered using registerStudent.
statusIntegerfalseNew test state to set. One of:
  1. WAITING
  2. WORKING
  3. FINISHED
  4. RESUME_ALLOWED
  5. NOT_ENTERED
  6. CANCELED
  7. RESUME_REQUESTED
  8. RESUMED
  9. DISCONNECTED
  10. SUSPENDED
  11. RESUME_SUSPENDED
parametersMap<String,String>falseAdditional parameters.
  • addTime: Time to add to users test time limit in minutes.
  • showSolution: (true/false) Deprecated. Use more specific parameters for that. Show items correct solution, the correctness of users answer and item score.
  • showFeedback: (true/false) Deprecated. Use more specific parameters for that. Show test and item feedback.
  • testShowFeedback: (true/false) Show test feedback. Also triggers show item feedback.
  • testShowPassed: (true/false) Show test passed information.
  • testShowScore: (true/false) Show total test score.
  • itemShowFeedback: (true/false) Show item feedback
  • itemShowCorrect: (true/false) Show users answer correctness for item
  • itemShowScore: (true/false) Show item score to user
  • itemShowSolution: (true/false) Show correct solution for item
  • isSurvey: (true/false) Is this a survey?
  • suspendAllowed: (true/false) Suspend allowed for this test?
  • dontShowItemTitles: (true/false) True = Do not show item titles.
  • templateid: (String) Template ID (currently not used)
  • ltiUrl: (String) URL to forward the user to after test finished.
  • published: (true/false) Is this a published run from ONYX editor?
  • editorltitest: (true/false) Was this run started using LTI by ONYX editor?

Returns:

Type:Long
KeyDescription
resultCodeResult code. 42 is OK, lower than zero or greater than 42 is error.

deregisterTest

Cleans up a test session.

Parameter:

NameTypeOptional?Description
testSessionIdLongfalseUnique ID for this test run. Must be unique per student and test.
providerIdStringfalseName of the system using ONYX. Must be configured in ONYX to be able to use it.
parametersMap<String,String>falseAdditional parameters. Currently ignored.

Returns:

Type:Long
KeyDescription
resultCodeExecution result. Less than 0 in case of error, greater than 0 in case of success.

remainingTestTime

Requests the remaining test time for a given test session.

Parameter:

NameTypeOptional?Description
uniqueIdsListfalseList of user IDs
parametersMap<String,String>falseAdditional parameters (currently ignored)

Returns:

Type:Map<String,String>
KeyDescription
assessmentIdMap of student ID and remaining time in seconds

notificationState

State of the notification system

Parameter:

NameTypeOptional?Description
uniqueIdsListfalseList of user IDs
parametersMap<String,String>falseAdditional parameters (currently ignored)

Returns:

Type:Map<String,String>
KeyDescription
assessmentIdMap of student ID and state

testTime

Requests the currently used time for a given test session.

Parameter:

NameTypeOptional?Description
uniqueIdsListfalseList of user IDs
parametersMap<String,String>falseAdditional parameters (currently ignored)

Returns:

Type:Map<String,String>
KeyDescription
assessmentIdMap of student ID and remaining time in seconds

sysinfo

Requests system information.

Parameter:

NameTypeOptional?Description
parametersMap<String,String>trueOptional. If given, only the given parameters will be returned.

Returns:

Type:Map<String,String>
KeyDescription
nameInstance name
versionONYX version
buildONYX build info