openapi: 3.1.0
info:
  title: Brand API - Tracking Links
  description: API for programmatically generating tracking links for your partners.
  version: v12
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Programs/{ProgramId}/TrackingLinks:
    post:
      summary: Generate a Tracking Link
      description: Creates a new tracking link for a specified media partner within a given program.
      operationId: generateTrackingLink
      tags:
      - Tracking Links
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ProgramId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the program (campaign).
      - name: MediaPartnerId
        in: query
        required: true
        schema:
          type: integer
        description: The unique identifier for the media partner who will be assigned the tracking link.
      requestBody:
        description: The properties of the tracking link to be generated.
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                Type:
                  type: string
                  enum:
                  - Regular
                  - Vanity
                  description: The type of tracking link to generate.
                CustomPath:
                  type: string
                  description: A custom path for the link, used when Type is 'Vanity'.
                  example: summer-sale
                AdId:
                  type: integer
                  description: The unique identifier for the ad to associate with this link.
                  example: 656565
                DeepLink:
                  type: string
                  format: uri
                  description: A specific URL to redirect the user to, overriding defaults.
                  example: https://www.acme.com/products/tennis-balls
                MediaPartnerPropertyId:
                  type: integer
                  description: The ID of the partner's specific media property where the link will be used.
                  example: 12345
      responses:
        '200':
          description: The tracking link was generated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  TrackingURL:
                    type: string
                    format: uri
                    description: The generated tracking link.
                    example: https://example.sjv.io/c/123456/98765/101010
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -L \
            --request POST \
            --url 'https://api.impact.com/Advertisers/{AccountSID}/Programs/{ProgramId}/TrackingLinks' \
            --user '{AccountSID}:{AuthToken}' \
            --header 'Content-Type: application/x-www-form-urlencoded' \
            --header 'Accept: */*'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your AccountSID as the username and AuthToken as the password.
x-default-client: cURL
