---
title: "REST API (DC)"
canonical: "https://support.appfire.com/space/SRV/16843057/REST%20API%20(DC)"
format: markdown
---
> Macro (aura-html)

In addition to viewing results in the app UI, you can use the REST API to retrieve survey data and work with it in external systems.

## Authentication

Surveys for Jira uses Jira authentication — a user must be logged in to Jira to retrieve survey information. Survey permissions also apply, so the API returns the same level of information available to the user in the app UI.

## REST services

| **Request** | **Type** | **Description** |
| --- | --- | --- |
| `getAnswers` | GET | Gets survey answers to custom questions for a single project within a specified date range.<br>Required parameters: `projectKey`, `startDate`, `endDate` |
| `getAvgReport` | GET | Gets results of the Average Rating Report for an active survey in a specified project within a date range.<br>Required parameter: `projectKey`. Optional: `startDate`, `endDate` |
| `getByIssue` | GET | Gets survey rating and user comment for a specified ticket.<br>One of the following is required: `issueKey` or `issueId` |
| `getDateReport` | GET | Retrieves data from the Date Report on User Usage report for a specified project within a date range.<br>Required parameter: `projectKey`. Optional: `startDate`, `endDate` |

## Request and response examples

### getAnswers

`http://example.com/jira/rest/surveysData/1.0/getAnswers?projectKey=TEST&startDate=&endDate=`

Starting with version 3.4.x, the service requires `startDate` and `endDate` parameters. Example curl:

```
curl -u admin:admin -X GET -H "Content-Type: application/json" -G \
  "http://example.com/jira/rest/surveysData/1.0/getAnswers?projectKey=TEST&startDate=&endDate="
```

### getAvgReport

`http://example.com/jira/rest/surveysData/1.0/getAvgReport?pKey=TEST&startDate=&endDate=`

### getByIssue

`http://example.com/jira/rest/surveysData/1.0/rating/getByIssue?issueKey=TEST-1`

The response below shows two ratings returned for a ticket that matched survey conditions twice:

```
{
  "status": "200",
  "result": [
    {
      "issueKey": "TEST-1",
      "issueId": 999,
      "issueRating": 4,
      "issueViewRating": "4 out of 5",
      "issueComment": "some comment"
    },
    {
      "issueKey": "TEST-1",
      "issueId": 333,
      "issueRating": 5,
      "issueViewRating": "5 out of 5",
      "issueComment": "another comment"
    }
  ]
}
```

### getDateReport

`http://example.com/jira/rest/surveysData/1.0/getDateReport?pKey=TEST&startDate=&endDate=`