API question - RapturePlatform/Rapture GitHub Wiki

Question API

The question API allows control input to a decision process from clients (typically humans -- automated steps are better served by scripts).

putTemplate

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
void retVal = questionApi.putTemplate(qTemplateURI, template);
retVal = baseAPI.doQuestion_PutTemplate(qTemplateURI, template);

Entitlement: /data/write/$f(qTemplateURI)

Defines or redefines a question template.

Function Parameters

Parameter Type Description
qTemplateURI String
template QTemplate

Return value

Type Description
void
Types used in this function

QTemplate

Template data for a Question object, as defined in the Question API.

Field Type
qtemplateURI QTemplateURI
quorum List(UserURI)
rule AnswerRule
prompt String
options List(String)
form List(QDetail)
reports List(String)
timeout Long

getTemplate

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
QTemplate retVal = questionApi.getTemplate(qTemplateURI);
retVal = baseAPI.doQuestion_GetTemplate(qTemplateURI);

Entitlement: /data/read/$f(qTemplateURI)

Retrieves a question template.

Function Parameters

Parameter Type Description
qTemplateURI String

Return value

Type Description
QTemplate
Types used in this function

QTemplate

Template data for a Question object, as defined in the Question API.

Field Type
qtemplateURI QTemplateURI
quorum List(UserURI)
rule AnswerRule
prompt String
options List(String)
form List(QDetail)
reports List(String)
timeout Long

getQuestion

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
Question retVal = questionApi.getQuestion(questionURI);
retVal = baseAPI.doQuestion_GetQuestion(questionURI);

Entitlement: /data/read/$f(questionURI)

Retrieve a question for a URI.

Function Parameters

Parameter Type Description
questionURI String

Return value

Type Description
Question
Types used in this function

Question

Main data for a Question API object.

Field Type
questionURI QuestionURI
qtemplateURI QTemplateURI
answer String
priority String
mapping Map(String, String)
progress ReplyProgress

askQuestion

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
String retVal = questionApi.askQuestion(qTemplateURI, variables, callback);
retVal = baseAPI.doQuestion_AskQuestion(qTemplateURI, variables, callback);

Entitlement: /question/exec/$f(qTemplateURI)

Asks a question using a template. The callback may not contain slashes.

Function Parameters

Parameter Type Description
qTemplateURI String
variables Map<String,String>
callback String

Return value

Type Description
String

getQNotifications

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
List<QNotification> retVal = questionApi.getQNotifications(search);
retVal = baseAPI.doQuestion_GetQNotifications(search);

Entitlement: /data/read

Lists what questions are pending for a given condition.

Function Parameters

Parameter Type Description
search QuestionSearch

Return value

Type Description
List
Types used in this function

QuestionSearch

Contains search results for questions.

Field Type
user String
progress ReplyProgress
sortOrder String
timeStamp Long

getQNotificationURIs

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
List<String> retVal = questionApi.getQNotificationURIs(search);
retVal = baseAPI.doQuestion_GetQNotificationURIs(search);

Entitlement: /data/read

Gets the URIs for a questionSearch.

Function Parameters

Parameter Type Description
search QuestionSearch

Return value

Type Description
List
Types used in this function

QuestionSearch

Contains search results for questions.

Field Type
user String
progress ReplyProgress
sortOrder String
timeStamp Long

answerQuestion

HttpQuestionApi questionApi = new HttpQuestionApi(loginApi);
void retVal = questionApi.answerQuestion(questionURI, response, data);
retVal = baseAPI.doQuestion_AnswerQuestion(questionURI, response, data);

Entitlement: /data/read

Attaches an answer to the given question.

Function Parameters

Parameter Type Description
questionURI String
response String
data Map<String,Object>

Return value

Type Description
void
⚠️ **GitHub.com Fallback** ⚠️