openapi: 3.2.0 info: title: Decipher Rest Survey Evaluate API version: '1.0' description: The Decipher REST API allows comprehensive automation of your private or shared Decipher instance. servers: - url: https://{server}/api/v1 description: Replace server with your instance domain. variables: server: default: selfserve.decipherinc.com description: Server domain security: - APIKey: [] tags: - name: Survey Evaluate paths: /surveys/{survey}/evaluate: post: operationId: createSurveyEvaluate summary: Evaluate description: 'Evaluates code within a specific survey environment. This allows you to find out the value of logic conditions such as `q3.r5.val` within a specific participant''s survey context. The context can be omitted; in that case the last submitted state is used (this is most useful when debugging where you know no new data appears). This is equivalent to modifying the survey.xml to add an `` block that prints out the valuate. This API is available from the command line using the `beacon eval` tool. Run `beacon eval survey/path` to open up a shell that lets you evaluate multiple commands using this API. This command takes an optional state ID. The returned object has a `stdout` value that corresponds to what would be printed in a shell. Thus if you ask for a string, e.g. `q1.r1.val` the Python representation of a string is returned, i.e. `''Hello\n''`. You can use `print q1.r1.val` to avoid that. The returned `state` value can be passed in again to ensure the same evaluation environment -- this is useful if you called the API without an explicit state. Any changes to question data (e.g. q3.r1.val = "foo") or persistent variables will be reset next time you call the API, as the state is reloaded. Assignment to local variables may or may nor persistent, just like in the normal data collection.' tags: - Survey Evaluate parameters: - $ref: '#/components/parameters/survey' requestBody: content: application/json: schema: type: object properties: cond: description: 'Python condition to evaluate. This works like the Python command line shell: you can send a multi-line loop' type: string state: description: The ID of the state to enter. After submitting a survey page, view the source code and look for the hidden "state" variable. If omitted, the last submitted state is used. type: string required: - cond responses: '200': description: OK content: application/json: schema: type: object properties: state: type: string description: the state against which the expression was evaluated example: 2498cbe94fb82cd2c153edc73370aa99ce95592fQ000001Q000002a7 stdout: type: string description: the content that would be printed on the shell example: Hello Professor Falken components: parameters: survey: name: survey in: path required: true description: The survey path. example: selfserve/1a/123456 schema: type: string format: uri securitySchemes: APIKey: type: apiKey in: header name: x-apikey description: 'In order to access the api, you''ll need to generate an API key. Refer to the instructions [here](/docs/decipher/api#section/API-Keys) to generate and configure an API key with the appropriate permission sets. You can generate as many keys as required. Configure each request to include your API key in the request header. For example: ``` x-apikey: dp48ss3mgsaucyjtybxw728h7s4cgnwzhejtszdwhf4xpe8yhmtdwpk2ntdhtwbs ``` ' x-tagGroups: - name: Autoclose tags: - Autoclose - name: Data Input and Output tags: - Data - Data Feed - Response Summary - Modifying Data - Datasources - Datasources Data - Umerge - name: Survey Metadata tags: - Simulated Data - Survey State - Survey Evaluate - Survey Quotas - Survey Files - Survey Warnings - Survey Terms - Survey Subscribers - Survey Users - Survey Tasks - name: Panels tags: - Panel Data - Panel Datapoints - Survey Panels - name: Research Hub tags: - Users - Companies - Categories - Surveys - Panels - Crosstabs - Archives - Archival Reports - API Keys - Usage - Warnings Summary - name: Crosstabs tags: - Crosstabs Configuration - Crosstabs Execution - Crosstabs Nets - Saved Crosstabs - Crosstabs Table Settings - Crosstabs Validation - Crosstabs Rim Weighting - name: Dashboards tags: - Dashboards - name: DQ APIs tags: - DQ-Specific API Calls - MaxDiff API Calls - Discrete Choice Model API Calls - Media Testimonial API Calls - name: Response Summary tags: - Share Link - name: Sample Management tags: - Bounced Emails - Participant Sources - name: Distribution tags: - Email Distribution - SFTP Distribution - Slack Distribution - name: Campaign Manager tags: - Campaigns - Campaign Email Invites - Campaign Exports - Campaign Lists - Shared Campaign Lists - Campaign Sends - Campaign Status Lists - Supression Lists - name: Question Library tags: - Company Element - Company Elements - Survey Elements - Survey Element Report Settings - name: Language Manager tags: - LM Application Data - LM Application Translations - Translation Resources - Translations - Translation Deltas - Translation Reservations - Primary Survey Language - Other Survey Languages - Unused Survey Languages - name: Project Parameters tags: - Available Project Parameters - Saved Project Parameters - Project Parameters Configuration - name: Multi-User Editing tags: - Available Sections - Check Out Section - Check In Section - Sync Section - Section Editor - Abandon Section - Validate Section - name: Video Management tags: - Videos - Watermarked Videos - name: Miscellaneous tags: - System Information - Logic Nodes - Logic Events - CATI - Global Search - Miscellaneous