---
agentTools:
  projectIndex: https://docs.helpfull.com/llms.txt
---

# Retrieve a test

Retrieves a Test with the given ID.

If you want to update the number of currently submitted responses in real-time, you would probably be interested in `numberOfResponses` field.

Please note that we usually order slightly more responses than ordered, so for monitoring the test completion status please check the `status` field
rather than `numberOfResponses`, which could be a bit higher than `numberOfParticipants` ordered (f.e. `202/200`).

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "Helpfull API"
  },
  "servers": [
    {
      "url": "https://api.helpfull.com/v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/tests/{id}": {
      "get": {
        "summary": "Retrieve a test",
        "description": "Retrieves a Test with the given ID.\n\nIf you want to update the number of currently submitted responses in real-time, you would probably be interested in `numberOfResponses` field.\n\nPlease note that we usually order slightly more responses than ordered, so for monitoring the test completion status please check the `status` field\nrather than `numberOfResponses`, which could be a bit higher than `numberOfParticipants` ordered (f.e. `202/200`).\n",
        "operationId": "get-test",
        "tags": [
          "Test"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TestID"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a Test object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Test"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "parameters": {
      "TestID": {
        "name": "id",
        "description": "Test ID",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "NotFound": {
        "description": "The specified resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "Demographics": {
        "type": "object",
        "description": "Array of Demographics objects",
        "properties": {
          "name": {
            "description": "Demographics name",
            "type": "string"
          },
          "values": {
            "type": "array",
            "description": "Selected demographics values",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Option": {
        "type": "object",
        "description": "Answer option to the choice question",
        "properties": {
          "id": {
            "description": "Option ID",
            "type": "string"
          },
          "value": {
            "type": "string",
            "description": "The value of the option. If the question is of type `images-comparison` then it is a URL, otherwise just a string"
          },
          "numberOfVotes": {
            "type": "number",
            "description": "Number of votes for this option"
          }
        }
      },
      "Question": {
        "type": "object",
        "description": "Question",
        "properties": {
          "id": {
            "description": "Question ID",
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Type of the question",
            "enum": [
              "short-text",
              "multiple-choice",
              "picture-choice",
              "video-choice",
              "rating-scale"
            ]
          },
          "question": {
            "type": "string",
            "description": "Question of the question 😎"
          },
          "options": {
            "type": "array",
            "description": "Answer options",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          }
        }
      },
      "Test": {
        "required": [
          "id",
          "shareId",
          "name",
          "status",
          "demographics",
          "numberOfParticipants",
          "numberOfResponses",
          "createdOn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Test ID"
          },
          "shareId": {
            "type": "string",
            "description": "An ID to build a shareable link for a test.\nBuild it like this `https://app.helpfull.com/results/` + `shareId` + `/share`.\n"
          },
          "shareable": {
            "type": "boolean",
            "description": "Shows whether the question can be accessed via a shareable link"
          },
          "name": {
            "type": "string",
            "description": "Test name"
          },
          "status": {
            "type": "string",
            "description": "Test status. One of the following `draft`, `api-draft`, `in progress`, `ongoing`, `completed`\n\nWhen you Run a test from our API it starts with `in progress` status and then changes to `completed`.\n",
            "enum": [
              "draft",
              "api-draft",
              "in progress",
              "ongoing",
              "completed"
            ]
          },
          "demographics": {
            "type": "array",
            "description": "Array with Test demographics. Right now this is not customizable, all the Tests are being ran to our General Audience.",
            "items": {
              "$ref": "#/components/schemas/Demographics"
            }
          },
          "questions": {
            "type": "array",
            "description": "Array with Test questions",
            "items": {
              "$ref": "#/components/schemas/Question"
            }
          },
          "numberOfParticipants": {
            "type": "number",
            "description": "The number of Test participants",
            "minimum": 25,
            "maximum": 1000
          },
          "numberOfResponses": {
            "description": "The number of Test participants who have already passed the test",
            "type": "number",
            "minimum": 0
          },
          "createdOn": {
            "type": "string",
            "description": "Date of Test creation",
            "format": "date-time"
          },
          "startedOn": {
            "type": "string",
            "description": "Date of Test launch",
            "format": "date-time"
          },
          "completedOn": {
            "type": "string",
            "description": "Date of Test completion",
            "format": "date-time"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 97,
      "1": 128,
      "2": 252,
      "3": 211,
      "4": 48,
      "5": 230,
      "6": 60,
      "7": 10,
      "8": 16,
      "9": 231,
      "10": 132,
      "11": 208
    }
  }
}
```