openapi: 3.0.3
info:
  title: Everflow Network API - Tracking Links
  description: >
    Endpoints for generating tracking links for offers and affiliates.
    For tracking concepts and setup, see the [Tracking guide](https://helpdesk.everflow.io/customer/introduction-to-tracking-with-everflow).
  version: 1.0.0
servers:
  - url: https://api.eflow.team/v1
tags:
  - name: Tracking Links
paths:
  /networks/tracking/offers/clicks:
    post:
      summary: Generate Tracking Link
      tags:
        - Tracking Links
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_id: 6
              network_affiliate_id: 7
            schema:
              type: object
              required:
                - network_offer_id
                - network_affiliate_id
              properties:
                network_offer_id:
                  type: integer
                  description: The ID of the offer.
                network_affiliate_id:
                  type: integer
                  description: The ID of the affiliate.
                network_tracking_domain_id:
                  type: integer
                  description: An optional ID for a specific tracking domain that should be used to generate the link.
                network_offer_url_id:
                  type: integer
                  description: An optional offer URL ID. If specified, the offer URL ID must belong to the network_offer_id specified (and must exist).
                creative_id:
                  type: integer
                  description: An optional offer creative ID. If specified, the creative must belong to the network_offer_id specified (and must exist).
                network_traffic_source_id:
                  type: integer
                  description: An optional traffic source ID. If a traffic source is associated with the affiliate, this parameter will be ignored and the default traffic source will be used instead.
                source_id:
                  type: string
                  description: An optional source_id that should be used as a query string parameter on the tracking link.
                sub1:
                  type: string
                  description: An optional sub1 that should be used as a query string parameter on the tracking link.
                sub2:
                  type: string
                  description: An optional sub2 that should be used as a query string parameter on the tracking link.
                sub3:
                  type: string
                  description: An optional sub3 that should be used as a query string parameter on the tracking link.
                sub4:
                  type: string
                  description: An optional sub4 that should be used as a query string parameter on the tracking link.
                sub5:
                  type: string
                  description: An optional sub5 that should be used as a query string parameter on the tracking link.
                sub6:
                  type: string
                  description: An optional sub6 that should be used as a query string parameter on the tracking link.
                sub7:
                  type: string
                  description: An optional sub7 that should be used as a query string parameter on the tracking link.
                sub8:
                  type: string
                  description: An optional sub8 that should be used as a query string parameter on the tracking link.
                sub9:
                  type: string
                  description: An optional sub9 that should be used as a query string parameter on the tracking link.
                sub10:
                  type: string
                  description: An optional sub10 that should be used as a query string parameter on the tracking link.
                is_encrypt_parameters:
                  type: boolean
                  description: When enabled, will encrypt all query string parameters into a single one.
                is_redirect_link:
                  type: boolean
                  description: Only relevant for direct linking offers. Can be used to override the default setting of the offer and generate a redirect link even on a direct linking offer.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The generated tracking link URL.
      security:
        - API Key: []
  /networks/tracking/offers/clicks/qr:
    post:
      summary: Generate Offer Tracking Link QR Code
      tags:
        - Tracking Links
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_id: 1
              network_affiliate_id: 1
            schema:
              type: object
              required:
                - network_offer_id
                - network_affiliate_id
              properties:
                network_offer_id:
                  type: integer
                  description: The ID of the offer.
                network_affiliate_id:
                  type: integer
                  description: The ID of the affiliate.
                network_tracking_domain_id:
                  type: integer
                  description: An optional ID for a specific tracking domain.
                network_offer_url_id:
                  type: integer
                  description: An optional offer URL ID.
                creative_id:
                  type: integer
                  description: An optional offer creative ID.
                network_traffic_source_id:
                  type: integer
                  description: An optional traffic source ID.
                source_id:
                  type: string
                  description: An optional source_id query string parameter.
                sub1:
                  type: string
                sub2:
                  type: string
                sub3:
                  type: string
                sub4:
                  type: string
                sub5:
                  type: string
                sub6:
                  type: string
                sub7:
                  type: string
                sub8:
                  type: string
                sub9:
                  type: string
                sub10:
                  type: string
                is_encrypt_parameters:
                  type: boolean
                  description: Whether to encrypt all query string parameters.
                is_redirect_link:
                  type: boolean
                  description: Override the direct linking setting.
      responses:
        "200":
          description: OK — returns a PNG image file.
          content:
            image/png:
              schema:
                type: string
                format: binary
      security:
        - API Key: []
  /networks/tracking/campaigns/clicks:
    post:
      summary: Generate Smart Link Tracking Link
      tags:
        - Tracking Links
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_campaign_id: 1
              network_affiliate_id: 7
            schema:
              type: object
              required:
                - network_campaign_id
                - network_affiliate_id
              properties:
                network_campaign_id:
                  type: integer
                  description: The ID of the smartlink.
                network_affiliate_id:
                  type: integer
                  description: The ID of the affiliate.
                network_traffic_source_id:
                  type: integer
                  description: An optional traffic source ID. If a traffic source is associated with the affiliate, this parameter will be ignored.
                network_tracking_domain_id:
                  type: integer
                  description: An optional ID for a specific tracking domain.
                source_id:
                  type: string
                  description: An optional source_id query string parameter.
                sub1:
                  type: string
                  description: An optional sub1 query string parameter.
                sub2:
                  type: string
                  description: An optional sub2 query string parameter.
                sub3:
                  type: string
                  description: An optional sub3 query string parameter.
                sub4:
                  type: string
                  description: An optional sub4 query string parameter.
                sub5:
                  type: string
                  description: An optional sub5 query string parameter.
                sub6:
                  type: string
                  description: An optional sub6 query string parameter.
                sub7:
                  type: string
                  description: An optional sub7 query string parameter.
                sub8:
                  type: string
                  description: An optional sub8 query string parameter.
                sub9:
                  type: string
                  description: An optional sub9 query string parameter.
                sub10:
                  type: string
                  description: An optional sub10 query string parameter.
                is_encrypt_parameters:
                  type: boolean
                  description: When enabled, will encrypt all query string parameters into a single one.
                is_redirect_link:
                  type: boolean
                  description: Only relevant for direct linking offers. Can override the default setting.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The generated tracking link URL.
                  can_affiliate_run_all_offers:
                    type: boolean
                    description: Whether the affiliate can run all offers in the smart link.
      security:
        - API Key: []
  /networks/tracking/campaigns/clicks/qr:
    post:
      summary: Generate Smart Link Tracking Link QR Code
      tags:
        - Tracking Links
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_campaign_id: 1
              network_affiliate_id: 1
            schema:
              type: object
              required:
                - network_campaign_id
                - network_affiliate_id
              properties:
                network_campaign_id:
                  type: integer
                  description: The ID of the smartlink.
                network_affiliate_id:
                  type: integer
                  description: The ID of the affiliate.
                network_traffic_source_id:
                  type: integer
                  description: An optional traffic source ID.
                network_tracking_domain_id:
                  type: integer
                  description: An optional ID for a specific tracking domain.
                source_id:
                  type: string
                  description: An optional source_id query string parameter.
                sub1:
                  type: string
                sub2:
                  type: string
                sub3:
                  type: string
                sub4:
                  type: string
                sub5:
                  type: string
                sub6:
                  type: string
                sub7:
                  type: string
                sub8:
                  type: string
                sub9:
                  type: string
                sub10:
                  type: string
                is_encrypt_parameters:
                  type: boolean
                  description: Whether to encrypt all query string parameters.
                is_redirect_link:
                  type: boolean
                  description: Override the direct linking setting.
      responses:
        "200":
          description: OK — returns a PNG image file.
          content:
            image/png:
              schema:
                type: string
                format: binary
      security:
        - API Key: []
  /networks/offers/{offerId}/trackingdomain/{domainId}/url/{affiliateId}/{urlId}:
    get:
      summary: Generate Offer URL Tracking Link
      tags:
        - Tracking Links
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The ID of the offer.
        - in: path
          name: domainId
          required: true
          schema:
            type: integer
          description: The ID of the tracking domain.
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The ID of the affiliate.
        - in: path
          name: urlId
          required: true
          schema:
            type: integer
          description: >
            The ID of the offer URL. Use `0` to use the default offer URL.
        - in: query
          name: network_traffic_source_id
          required: false
          schema:
            type: integer
          description: >
            An optional traffic source ID. When provided, the traffic source
            parameters will be appended to the tracking URL.
        - in: query
          name: is_redirect_link
          required: false
          schema:
            type: boolean
          description: >
            Only relevant for direct linking offers. Can be used to override
            the default setting and generate a redirect link.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                url: "https://www.testtracking.com/26W72JGK/4P81Z17/?uid=1186"
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: >
                      The generated tracking URL. Includes a `uid` query
                      parameter referencing the offer URL ID.
      security:
        - API Key: []
components:
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
