Retrieve Questionnaire for User

To retrieve the active questionnaire for the user to submit answers for it, the following GET request can be used:

https://pistis-market.eu/srv/intention-analytics/api/questionnaire/:assetId/active-questionnaire,

where assetId should be the id of the asset that the user wants to submit answers for

The service will check whether the user has bought the asset or not, to retrieve the relevant active questionnaire version.

Server Response

If no submitted answers are found, the questionnaire details with its questions are returned:

{
  "id": "e96f396b-10ba-4164-96be-e432056e2114",
  "version": "9",
  "title": "User questionnaires",
  "description": "test description",
  "questions": [
    {
      "id": "16e15fa3-f745-4b7f-8953-91969209c96a",
      "type": "Checkbox",
      "title": "Checkbox question",
      "isRequired": true,
      "options": [
        {
          "text": "Text 1",
          "description": "Description 1"
        },
        {
          "text": "Text 2",
          "description": "Description 2"
        }
      ]
    }
  ]
}

If the (logged in) user had already submitted answers for the requested active questionnaire and for the requested asset, a 400 Error Response will be returned, with the following message:

You have already submitted answers for this asset