openapi: 3.0.3
info:
  title: 'Direct Result API'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://api.direct-result.be'
paths:
  /v1/campaigns:
    get:
      summary: 'Returns a page of campaigns.'
      operationId: returnsAPageOfCampaigns
      description: ''
      parameters:
        -
          in: query
          name: count
          description: 'The page size (between 1 and 100).'
          example: 25
          required: true
          schema:
            type: integer
            description: 'The page size (between 1 and 100).'
            example: 25
        -
          in: query
          name: page
          description: 'The current page.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page.'
            example: 1
        -
          in: header
          name: X-Api-Key
          description: ''
          example: '{YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 92
                      name: 'Duis Dictum'
                      active: true
                      phone_number: '+32809204909'
                      enable_emergency_signature: true
                      enable_calling: true
                      enable_sms_verification: true
                  per_page: 100
                  current: 1
                  next: null
                  previous: null
                  total: 1
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 92
                        name: 'Duis Dictum'
                        active: true
                        phone_number: '+32809204909'
                        enable_emergency_signature: true
                        enable_calling: true
                        enable_sms_verification: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 92
                        name:
                          type: string
                          example: 'Duis Dictum'
                        active:
                          type: boolean
                          example: true
                        phone_number:
                          type: string
                          example: '+32809204909'
                        enable_emergency_signature:
                          type: boolean
                          example: true
                        enable_calling:
                          type: boolean
                          example: true
                        enable_sms_verification:
                          type: boolean
                          example: true
                  per_page:
                    type: integer
                    example: 100
                  current:
                    type: integer
                    example: 1
                  next:
                    type: string
                    example: null
                  previous:
                    type: string
                    example: null
                  total:
                    type: integer
                    example: 1
      tags:
        - Endpoints
  /v1/subscriptions:
    get:
      summary: 'Returns a page of subscriptions.'
      operationId: returnsAPageOfSubscriptions
      description: '<p>(Note: you will only be able to see the subscriptions that were enrolled within the past month)</p>'
      parameters:
        -
          in: query
          name: attributes
          description: 'Include the attribute metadata (subscription metadata values are always shown)'
          example: true
          required: false
          schema:
            type: boolean
            description: 'Include the attribute metadata (subscription metadata values are always shown)'
            example: true
        -
          in: query
          name: campaign
          description: 'The specific campaign ID to filter by.'
          example: 32
          required: false
          schema:
            type: integer
            description: 'The specific campaign ID to filter by.'
            example: 32
        -
          in: query
          name: status
          description: 'The specific status to filter by.'
          example: completed
          required: false
          schema:
            type: string
            description: 'The specific status to filter by.'
            example: completed
        -
          in: query
          name: before
          description: 'Filters all entries before this date'
          example: '1970-01-01'
          required: false
          schema:
            type: date
            description: 'Filters all entries before this date'
            example: '1970-01-01'
        -
          in: query
          name: after
          description: 'Filters all entries after this date'
          example: '1970-01-01'
          required: false
          schema:
            type: date
            description: 'Filters all entries after this date'
            example: '1970-01-01'
        -
          in: query
          name: count
          description: 'The page size (between 1 and 100).'
          example: 25
          required: true
          schema:
            type: integer
            description: 'The page size (between 1 and 100).'
            example: 25
        -
          in: query
          name: page
          description: 'The current page.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page.'
            example: 1
        -
          in: header
          name: X-Api-Key
          description: ''
          example: '{YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 473774
                      status: completed
                      amount: 1200
                      iban: BE47549454364380
                      datetime_of_registration: '2020-01-01T00:00:00+01:00'
                      datetime_of_cancelation: '2020-01-01T00:00:00+01:00'
                      start_date: '2020-01-01T00:00:00+01:00'
                      payment_interval: '0 years 1 mons 0 days 0 hours 0 mins 0.0 secs'
                      payment_interval_clean: MONTHLY
                      product_id: 42
                      client_ref_code: ''
                      source: sms
                      creditation: false
                      cancel_payment_recruiter: false
                      purged: false
                      first_payment_amount: 0
                      purchase_id: ''
                      transaction_id: ''
                      used_first_pay: false
                      is_structural: true
                      is_onetimer: false
                      is_cancellation: false
                      subscriber:
                        id: 495301
                        first_name: Shay
                        middle_name: ''
                        last_name: Marta
                        gender: female
                        date_of_birth: '1980-01-01T00:00:00+01:00'
                        mobile: '+32585834200'
                        email: shaymarta@localhost.com
                        street: 'Generaal Dossin de Saint Georgeslaan'
                        house_number: 13
                        house_number_suffix: ''
                        city: Brussels
                        country: BE
                        initials: ''
                        landline: ''
                        zip_code: '1050'
                        bic: BELLKM
                        spoken_language: FR
                      recruiter:
                        code: '132406'
                        name: Richard
                      welcome_call:
                        status: confirmed
                        call_date: '2020-01-01'
                      metadata:
                        values:
                          foo:
                            - Particulier
                        attributes:
                          foo:
                            slug: foo
                            choices:
                              - Particulier
                              - Societe
                            type: choice
                            metadata:
                              Societe:
                                label: Sociéte
                              Particulier:
                                label: Particulier
                            label: 'Je suis'
                            value_type: text
                            required: true
                      campaign:
                        id: 92
                        name: 'Duis Dictum'
                        active: true
                        phone_number: '+32809204909'
                        enable_emergency_signature: true
                        enable_calling: true
                        enable_sms_verification: true
                  per_page: 1
                  current: 1
                  next: 2
                  previous: null
                  total: 576
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 473774
                        status: completed
                        amount: 1200
                        iban: BE47549454364380
                        datetime_of_registration: '2020-01-01T00:00:00+01:00'
                        datetime_of_cancelation: '2020-01-01T00:00:00+01:00'
                        start_date: '2020-01-01T00:00:00+01:00'
                        payment_interval: '0 years 1 mons 0 days 0 hours 0 mins 0.0 secs'
                        payment_interval_clean: MONTHLY
                        product_id: 42
                        client_ref_code: ''
                        source: sms
                        creditation: false
                        cancel_payment_recruiter: false
                        purged: false
                        first_payment_amount: 0
                        purchase_id: ''
                        transaction_id: ''
                        used_first_pay: false
                        is_structural: true
                        is_onetimer: false
                        is_cancellation: false
                        subscriber:
                          id: 495301
                          first_name: Shay
                          middle_name: ''
                          last_name: Marta
                          gender: female
                          date_of_birth: '1980-01-01T00:00:00+01:00'
                          mobile: '+32585834200'
                          email: shaymarta@localhost.com
                          street: 'Generaal Dossin de Saint Georgeslaan'
                          house_number: 13
                          house_number_suffix: ''
                          city: Brussels
                          country: BE
                          initials: ''
                          landline: ''
                          zip_code: '1050'
                          bic: BELLKM
                          spoken_language: FR
                        recruiter:
                          code: '132406'
                          name: Richard
                        welcome_call:
                          status: confirmed
                          call_date: '2020-01-01'
                        metadata:
                          values:
                            foo:
                              - Particulier
                          attributes:
                            foo:
                              slug: foo
                              choices:
                                - Particulier
                                - Societe
                              type: choice
                              metadata:
                                Societe:
                                  label: Sociéte
                                Particulier:
                                  label: Particulier
                              label: 'Je suis'
                              value_type: text
                              required: true
                        campaign:
                          id: 92
                          name: 'Duis Dictum'
                          active: true
                          phone_number: '+32809204909'
                          enable_emergency_signature: true
                          enable_calling: true
                          enable_sms_verification: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 473774
                        status:
                          type: string
                          example: completed
                        amount:
                          type: integer
                          example: 1200
                        iban:
                          type: string
                          example: BE47549454364380
                        datetime_of_registration:
                          type: string
                          example: '2020-01-01T00:00:00+01:00'
                        datetime_of_cancelation:
                          type: string
                          example: '2020-01-01T00:00:00+01:00'
                        start_date:
                          type: string
                          example: '2020-01-01T00:00:00+01:00'
                        payment_interval:
                          type: string
                          example: '0 years 1 mons 0 days 0 hours 0 mins 0.0 secs'
                        payment_interval_clean:
                          type: string
                          example: MONTHLY
                        product_id:
                          type: integer
                          example: 42
                        client_ref_code:
                          type: string
                          example: ''
                        source:
                          type: string
                          example: sms
                        creditation:
                          type: boolean
                          example: false
                        cancel_payment_recruiter:
                          type: boolean
                          example: false
                        purged:
                          type: boolean
                          example: false
                        first_payment_amount:
                          type: integer
                          example: 0
                        purchase_id:
                          type: string
                          example: ''
                        transaction_id:
                          type: string
                          example: ''
                        used_first_pay:
                          type: boolean
                          example: false
                        is_structural:
                          type: boolean
                          example: true
                        is_onetimer:
                          type: boolean
                          example: false
                        is_cancellation:
                          type: boolean
                          example: false
                        subscriber:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 495301
                            first_name:
                              type: string
                              example: Shay
                            middle_name:
                              type: string
                              example: ''
                            last_name:
                              type: string
                              example: Marta
                            gender:
                              type: string
                              example: female
                            date_of_birth:
                              type: string
                              example: '1980-01-01T00:00:00+01:00'
                            mobile:
                              type: string
                              example: '+32585834200'
                            email:
                              type: string
                              example: shaymarta@localhost.com
                            street:
                              type: string
                              example: 'Generaal Dossin de Saint Georgeslaan'
                            house_number:
                              type: integer
                              example: 13
                            house_number_suffix:
                              type: string
                              example: ''
                            city:
                              type: string
                              example: Brussels
                            country:
                              type: string
                              example: BE
                            initials:
                              type: string
                              example: ''
                            landline:
                              type: string
                              example: ''
                            zip_code:
                              type: string
                              example: '1050'
                            bic:
                              type: string
                              example: BELLKM
                            spoken_language:
                              type: string
                              example: FR
                        recruiter:
                          type: object
                          properties:
                            code:
                              type: string
                              example: '132406'
                            name:
                              type: string
                              example: Richard
                        welcome_call:
                          type: object
                          properties:
                            status:
                              type: string
                              example: confirmed
                            call_date:
                              type: string
                              example: '2020-01-01'
                        metadata:
                          type: object
                          properties:
                            values:
                              type: object
                              properties:
                                foo:
                                  type: array
                                  example:
                                    - Particulier
                                  items:
                                    type: string
                            attributes:
                              type: object
                              properties:
                                foo:
                                  type: object
                                  properties:
                                    slug:
                                      type: string
                                      example: foo
                                    choices:
                                      type: array
                                      example: [Particulier, Societe]
                                      items: { type: string }
                                    type:
                                      type: string
                                      example: choice
                                    metadata:
                                      type: object
                                      properties: { Societe: { type: object, properties: { label: { type: string, example: Sociéte } } }, Particulier: { type: object, properties: { label: { type: string, example: Particulier } } } }
                                    label:
                                      type: string
                                      example: 'Je suis'
                                    value_type:
                                      type: string
                                      example: text
                                    required:
                                      type: boolean
                                      example: true
                        campaign:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 92
                            name:
                              type: string
                              example: 'Duis Dictum'
                            active:
                              type: boolean
                              example: true
                            phone_number:
                              type: string
                              example: '+32809204909'
                            enable_emergency_signature:
                              type: boolean
                              example: true
                            enable_calling:
                              type: boolean
                              example: true
                            enable_sms_verification:
                              type: boolean
                              example: true
                  per_page:
                    type: integer
                    example: 1
                  current:
                    type: integer
                    example: 1
                  next:
                    type: integer
                    example: 2
                  previous:
                    type: string
                    example: null
                  total:
                    type: integer
                    example: 576
      tags:
        - Endpoints
  /v1/subscriptions/complete:
    post:
      summary: 'Marks one or multiple subscriptions for completion.'
      operationId: marksOneOrMultipleSubscriptionsForCompletion
      description: '<p>(Note: you can only mark subscriptions that were enrolled within the past month)</p>'
      parameters:
        -
          in: header
          name: X-Api-Key
          description: ''
          example: '{YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        204:
          description: ''
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subscriptions:
                  type: array
                  description: 'A list of subscription IDs.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: integer
              required:
                - subscriptions
tags:
  -
    name: Endpoints
    description: ''
components:
  securitySchemes:
    default:
      type: apiKey
      name: X-Api-Key
      in: header
      description: ''
security:
  -
    default: []
