> ## Documentation Index
> Fetch the complete documentation index at: https://docs.repdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# COMPLETE API

> Validate survey completes with a server-to-server call before Research Desk accepts the return redirect.

The COMPLETE API is a server-to-server check that only genuine survey completes are registered in Research Desk. It is meant to block ghost completes. The check is built into Research Desk and must be switched on for your account. Your survey platform still has to make the API call.

Call the API only when a respondent successfully completes the survey, just before you redirect them back to Research Desk. Do not call it on terminations, over-quotas, or security failures.

> [!NOTE]
>
> For help with credentials or implementation, contact [clientsuccess@repdata.com](mailto:clientsuccess@repdata.com) or your Client Success Manager.

## Credentials and respondent values

Find these in Research Desk under **Admin → Account Features**:

| Value | Use |
| - | - |
| **x-api-key** | Static platform API key, sent as a header |
| **Platform\_ID** | Static platform ID, sent in the JSON body |

When a respondent enters from Research Desk, the entry link also passes:

| Value | Use |
| - | - |
| **rdud** | Unique respondent identifier. Send it as `Transaction_ID`. |
| **rd\_proj\_ud** | Research Desk project identifier. Send it as `Survey_Number`. |

Store both in your survey platform. They must be passed on the COMPLETE API call.

## Request

```
POST https://prod.resdefio.com/complete/store
```

Header:

```
x-api-key: <API_KEY>
```

JSON body:

```json theme={null}
{
  "Survey_Number": "<RD_PROJ_UD>",
  "Platform_ID": "<PLATFORM_ID>",
  "Transaction_ID": "<RDUD>"
}
```

Replace `<API_KEY>` and `<PLATFORM_ID>` with the static values from Account Features. Replace `<RD_PROJ_UD>` and `<RDUD>` for each respondent from the entry link.

A successful response uses status code `"0"`:

```json theme={null}
{
  "Status_Code": "0",
  "Status_Message": "Data is stored successfully.",
  "Platform_ID": "<STATIC_PLATFORM_ID_PROVIDED>",
  "Transaction_ID": "<RDUD>",
  "Survey_Number": "<RD_PROJ_UD>"
}
```

After the call, send the respondent to the standard complete redirect. See [Platform Redirect Guides](/research-desk/guides/18-platform-redirect-guides) for your survey tool. Terminate, over-quota, and security exits use the other redirect links and must not call this API.

## Turn validation on in Research Desk

1. Open **Administration → Account Features**
2. Check **Respondent Validation using COMPLETE API** and save
3. On the survey, check **Enable Respondent Validation using COMPLETE API**
4. Save, then test a complete end to end

When the respondent returns, Research Desk looks up the stored API call:

* If it is found, the respondent is marked a complete
* If it is not found, the respondent is terminated with `inbound_code=1` and `inbound_sub_code=5`

A successful test registers a complete. If the traffic report shows `inbound_sub_code` 5 on the test, the API call from the survey tool did not store. Launching with a broken implementation blocks completes and stops traffic.

Once your organization has adopted the API, Rep Data can turn the survey setting on by default for new projects. Ask your Client Success Manager if you want that.

## Qualtrics

An example survey file, `Qualtrics_API_Example.qsf`, is attached to the COMPLETE API Qualtrics article on the Research Desk support site. You can import it into Qualtrics. The survey flow in that example does three things:

1. At the start of Survey Flow, create embedded data for `rdud` and `rd_proj_ud` from the values Research Desk passes on the entry link.
2. At the end of Survey Flow, immediately before End of Survey, add a **Web Service** element:
   * URL: `https://prod.resdefio.com/complete/store`
   * Method: POST
   * Body: `application/json`
   * `Platform_ID`: the static ID from Account Features
   * `Survey_Number`: `${e://Field/rd_proj_ud}`
   * `Transaction_ID`: `${e://Field/rdud}`
   * `x-api-key`: the static key from Account Features
3. The End of Survey element sends the Research Desk complete redirect.

Term points, over-quotas, and the rest of the Qualtrics redirect setup are in [Platform Redirect Guides](/research-desk/guides/18-platform-redirect-guides).

## Forsta Surveys

A Forsta-specific walkthrough is not published yet. Contact [clientsuccess@repdata.com](mailto:clientsuccess@repdata.com) if you need help implementing the call in Forsta.

## Related guides

* [Redirect Hashing](/research-desk/guides/17-redirect-hashing)
* [Entry Links and Redirects](/research-desk/guides/04-entry-links-and-redirects)
* [Platform Redirect Guides](/research-desk/guides/18-platform-redirect-guides)
* [Admin and User Management](/research-desk/getting-started/04-admin-and-users)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.