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

# Generate Survey Link

> Generate a test and live link for a specific survey.

## Generate Survey Link

Generate a link for a specific survey.

### Endpoint

```http theme={null}
POST /surveys/{surveyNumber}/link
```

### Headers

```json theme={null}
{
  "publisher-authentication-key": "your_project_secret_key"
}
```

> **Note:** The `publisher-authentication-key` header corresponds to your **Secret Key**. The `authorizationKey` in the request body corresponds to your **Web API Key**.

### Request Body

```json theme={null}
{
  "authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"
}
```

### Response

```json theme={null}
{
  "testLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx",
  "liveLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx"
}
```

### Error Response

```json theme={null}
{
  "message": "internal server error",
  "code": 500,
  "success": false
}
```


## OpenAPI

````yaml POST /surveys/{surveyNumber}/link
openapi: 3.0.0
info:
  title: Mirats Quanto Publisher API
  description: API documentation for Mirats Quanto Publisher services
  version: 1.0.0
servers:
  - url: https://api.publisher.miratsquanto.com/api/v1/publisher
    description: Publisher API Base URL
security:
  - publisher-authentication-key: []
paths:
  /surveys/{surveyNumber}/link:
    post:
      tags:
        - Surveys
      summary: Generate Survey Link
      description: Generate a test and live link for a specific survey.
      operationId: generateSurveyLink
      parameters:
        - name: surveyNumber
          in: path
          required: true
          schema:
            type: integer
            example: 17633744316785364
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationRequest'
      responses:
        '200':
          description: Successful response with generated links
          content:
            application/json:
              schema:
                type: object
                properties:
                  testLink:
                    type: string
                    format: uri
                    example: >-
                      https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx
                  liveLink:
                    type: string
                    format: uri
                    example: >-
                      https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx
                required:
                  - testLink
                  - liveLink
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AuthorizationRequest:
      type: object
      description: >-
        Payload for endpoints that only require the Web API Key in the request
        body.
      properties:
        authorizationKey:
          type: string
          description: Web API Key obtained from the Mirats Publisher Platform.
          example: DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU
      required:
        - authorizationKey
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          example: internal server error
        code:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
      required:
        - message
        - code
        - success
  securitySchemes:
    publisher-authentication-key:
      type: apiKey
      in: header
      name: publisher-authentication-key
      description: >-
        Send your Secret Key using the `publisher-authentication-key` header.
        This header is required for every request.

````