Aidbox SDC API

Custom SDC operations supported by Aidbox Forms.

This operation generates a link to a web page to be used to continue answering a specified QuestionnaireResponse.

URLs

POST [base]/QuestionnaireResponse/[id]/$generate-link

Parameters

NOTE: All parameters wrapped with Parameters object

resourceType: Parameters
parameter:
- name:  [var-name]
  value: [var-value]

allow-amend

Whether the generated link will allow amending and re-submitting the form.

name: allow-amend
value:
  Boolean: true

allow-repopulate

Whether the generated link will allow re-populating the form.

NOTE: Repopulate will be working only with forms that contain populate behavior

name: allow-repopulate
value:
  Boolean: true

redirect-on-submit

A URL where the user will be redirected to after successfully submitting the form.

name: redirect-on-submit
value:
  String: https://example.com/submit-hook?questionnaire=123

redirect-on-save

A URL where the user will be redirected to after hitting Save button.

By default Save button is not visible - form autosaved after every keystroke. But sometimes it's usefull to close form in a partially-filled state

name: redirect-on-save
value:
  String: https://example.com/submit-hook?questionnaire=123

expiration

Link expiration period (days)

name: expiration
value:
  Integer: 30

By default thir parameter = 7 days

theme

Form theme.

name: theme
value:
  String: hs-theme

read-only

Show form in a read-only mode

name: read-only
value:
  Boolean: true

app-name

Application name that will be used in Audit logging when returned link was used.

Audit logging should be enabled via configuartion

- name: app-name
  value
    String: my-app

Usage Example

POST [base]/QuestionnaireResponse/[id]/$generate-link
content-type: text/yaml

resourceType: Parameters
parameter:
  - name: allow-amend
    value:
      Boolean: true
  - name: redirect-on-submit
    value:
      String: https://example.com/submit-hook?questionnaire=123

Aidbox uses HS256 to sign JWT token by default. To use RS256 you need to set

BOX_AUTH_KEYS_PRIVATE and BOX_AUTH_KEYS_PUBLIC environment variables.

https://docs.aidbox.app/reference/configuration/environment-variables/optional-environment-variables#set-up-rsa-private-public-keys-and-secret

Last updated