openapi: 3.1.0
info:
  title: Brand API - Clicks
  description: 'API for retrieving click data and exporting daily click reports.

    Clicks represent referral events from a partner''s property to a brand''s property.'
  version: v12
servers:
- url: https://api.impact.com
paths:
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Clicks/{ClickId}:
    get:
      summary: Retrieve a Click
      description: 'Retrieves the details of a click or a series of clicks associated
        with a consumer journey.

        A single `ClickId` can be associated with multiple click events.'
      operationId: getClickById
      tags:
      - Clicks
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
        description: The ID of the program (campaign) associated with the click.
      - name: ClickId
        in: path
        required: true
        schema:
          type: string
        description: The generated `ClickId` (or `irclickid`) representing the consumer
          journey.
      responses:
        '200':
          description: A click object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Click'
  /Advertisers/{AccountSID}/Programs/{ProgramId}/ClickExport:
    get:
      summary: Export Clicks
      description: 'Schedules a job to asynchronously export clicks for a given program
        and date.

        Returns job status and download URIs.'
      operationId: exportClicks
      tags:
      - Clicks
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: ProgramId
        in: path
        required: true
        schema:
          type: integer
        description: The ID of the program (campaign) to export clicks from.
      - name: AdId
        in: query
        schema:
          type: array
          items:
            type: integer
        description: Filter clicks by the ID of the ad that was clicked. Can be repeated.
      - name: Date
        in: query
        schema:
          type: string
          format: date
        description: The date for which to export clicks (yyyy-MM-dd). Defaults to
          today.
      - name: MediaId
        in: query
        schema:
          type: array
          items:
            type: integer
        description: Filter clicks by the Partner ID. Can be repeated.
      - name: UniqueClick
        in: query
        schema:
          type: boolean
        description: Filter for clicks that follow IAB standards for a "unique click".
      - name: ResultFormat
        in: query
        schema:
          type: string
          enum:
          - CSV
          - XML
          - JSON
          default: CSV
        description: The desired format for the exported file.
      responses:
        '200':
          description: The job has been successfully queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: QUEUED
                  QueuedUri:
                    type: string
                    format: uri-reference
                    example: /Advertisers/<AccountSID>/Jobs/d8807a9f-a5ee-4e3f-ad2b-3dfd19d1915f
                  ResultUri:
                    type: string
                    format: uri-reference
                    example: /Advertisers/<AccountSID>/Jobs/d8807a9f-a5ee-4e3f-ad2b-3dfd19d1915f/Download
                  ReplayUri:
                    type: string
                    format: uri-reference
                    example: /Advertisers/<AccountSID>/Jobs/d8807a9f-a5ee-4e3f-ad2b-3dfd19d1915f/Replay
