Create first form
In order to get your first form up and running, you will need to implement a few functions inside your ninox database.
saveOrUpdateForm
function saveOrUpdateForm(form:Form) do
let _ninoxHost := "anastasia.ninoxdb.com";
let _ninoxApiKey := "YOUR_NINOX_API_KEY";
let _captchaProtect := false;
let _teamId := teamId();
let _databaseId := databaseId();
let _askUntilDate := date(2024,1,1);
let _startAcceptingDate := today();
let _ninoxbeeHost := "https://app.ninoxbee.com";
let _body := {
host: _ninoxHost,
apiKey: _ninoxApiKey,
teamId: _teamId,
databaseId: _databaseId,
introFn: "_myIntroFn",
initFn: "_myInitSessionFn",
summaryFn: "_myGetSummary",
nextFn: "_myGetNextQuestionFn",
prevFn: "_myGetPreviousQuestionFn",
answerFn: "_myAnswerQuestionFn",
buttonTextFn: "_myButtonTextFn",
captcha: _captchaProtect,
pinCode: "" + a.'Pin Code',
askUntil: "" + format(_askUntilDate, "YYYY-MM-DD"),
enabled: true,
startDate: "" + format(_startAcceptingDate, "YYYY-MM-DD"),
introImgUrl: "URL TO A PUBLIC IMAGE TO DISPAY ON INTRO SCREEN",
basicSkinning: {
logoUrl: "URL TO FORM LOGO,
headerTitle: "TITLE OF THE FORM IN HEADER",
headerBgColor: "#000000",
headerFgColor: "#FFFFFF"
},
languages: [{
code: "fr",
name: "Français",
languageOrder: 1
}],
advancedSkinning: null,
formExpiredMessage: "This form has expired,
pincodeErrorMessage: "Invalid pincode",
formNotOpenYetMessage: "Form not open",
formNotPublishedMessage: "For not published"
};
if form._FORM_ID = null then
let response := do as server
http("POST", _ninoxbeeHost + "/api/v1/forms", {
'x-auth': "_YOUR_NINOXBEE_APIKEY",
'content-type': "application/json"
}, _body)
end;
a.(_FORM_ID := response.result.result.uuid);
a.(_FORM_URL := response.result.result.publicUrl)
else
let response := do as server
http("PUT", nbHost() + "/api/v1/forms/" + a._FORM_ID, {
'x-auth': s.'Ninoxbee Api Key',
'content-type': "application/json"
}, _body)
end;
void
end
end;introFn and initFn
Ninoxbee ninox app




Field
Description
Options
Required
Last updated