Skip to content

Latest commit

 

History

History
98 lines (72 loc) · 1.84 KB

aidbox-sdc-api.md

File metadata and controls

98 lines (72 loc) · 1.84 KB
description
Custom SDC operations supported by Aidbox Forms.

Generate a link to a QuestionnaireResponse - $generate-link

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

{% hint style="warning" %} NOTE: All parameters wrapped with Parameters object

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

{% endhint %}

allow-amend

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

name: allow-amend
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

Usage Example

{% tabs %} {% tab title="Request" %}

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

{% endtab %}

{% tab title="Success Response" %}

HTTP status: 200

link: http://forms.aidbox.io/ui/sdc#/questionnaire-response/12c1178c-70a9-4e02-a53d-65b13373926e?token=eyJhbGciOiJIUzI

{% endtab %}

{% tab title="Failure Response" %}

HTTP status: 422

resourceType: OperationOutcome
text:
  status: generated
  div: Parameters are invalid
issue:
- severity: error
  code: invalid
  expression:
  - parameter.0.resource
  diagnostics: unknown key :resource

{% endtab %}

{% endtabs %}