components:
  schemas:
    Click:
      type: object
      properties:
        Id:
          type: string
          description: Generated value representing the consumer journey (ClickId/irclickid).
          example: abcdefg1hijkl2mn3opq4rStUvwxyz5a6bcdef7
        CampaignId:
          type: integer
          description: Program (campaign) Id associated with the click.
          example: '1000'
        CampaignName:
          type: string
          description: Program (campaign) name associated with the click.
          example: Acme Campaign
        ProfileId:
          type: string
          description: impact.com's unique identifier for a user on a specific device.
          example: ab12345c-6789-0123-4de5-678f90g123h4
        IpAddress:
          type: string
          description: Hashed IP address that the click was sourced from.
          example: abcdefghijklmnopqrstuvwxyz1234567890
        EventDate:
          type: string
          format: date-time
          description: Date and time this click happened.
          example: '2021-01-25T08:06:24-05:00'
        MediaId:
          type: integer
          description: Partner Id that drove the click.
          example: '10000'
        MediaName:
          type: string
          description: Partner name that drove the click.
          example: Partner Person
        AdId:
          type: integer
          description: Id of the ad that was clicked.
          example: '656565'
        AdName:
          type: string
          description: Name of the ad that was clicked.
          example: Our Anvils Are Awesome
        AdType:
          type: string
          enum:
          - BANNER
          - EMAIL
          - FLASH
          - TEXT
          - TEXT_LINK
          - LONG_SPONSORED_TEXT
          - XML_SYNDICATION
          - COUPON
          - CONTENT
          - VIDEO
          - ONLINE_TRACKING_LINK
          - MEDIA_SOURCE_TRACKING
          example: BANNER
          description: Type of the ad that was clicked.
        ProductSku:
          type: string
          description: SKU of the item the ad is marketing.
          example: '12345'
        BrandRelated:
          type: object
          properties:
            AdCampaign:
              type: string
              example: Summer Sale
            AdGroup:
              type: string
              example: Tennis Equipment
            Keyword:
              type: string
              example: tennis balls
            MatchType:
              type: string
              example: BROAD
            Channel:
              type: string
              example: GOOGLE_SHOPPING
          description: Your brand's information that is related to the click event.
        CustomerArea:
          type: string
          example: n/a
          description: Generated from the IpAddress attribute, this is the geographical
            area from where the customer generated the click. If IpAddress was not
            tracked, n/a will appear.
        CustomerCity:
          type: string
          example: n/a
          description: Generated from the IpAddress attribute, this is the city from
            where the customer generated the click. If IpAddress was not tracked,
            n/a will appear.
        CustomerRegion:
          type: string
          example: n/a
          description: Generated from the IpAddress attribute, this is the geographical
            region from where the customer generated the click. If IpAddress was not
            tracked, n/a will appear.
        CustomerCountry:
          type: string
          example: US
          description: Generated from the IpAddress attribute, this is the country
            from where the customer generated the click. If IpAddress was not tracked,
            n/a will appear. See ISO 3166-1 alpha-2 .
        DeviceType:
          type: string
          enum:
          - DESKTOP
          - PHONE
          - TABLET
          - GAME
          - WATCH
          - TV
          - ROBOT
          - CAR
          - UNKNOWN
          example: UNKNOWN
          description: What device the customer clicked or tapped the ad on.
        DeviceFamily:
          type: string
          example: 'null'
          description: General group of devices that the attribute DeviceType comes
            from. Only a sample of all enum values are presented below.
        Browser:
          type: string
          example: 'null'
          description: Which web browser the customer used when they generated the
            click. Only a sample of all enum values are presented below.
        Os:
          type: string
          example: 'null'
          description: Which operating system the customer used when they generated
            the click. Only a sample of all enum values are presented below.
        ReferringUrl:
          type: string
          format: uri
          description: The URL that the customer came from when they generated the
            click.
          example: https://www.google.com/
        ReferringDomain:
          type: string
          example: NA
          description: The web domain that the customer came from when they generated
            the click.
        LandingPageUrl:
          type: string
          format: uri
          example: http://google.com?irgwc=1
          description: The URL the customer landed on when they generated the click.
        SharedId:
          type: string
          description: A SharedId that is passed on the tracking link the partner
            used.
        UniqueClick:
          type: boolean
          example: 'true'
          description: If the click follows IAB standards for a "unique click."
        CpcBid:
          type: string
          example: '0.0'
          description: How much the partner will be paid for driving the click.
        DealName:
          type: string
          description: Name of the associated deal.
        DealType:
          type: string
          enum:
          - BOGO
          - FREE_SHIPPING
          - GENERAL_SALE
          - GIFT_WITH_PURCHASE
          - REBATE
          description: Type of the associated deal.
        DealScope:
          type: string
          enum:
          - CATEGORY
          - ENTIRE_STORE
          - PRODUCT
          description: To what extent the deal applies to the click.
        PartnerRelated:
          type: object
          properties:
            SubId1:
              type: string
              example: subid1value
            SubId2:
              type: string
              example: subid2value
            SubId3:
              type: string
              example: subid3value
          description: A partner's information that is related to the click event.
        Payout:
          type: number
          format: decimal
          description: Partner's payout for driving the click.
          example: 5.00
        TrafficCategory:
          type: string
          description: What kind of traffic is generating the click.
          example: AFFILIATE
        TrafficSource:
          type: string
          description: Referring site (aka Source ) of the traffic generating the
            click.
          example: CONTENT
        BidKeyword:
          type: string
          description: If the click was generated from a Paid Search, then this will
            be the keyword used in that Paid search.
          example: tennis balls
        SearchText:
          type: string
          description: If the click was generated from a Paid Search, then this will
            be the search query the customer put into a search engine.
          example: best tennis balls
