openapi: 3.0.3
info:
  title: WebCare Configuration API
  description: 'WebCare Configuration API for automatic configuration of your WebCare instances.
  Also used for importing or exporting your configuration'
  version: 1.0.0
servers:
  - url: 'https://localhost:8080'
    description: Your mandants domain name (see WebCare API configuration section in your license)
paths:
  /webcare/v1/conf:
    get:
      summary: Get configuration for all webcare modules (banner, privacy, imprint, documents)
      operationId: getConf
      tags:
        - webcare
      parameters:
        - name: modules
          in: query
          description: Which modules to return (comma separated)
          required: false
          example: "syncprofile, settings_organization"
          schema:
            type: string
      responses:
        200:
          description: JSON Object containing the configuration
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebCareConfiguration"
            application/xml:
              schema:
                $ref: "#/components/schemas/WebCareConfiguration"
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebCareConfigurationError"
    post:
      summary: Set configuration for all webcare modules (banner, privacy, imprint, documents)
      operationId: setConf
      tags:
        - webcare
      requestBody:
        description: "The webcare configuration contents"
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebCareConfiguration'
          application/xml:
            schema:
              $ref: '#/components/schemas/WebCareConfiguration'
      responses:
        200:
          description: Result of the import operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebCareImportResult"
            application/xml:
              schema:
                $ref: "#/components/schemas/WebCareImportResult"
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebCareImportResult"
components:
  schemas:
    WebCareConfiguration:
      properties:
        version:
          type: integer
          format: int64
          description: WebCare API version
          example: 1
        consent:
          $ref: "#/components/schemas/WebCareConsentBanner"
        privacy:
          $ref: "#/components/schemas/WebCarePrivacy"
        imprint:
          $ref: "#/components/schemas/WebCareImprint"
        localization:
          $ref: "#/components/schemas/WebCareDocumentLocalization"
        publish:
          $ref: "#/components/schemas/WebCarePublishSettings"
        settings:
          $ref: "#/components/schemas/WebCareSettings"

    WebCareConsentBanner:
      properties:
        color:
          $ref: "#/components/schemas/WebCareConsentBannerColor"
        font:
          $ref: "#/components/schemas/WebCareConfigurationFonts"
        design:
          $ref: "#/components/schemas/WebCareConfigurationBannerDesign"
        text:
          $ref: "#/components/schemas/WebCareConfigurationBannerLocalization"
        tag:
          $ref: "#/components/schemas/WebCareConfigurationBannerTags"
        settings:
          $ref: "#/components/schemas/WebCareConfigurationBannerSetting"

    WebCareConsentBannerColor:
      properties:
        backgroundColor:
          type: string
          description: HTML Color value, background of the Banner
          example: "#112233"
        headlineTextColor:
          type: string
          description: HTML Color value, headline text color
          example: "#112233"
        textColor:
          type: string
          description: HTML Color value, standard text color
          example: "#112233"
        controlBackgroundColor:
          type: string
          description: HTML Color value, background of the cookie details
          example: "#112233"
        lightBackgroundColor:
          type: string
          description: HTML Color value, background of table headline in details
          example: "#112233"
        denyTextColor:
          type: string
          description: HTML Color value, text color of deny button
          example: "#112233"
        allowTextColor:
          type: string
          description: HTML Color value, text color of allow all button
          example: "#112233"
        allowBackgroundColor:
          type: string
          description: HTML Color value, background color of allow all button
          example: "#112233"
        revokeBackgroundColor:
          type: string
          description: HTML Color value, revoke popup background color
          example: "#112233"
        revokeTextColor:
          type: string
          description: HTML Color value, revoke popup text color
          example: "#112233"

    WebCareConfigurationFonts:
      properties:
        headline:
          $ref: "#/components/schemas/WebCareConfigurationFontFace"
        text:
          $ref: "#/components/schemas/WebCareConfigurationFontFace"
        consent:
          $ref: "#/components/schemas/WebCareConfigurationFontFace"
        category:
          $ref: "#/components/schemas/WebCareConfigurationFontFace"
        headlineStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        multilineTextStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        categoryTextStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        tableHeadlineStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        detailHeadlineStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        buttonDenyStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        buttonAllowStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        categoryCounterStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        onelineBannerStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"
        revokeStyle:
          $ref: "#/components/schemas/WebCareConfigurationFontStyle"

    WebCareConfigurationFontFace:
      properties:
        fontId:
          type: string
          description: WebCare Internal font id
          example: "dr:georgia"
        font:
          type: string
          description: HTML font-family css content (not needed when fontId is filled)
          example: "Helvetica, Calibri, Arial, sans-serif"

    WebCareConfigurationFontStyle:
      properties:
        size:
          type: string
          description: HTML css font-size property including unit
          example: "0.9em"
        weight:
          type: string
          description: HTML css font-weight property
          example: "bold"

    WebCareConfigurationBannerDesign:
      properties:
        display:
          type: string
          description: Banner display mode (can be detail, oneline or blocking)
          example: "blocking"
        bannerDesign:
          type: string
          description: Banner design to use (can be info, category, detail, consent-detail)
          example: "consent-detail"
        position:
          type: string
          description: Position of the banner and the revoke gui (can be top or bottom)
          example: "bottom"
        borderAllow:
          type: boolean
          description: Show border around the allow button
          example: true
        borderDeny:
          type: boolean
          description: Show border around the deny button
          example: false
        hideDataReporterLogo:
          type: boolean
          description: Hide the DataReporter logo in the banner (please say false here for good manners :-) )
          example: false
        revokeIcon:
          type: string
          description: Show a revoke icon instead of text (provide empty string if you want text) (can be cookie or shield)
          example: "shield"
        roundBorders:
          type: boolean
          description: Make edges rounded
          example: true
        shadow:
          type: boolean
          description: Show shadows on controls
          example: true
        contentAlign:
          type: string
          description: Aligns the content of the banner (can be empty, left, right or center)
          example: "left"
        reverseButtonOrder:
          type: boolean
          description: Reverses the button order of deny and allow. If true, allow comes first in ltr environment
          example: false
        scrollbar:
          type: boolean
          description: Show scrollbar in detail view (default is false)
          example: false

    WebCareConfigurationBannerLocalization:
      properties:
        removeOldLocalization:
          type: boolean
          description: If true, all the old texts will be deleted prior to importing the new text
          example: false
        texts:
          type: array
          items:
            $ref: '#/components/schemas/WebCareConfigurationBannerText'


    WebCareConfigurationBannerText:
      required:
        - iso
      properties:
        iso:
          type: string
          description: Iso code of the language
          example: "de"
        iso_description:
          type: string
          description: Name of Language in german
          example: "Deutsch"

        headline:
          type: string
          example: "Unsere Webseite nutzt Cookies"
        text:
          type: string
          example: "Weitere Informationen zu Cookies erhalten Sie"
        no_cookies_text:
          type: string
          example: "Wir benutzen keine derartigen Cookies."
        btn_allow:
          type: string
          example: "Alle Cookies erlauben"
        btn_deny:
          type: string
          example: "Nur erforderliche Cookies erlauben"
        btn_apply:
          type: string
          example: "Einstellungen übernehmen"
        headline_name:
          type: string
          example: "Name"
        headline_issuer:
          type: string
          example: "Ersteller"
        headline_purpose:
          type: string
          example: "Zweck"
        headline_domain:
          type: string
          example: "Domain"
        headline_valid:
          type: string
          example: "Speicherdauer"
        pre_headline:
          type: string
          example: "Willkommen"
        pre_description:
          type: string
          example: "Bitte wählen Sie Ihr Land"
        pre_btn_next:
          type: string
          example: "Weiter"
        pre_item_none:
          type: string
          example: "- Bitte auswählen -"
        btn_tech:
          type: string
          example: "Erforderlich"
        btn_statistic:
          type: string
          example: "Statistik"
        btn_marketing:
          type: string
          example: "Marketing"
        btn_unclassified:
          type: string
          example: "Unklassifiziert"
        btn_preferences:
          type: string
          example: "Einstellungen"
        btn_about:
          type: string
          example: "Über Cookies"
        text_tech:
          type: string
          example: "Technisch notwendige Cookies dienen dazu, um den"
        text_statistic:
          type: string
          example: "Statistik-Cookies sammeln Informationen darüber,"
        text_marketing:
          type: string
          example: "Marketing-Cookies stammen von externen Werbeunternehmen"
        text_unclassified:
          type: string
          example: "Nicht klassifizierte Cookies sind Cookies, dir wir noch keinem"
        text_preferences:
          type: string
          example: "Einstellungs-Cookies speichern Benutzereinstellungen"
        headline_about:
          type: string
          example: "Über Cookies"
        text_about:
          type: string
          example: "Cookies sind kleine Datenpakete, die zwischen Ihrem Browser"
        btn_policy:
          type: string
          example: "Einstellungen zu Cookies..."
        privacy_statement_linktext:
          type: string
          example: "zur Datenschutzerklärung..."
        cookiedetails_linktext:
          type: string
          example: "Details zu Cookies..."
        privacy_statement_link:
          type: string
          example: "https://www.datareporter.eu/privacy"
        btn_show_details:
          type: string
          example: "Details anzeigen"
        btn_show_details_table:
          type: string
          example: "Details anzeigen"
        cat_tech_reasons:
          type: string
          example: "stellt die Funktionsfähigkeit und Bedienbarkeit der Seite sicher"
        cat_session:
          type: string
          example: "zählt die Anzahl der Sitzung und weist jedem Besucher"
        cat_shop:
          type: string
          example: "dient zur temporären Speicherung des Warenkorbes"
        cat_cookiestate:
          type: string
          example: "enthält die Informationen, inwieweit der Nutzer"
        cat_internal:
          type: string
          example: "stellt die Funktionsfähigkeit, Bedienbarkeit und Anmeldung zu internen Tools wie CMS, interne Gateways und Portalen sicher."
        cat_preference:
          type: string
          example: "speichern Einstellungen und Vorlieben"
        cat_statistics:
          type: string
          example: "enthält  Informationen um die Unterscheidung von Nutzern"
        cat_marketing:
          type: string
          example: "registriert eine eindeutige ID, die den Nutzer"
        cat_custom_1:
          type: string
          example: "Eigener Zweck - Text"
        cat_custom_2:
          type: string
          example: "Eigener Zweck - Text"
        cat_custom_3:
          type: string
          example: "Eigener Zweck - Text"
        expiry_forever:
          type: string
          example: "Permanent"
        expiry_session:
          type: string
          example: "Sitzung"

    WebCareConfigurationBannerTags:
      properties:
        removeOldTags:
          type: boolean
          description: If true, all the old tags will be deleted prior to importing the new tag config
          example: false
        tags:
          type: array
          items:
            $ref: '#/components/schemas/WebCareConfigurationBannerTag'

    WebCareConfigurationBannerTag:
      properties:
        id:
          type: string
          description: "Unique ID when modifying an existing tag"
          example: "aBd"
        description:
          type: string
          description: Internal description of the tag
          example: "Demo Tag"
        activationMode:
          type: string
          description: "When should tag be activated (can be inactive, empty (on consent), always, reject)"
          example: "inactive"
        module:
          type: string
          description: "Type of module. Can be integration, html, google_analytics, google_tagmanager, fbpixel, linkedin."
          example: "html"
        code:
          type: string
          description: "HTML Code for the tag (when integration or html) - working copy"
          example: "script.../script"
        productiveCode:
          type: string
          description: "Same as code but is productive on site"
          example: "script.../script"
        tagKey:
          type: string
          description: "Integration key like Google Analytics ID"
          example: "GA-123456"
        category:
          type: string
          description: "Empty for tech, can also be statistic or marketing"
          example: "statistic"
        divId:
          type: string
          description: "Id of the div where integration tags are inserted"
          example: "dr_gmap"
        mode:
          type: string
          description: "Empty for separate loading or insert for insertion tags"
          example: "insert"
        serviceName:
          type: string
          description: "Name of the service of the insertion tag"
          example: "Google Maps"
        serviceProvider:
          type: string
          description: "Name of the provider of the insertion tag"
          example: "Google Inc."
        placeholderDesign:
          type: string
          description: "Design of the integration tag placeholder. Can be map, calendar, video, other or user"
          example: "map"

    WebCareConfigurationBannerSetting:
      properties:
        privacyLink:
          type: string
          description: "Default link to privacy page"
          example: "https://www.datareporter.eu/privacy"
        cmpConsentMode:
          type: string
          description: "Consent recording or statistic mode. Empty for no recording, stat or consent"
          example: "stat"
        cmpConsentVersion:
          type: integer
          description: "Channel for statistic recording (1-4)"
          example: 2
        autoAcceptCookies:
          type: string
          description: "Auto cookie accept mode - can be empty (show normally), deny, allow or noop for no function"
          example: "noop"
        revokePopup:
          type: string
          description: "Revoke popup mode. Can be empty (show), desktop (no hiding on desktop), hide"
          example: "desktop"
        revokeMobile:
          type: boolean
          description: "Show revoke popup on mobile devices"
          example: false
        animationDuration:
          type: string
          description: "Animation durations (0s for no duration)"
          example: "0s"
        deleteCookieMode:
          type: string
          description: "Auto - blocking of non-tech cookies. Can be auto, all or manual"
          example: "manual"
        cookieDomain:
          type: string
          description: "Domain for the consent cookies"
          example: "datareporter.eu"
        preCountrySelection:
          type: boolean
          description: "Is the pre country selection active?"
          example: true
        preCountryConfiguration:
          type: string
          description: "The JSON configuration for countries. See docs for more details"
          example: "[{key:...}]"
        topHtmlInsertion:
          type: string
          description: "HTML code for eg logos that will be inserted above the banner headline"
          example: "img src=...."

    WebCarePrivacy:
      properties:
        removeOldModuleStatus:
          type: boolean
          example: true
          description: "Reset all module show stati prior to importing"
        modules:
          type: array
          items:
            $ref: '#/components/schemas/WebCarePrivacyModule'
        useDefaultText:
          type: boolean
          example: false
          description: "True to use default text, false to use customer specific text"
        content:
          type: array
          items:
            $ref: '#/components/schemas/WebCareDocumentText'
        cookieStatementActive:
          type: boolean
          example: true
          description: "Will a cookie statement be generated"
        cookieStatementAboutText:
          type: boolean
          example: true
          description: "Should the cookie statement include the About Cookies header"
        cookieStatementBiggestHeadline:
          type: integer
          example: 3
          description: "The biggest HTML H element in the cookies statement (1 - 3)"
        tocActive:
          type: boolean
          example: true
          description: "Should a table of contents be generated"
        settings:
          $ref: '#/components/schemas/WebCareDocumentSetting'

    WebCarePrivacyModule:
      properties:
        moduleId:
          type: string
          example: "web_webcare"
          description: "Internal module id"
        show:
          type: string
          example: "auto"
          description: "Automatic discovery setting can be auto, never or always"

    WebCareImprint:
      properties:
        companyObject:
          type: string
          example: "IT and security"
          description: "Object of the company"
        commercialCourt:
          type: string
          example: "Linz, Austria"
          description: "Court location"
        chamber:
          type: string
          example: "Handelskammer"
          description: "Chamber or branch of the company"
        applicableLaw:
          type: string
          description: "Applicable law of the company"
          example: "Gewerbeordnung: https://www.ris.bka.gv.at"
        tradeAuthority:
          type: string
          example: "Zollamt Linz"
          description: "The trade authority for the organisation"
        jobTitle:
          type: string
          example: "Software Application Developer"
          description: "The job title for the company"
        responsibleForContent:
          type: string
          example: "Images copyright by ..."
          description: "Additional content responsible companies"
        useDefaultText:
          type: boolean
          example: false
          description: "True to use default text, false to use customer specific text"
        content:
          type: array
          items:
            $ref: '#/components/schemas/WebCareDocumentText'
        settings:
          $ref: '#/components/schemas/WebCareDocumentSetting'

    WebCareDocumentText:
      properties:
        languageIso:
          type: string
          example: "de"
          description: "Language ISO of the document text. Can only be de or en"
        textContent:
          type: string
          example: "= Privacy statement = ..."
          description: "Document content in XWiki syntax"

    WebCareDocumentSetting:
      properties:
        biggestHeadline:
          type: integer
          example: 2
          description: "The biggest allowed HTML H element in the document (1 - 3)"
        cssStyle:
          type: string
          example: "all"
          description: "CSS style for document - can be empty (from Website), all (headlines, tables,...) or tables (only tables and lists)"

    WebCareDocumentLocalization:
      properties:
        notificationType:
          type: string
          example: "week"
          description: "Notification of changes interval - can be empty (never), always, week, month"
        notificationEmail:
          type: string
          example: "office@datareporter.eu"
          description: "E-Mail address that will be notified of changes"
        configuration:
          type: array
          items:
            $ref: '#/components/schemas/WebCareDocumentLocalizationConfiguration'
        content:
          type: array
          items:
            $ref: '#/components/schemas/WebCareDocumentLocalizationContent'

    WebCareDocumentLocalizationConfiguration:
      properties:
        languageIso:
          type: string
          example: "en"
          description: "Localization containing language ISO"
        countryIso:
          type: string
          example: "us"
          description: "Localization containing country ISO (optional)"
        editable:
          type: boolean
          example: false
          description: "Only available for de or en to activate workflow"
        documents:
          type: string
          example: "privacy,imprint"
          description: "Which documents are localized? Can be consent, privacy or imprint"

    WebCareDocumentLocalizationContent:
      properties:
        languageIso:
          type: string
          example: "en"
          description: "Localization containing language ISO"
        countryIso:
            type: string
            example: "us"
            description: "Localization containing country ISO (optional)"
        document:
          type: string
          example: "privacy"
          description: "Document type of the content - can be privacy or imprint"
        htmlContent:
          type: string
          example: "h1 Test me /h1"
          description: "HTML Content of the localized document"

    WebCarePublishSettings:
      properties:
        autoPublish:
          type: boolean
          example: false
          description: "Activates auto publishing when changes are detected"

    WebCareSettings:
      properties:
        organization:
          $ref: '#/components/schemas/WebCareSettingsOrganisation'
        autoCrawler:
          type: boolean
          example: false
          description: "Activates auto crawling"
        integrationConsentActive:
          type: boolean
          example: false
          description: "Activates integration documentation for consent banner"
        integrationPrivacyActive:
          type: boolean
          example: false
          description: "Activates integration documentation for privacy statement"
        integrationImprintActive:
          type: boolean
          example: false
          description: "Activates integration documentation for imprint"
        domains:
          type: array
          items:
            $ref: '#/components/schemas/WebCareSettingsDomain'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/WebCareSettingsRole'
        api:
          $ref: '#/components/schemas/WebCareSettingsApi'


    WebCareSettingsDomain:
      properties:
        domain:
          type: string
          example: "https://www.datareporter.eu"
          description: "Domain of the license"

    WebCareSettingsOrganisation:
      properties:
        name:
          type: string
          example: "Test Organisation"
          description: "Name of the organisation"
        name2:
          type: string
          example: "Austrian Branch"
          description: "Additional name of the organisation"
        street:
          type: string
          example: "Teststreet 1"
          description: "Street address of the organisation"
        zip:
          type: string
          example: "4600"
          description: "ZIP code of the organisation"
        city:
          type: string
          example: "Wels"
          description: "City address of the organisation"
        countryIso:
          type: string
          example: "de"
          description: "Country ISO code of the organisation"
        privacyOffice:
          type: string
          example: ""
          description: "Privacy office for this company - empty for automatic"
        companyNr:
          type: string
          example: "F123456"
          description: "Official number of the company"
        vatId:
          type: string
          example: "ATU1234564789"
          description: "VAT ID of the company"
        phone:
          type: string
          example: "01234/456789"
          description: "Phone number of the company"
        fax:
          type: string
          example: "01234/456789-012"
          description: "Fax number of the company"
        email:
          type: string
          example: "office@datareporter.eu"
          description: "Official E-Mail of the company"
        emailPrivacy:
          type: string
          example: "privacy@datareporter.eu"
          description: "Privacy related E-Mail of the company"

    WebCareSettingsRole:
      properties:
        id:
          type: string
          example: "123"
          description: "Internal ID of the person to synchronize"
        roleCeo:
          type: string
          example: "all"
          description: "Is this person a ceo? Can be empty (no), true or all (in all orgs in privacy)"
        rolePrivacyOfficer:
          type: string
          example: ""
          description: "Is this person a privacy officer? Can be empty (no), true or all (in all orgs in privacy)"
        rolePrivacyCoordinator:
          type: string
          example: "true"
          description: "Is this person a privacy coordinator? Can be empty (no), true or all (in all orgs in privacy)"
        gender:
          type: string
          example: "f"
          description: "Gender of the person - can be m or f"
        title:
          type: string
          example: "Dr."
          description: "Title of the person"
        firstName:
          type: string
          example: "Max"
          description: "First name of the person"
        lastName:
          type: string
          example: "Mustermann"
          description: "Last name of the person"
        email:
          type: string
          example: "max.mustermann@datareporter.eu"
          description: "E-Mail of the person, also used for matching wih existing roles"

    WebCareSettingsApi:
      properties:
        server:
          type: string
          example: "https://www.datareporter.eu/test/json"
          description: "Server to load the configuration from"
        apiKey:
          type: string
          example: "123-2354-2443"
          description: "When importing from a WebCare API, insert the api key here"
        profile:
          type: string
          example: "consent,consent_color,settings_organization"
          description: "Modules to import (same as parameter in GET request)"
        mode:
          type: string
          example: "day"
          description: "Import schedule - empty for manual - hour, day or week"

    WebCareImportResult:
      properties:
        success:
          type: boolean
          example: true
          description: "true if the import was processed correctly (warnings may have occured)"
        error:
          $ref: '#/components/schemas/WebCareConfigurationError'

    WebCareConfigurationError:
      properties:
        errorId:
          type: integer
          format: int64
          example: 1001
          description: "Internal error code"
        error:
          type: string
          example: "Error in fields"
          description: "Description of the error"
        fields:
          type: array
          items:
            $ref: '#/components/schemas/WebCareConfigurationFieldError'

    WebCareConfigurationFieldError:
      properties:
        fieldName:
          type: string
          example: "conf/consent/font/header"
          description: "Full path of the field"
        error:
          type: string
          example: "Not one of test1, test, test3"
          description: "Description of the error"




  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header


