> ## 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.

# Create Links

Creates respondent "test" and "live" entry links for a Stream and registers the redirect URLs respondents should be sent to for each disposition.

##### Path Parameters

| Parameter      | Description                                                      | Required | Example |
| -------------- | ---------------------------------------------------------------- | -------- | ------- |
| `StreamNumber` | The `StreamNumber` (integer) or `StreamUd` (UUID) of the stream. | Yes      | `849`   |

##### Request Body

| Field                   | Description                                         | Required |
| ----------------------- | --------------------------------------------------- | -------- |
| `SurveyCompleteLink`    | Redirect used after a completion.                   | Yes      |
| `SurveyTermLink`        | Redirect used after a termination.                  | Yes      |
| `SecurityFraudTermLink` | Redirect used after a quality/security termination. | Yes      |
| `SurveyOverquotaLink`   | Redirect used after an over-quota termination.      | Yes      |

> **Use `[%rid%]` (case sensitive)** in your redirect URLs to pass back the Respondent ID that was originally passed into the entry link as `[%RID%]`.

Research Desk automatically appends additional variables to your redirect links on return, including `isc` status codes, the hashed key (`hk`), and `SCPI` (the respondent's CPI on Stream entry). See [Respondent Status Codes](/supply/overview/04-respondent-status-codes), [Redirect Link Parameters](/supply/overview/01-environments-and-status-codes#redirect-link-parameters), and [Secure Redirects](/supply/guides/04-secure-redirects).


## OpenAPI

````yaml POST /v2/surveys/streams/{StreamNumber}/link
openapi: 3.0.3
info:
  title: Research Desk Supply API
  version: 1.0.0
  description: >-
    Rep Data's sample platform, Research Desk, lets sample suppliers integrate
    via API for programmatic sample order placement and fulfillment.


    The Supply API is a RESTful service that returns JSON. Suppliers retrieve
    available survey opportunities (Surveys and Streams), read the
    qualifications and quotas attached to each Stream, generate respondent entry
    links, and reconcile completed sessions.


    ## Authentication


    Authentication is done via an obfuscated GUID (API key) associated with each
    supplier and passed in the `Authorization` header of every request. To
    obtain credentials, contact Rep Data's Supply team at supply@repdata.com.


    ## Environments


    Production URL: `https://api.researchdesk.com`  

    Staging URL: `https://stage-api.researchdesk.com`


    We recommend completing full end-to-end testing in staging before going
    live. Staging test surveys 2634 (short, 1 question) and 2635 (longer, ~10
    minutes) are available for integration testing.


    ## Responses


    Successful responses are wrapped in a standard envelope:


    ``` json

    {
        "Status": 0,
        "Message": "Success",
        "Data": { }
    }
     ```

    A `Status` of `0` indicates success. `Data` contains the endpoint-specific
    payload.
servers:
  - url: https://api.researchdesk.com
    description: Production
  - url: https://stage-api.researchdesk.com
    description: Staging
security: []
paths:
  /v2/surveys/streams/{StreamNumber}/link:
    post:
      summary: Create Links
      operationId: Links_CreateLink
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Your obfuscated Supply API key (GUID), provided by Rep Data.
          schema:
            type: string
          example: '{{api_key}}'
        - name: StreamNumber
          in: path
          required: true
          description: StreamNumber (integer) or StreamUd (UUID).
          schema:
            type: string
          example: '850'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - SurveyCompleteLink
                - SurveyTermLink
                - SecurityFraudTermLink
                - SurveyOverquotaLink
              properties:
                SurveyCompleteLink:
                  type: string
                  description: >-
                    Redirect after a complete. Use [%rid%] to pass back the
                    respondent ID.
                SurveyTermLink:
                  type: string
                  description: Redirect after a termination.
                SecurityFraudTermLink:
                  type: string
                  description: Redirect after a quality/security termination.
                SurveyOverquotaLink:
                  type: string
                  description: Redirect after an over-quota termination.
            example:
              SurveyCompleteLink: https://www.supplier.com?pid=8629795&rid=[%rid%]
              SurveyTermLink: http://www.supplierredirect.com/term?rid=[%rid%]
              SecurityFraudTermLink: http://www.supplierredirect.com/security?rid=[%rid%]
              SurveyOverquotaLink: http://www.supplierredirect.com/overquota?rid=[%rid%]
      responses:
        '200':
          description: Generated live and test entry links.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: integer
                    description: 0 indicates success.
                  Message:
                    type: string
                  Data:
                    type: object
                    properties:
                      LiveLinkUD:
                        type: string
                        format: uuid
                      LiveLinkURL:
                        type: string
                      TestLinkUD:
                        type: string
                        format: uuid
                      TestLinkURL:
                        type: string
              example:
                Status: 0
                Message: Success
                Data:
                  LiveLinkUD: d026d369-b370-4ffa-8177-c75cf46026f7
                  LiveLinkURL: >-
                    https://www-staging.researchdesk.com/landing2?fttsn=d026d369-b370-4ffa-8177-c75cf46026f7&rid=[%RID%]
                  TestLinkUD: c4648ac7-9cff-4702-acab-bb244aef78ae
                  TestLinkURL: >-
                    https://www-staging.researchdesk.com/landing2?fttsn=c4648ac7-9cff-4702-acab-bb244aef78ae&rid=[%RID%]

````