Data Products

Patch Data Product

Partially updates an existing ACTIVE data product. Each provided field is validated against the data product's current state and the caller's role. If any field cannot be updated, the entire request is rejected and no changes are applied.

patch/api/products/v2/{id}

Path parameters

idstring uuid required

Query parameters

actingRole'PROVIDER' | 'ADMIN'

Selects the role in which the authenticated user acts for this request. Optional: if the authenticated user holds exactly one of the allowed roles, the value is auto-resolved. Returns 400 if the value is unknown, not allowed for this endpoint, or omitted while the user holds multiple matching roles. Returns 403 if the user does not hold the role specified in the parameter.

Request body

dataSourceSystemIdstring uuid
restClientIdstring uuid
restClientPathTemplatestring

Template for the path from which the data product will be fetched

restClientRequestTemplatestring

Template for the path from which the data product will be fetched

restClientMethodCode'POST' | 'GET'
flowCode'UID_BASED_PRE_VALIDATION' | 'UID_BASED_POST_VALIDATION' | 'BUR_BASED_PRE_VALIDATION' | 'BUR_BASED_POST_VALIDATION' | 'UNBOUND_UID_BASED_POST_VALIDATION' | 'UNBOUND_BUR_BASED_POST_VALIDATION'
restClientChangeDetectionPathTemplatestring

Template for the path for retrieving updates to the data product

consentRequiredboolean

If a consent is required for this data product

Example request

{
  "name": {
    "de": "Tierschutz",
    "fr": "Protection des animaux",
    "it": "Protezione degli animali"
  },
  "description": {
    "de": "Dieses Datenprodukt enthält Angaben zu Kontrollen aus dem Kontrollbereich 03 Tierschutz mit den Ergebnissen pro Kontrollpunkt. Maximal die letzten 4 Jahre oder seit Bewirtschafterwechsel.",
    "fr": "Ce produit de données contient des informations sur les contrôles du domaine de contrôle 03 Protection des animaux avec les résultats par point de contrôle. Maximum les 4 dernières années ou depuis le changement d'exploitant.",
    "it": "Questo prodotto dati contiene informazioni sui controlli dell'area di controllo 03 Protezione degli animali con i risultati per punto di controllo. Massimo gli ultimi 4 anni o dal cambio di gestore."
  },
  "restClientPathTemplate": "v1/animal/{{uid}}",
  "restClientRequestTemplate": "{\"search\":{\"uid\":\"{{uid}}\"}}",
  "restClientChangeDetectionPathTemplate": "v1/animal-updates/{{uid}}?since={{LAST_CHANGED_SINCE}}",
  "extendedDescription": {
    "de": "Konkret werden folgende Daten übermittelt:\n- Datum der Erfassung bzw. der letzten Änderung dieses Datensatzes im kantonalen System\n- KT_ID_B Kantonale Identifikationsnummer der Betriebsform auf der Stufe, auf der die nachfolgenden Daten...",
    "fr": "Concrètement, les données suivantes sont transmises :\n- Date resp. la saisie ou la dernière modification du jeu de données dans le système cantonal\n- KT_ID_B Numéro cantonal de la forme d’exploitation au niveau de laquelle les données suivantes ont été saisies...",
    "it": "Concretamente vengono trasmessi i dati seguenti:\n- Data di registrazione o dell’ultima modifica di questo set di dati nel sistema cantonale\n- KT_ID_B Numero d’identificazione cantonale della forma di azienda al livello a cui sono stati registrati i dati..."
  },
  "consentRequired": true
}

Response

OK

idstring uuid required
dataSourceSystemCodestring

Code of data source system from which this product originates

restClientPathTemplatestring

Template for the path where the data product is fetched from

restClientRequestTemplatestring

Template of the request body for fetching the data product

restClientMethodCode'POST' | 'GET'
flowCode'UID_BASED_PRE_VALIDATION' | 'UID_BASED_POST_VALIDATION' | 'BUR_BASED_PRE_VALIDATION' | 'BUR_BASED_POST_VALIDATION' | 'UNBOUND_UID_BASED_POST_VALIDATION' | 'UNBOUND_BUR_BASED_POST_VALIDATION'
deprecatedSincestring date-time
restClientChangeDetectionPathTemplatestring

Template for the path for retrieving updates to the data product

consentRequiredboolean required

If a consent is required for this data product

Example response

{
  "dataSourceSystemCode": "AGIS",
  "dataSourceSystem": {
    "code": "AGIS",
    "dataProvider": {
      "code": "BLW",
      "uid": "CHE123456789"
    }
  },
  "restClient": {
    "code": "AGIS_API",
    "displayName": "Agis",
    "url": "http://example.com/agis"
  },
  "deprecatedSince": "2022-03-10T12:15:50",
  "restClientChangeDetectionPathTemplate": "v1/animal-updates/{{uid}}?since={{LAST_CHANGED_SINCE}}",
  "consentRequired": true
}

Changes

Changed in 4 of the 56 revisions of this API.1210

    • the extendedDescription/de request property's maxLength was increased from 1000 to 10000

      request-property-max-length-increased

    • the extendedDescription/fr request property's maxLength was increased from 1000 to 10000

      request-property-max-length-increased

    • the extendedDescription/it request property's maxLength was increased from 1000 to 10000

      request-property-max-length-increased

    • added the new optional request property consentRequired

      new-optional-request-property

    • added the required property consentRequired to the response with the 200 status

      response-required-property-added

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 52c1637abca0124See the full diff
    • removed the enum value UNBOUND_POST_VALIDATION of the request property flowCode

      request-property-enum-value-removed

    • added the new UNBOUND_BUR_BASED_POST_VALIDATION enum value to the flowCode response property for the response status 200

      response-property-enum-value-added

    • added the new UNBOUND_UID_BASED_POST_VALIDATION enum value to the flowCode response property for the response status 200

      response-property-enum-value-added

    • added the new UNBOUND_BUR_BASED_POST_VALIDATION enum value to the request property flowCode

      request-property-enum-value-added

    • added the new UNBOUND_UID_BASED_POST_VALIDATION enum value to the request property flowCode

      request-property-enum-value-added

    • removed the UNBOUND_POST_VALIDATION enum value from the flowCode response property for the response status 200

      response-property-enum-value-removed

    • added the required property dataSourceSystem/legalBasis to the response with the 200 status

      response-required-property-added

    • endpoint added

      endpoint-added