Class: V1::SensoryTestsController

Inherits:
ApiController
  • Object
show all
Includes:
Helpers::StrongParams
Defined in:
api/app/api/v1/sensory_tests_controller.rb

Overview

Manage and retrieve Sensory Tests

Constant Summary collapse

TEST_PARAMS =
[:name,
                 :consumer_name,
                 :project_id,
                 :test_type,
                 :archived_at,
                 :status,
                 :defining_demographic_category_id,
                 :completed_at,
                 :blinding_code_type,
                 { sample_ids: [],
export_settings_attributes: ExportSettings.attribute_names.collect(&:to_sym) }].freeze

Instance Method Summary collapse

Instance Method Details

#export_raw_dataHash<string, Document>

Create a raw data export document (.xlsx)

Example

   curl -X POST "https://app.redjade.net/api/v1/sensory_tests/raw_data_export/" -H "authorization: Bearer $bearer_token"

Returns:

#indexHash<String, Array>

This endpoint will return a list of sensory tests for your company

Options:

  • [Integer] per - record count to return on a page (default 10)
  • [Integer] page - offset of records (default 1)

Example

Fetch a list of studies for your company

    curl -X GET "https://app.redjade.net/api/v1/sensory_tests/?per=25&page=4" -H "authorization: Bearer $bearer_token"
    {
      "response": [
        {
          "id": 12345,
          "name": "Your First Test",
          "test_type": "Your First Test Description",
          "project_id": 54321,
          "title": "User Friendly Name",
          "project_name": "Your First Project",
          "created_by_name": "John Doe",
          "created_at": "2018-04-25T15:59:07.144Z",
          "updated_at": "2018-04-25T22:11:25.568Z",
          "status": "launched"
        },
        ...
      ]
    }

Returns:

  • (Hash<String, Array>)

    list of studies