Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. do a test/sample request without any mapping declaration to identify the default mappings

  2. In the case of prismic integrations, the following mappings are added by default:

    Code Block
    "id": "id",
    "type": "type",
    "creation": "first_publication_date",
    "last_update": "last_publication_date",
    "link": "uid",
    "string_attributes" : {"linked_ids":"alternate_languages[*].id"},
    "localized_string_attributes" : ["slugs", "href"],
    "raw" : {
      "localized_string_attributes" : [
        "alternate_languages",
        "linked_documents"
      ]
    }

e) export of properties as raw JSON - use the raw node in the mapping

...

Check bellow a sample for various integrations following the designed blog logic in our public repository:

"mapping": { "id": "id", "type": "type", "creation": "first_publication_date", "last_update": "last_publication_date",
Expand
titlePrismic Mapping Sample
Code Block
titlePrismic Mapping Sample
Code Block
"mapping": {
    "title": "data.title",
    "short_description": "",
    "description": "data.content",
    "images": "data.header_image.url",

   "link": "uid",
    "tags": {
      "default":"tags",
      "category":"data.category.tags"
     },
    "parent_content_ids": "data.category.id",
    "contents": [],
    "products": [],
    "customers": [],

   "stores": "",
    "status": "data.status",
    "string_attributes": {
      "tags": "tags",
      "category_uid": "data.category.uid"
    },
    "localized_string_attributes": [
      "data.meta_title",
      "data.content"
    ],
    "numeric_attributes": [
      "data.position"
    ],
    "localized_numeric_attributes": {
      "product_ids":"data.product_ids[*].id"
    },
    "datetime_attributes": {},
    "localized_datetime_attributes": {},
    "raw" : {
      "localized_string_attributes" : [ [
         "data.content",
          "data.contentheader_image"
       ]
     }
  }

Expand
titleGraphCMS Mapping sample

Warning : the mapping fields must exist in the connector options ~fields~ property.

Code Block
"mapping": {
    "id": "id",
    "type": "__typename",
    "creation": "createdAt",
    "last_update": "updatedAt",
    "persona_type": "createdBy.name",
    "persona_id": "createdBy.id",
    "title": "title",
    "short_description": "",
    "description": "content.text",
    "images": "headerImage.url",
    "link": "seoLink",
    "tags": {
      "brands":"brands[*].name"
    },
    "parent_content_ids": "",
    "contents": [],
    "products": [],
    "customers": [],
    "stores": "",
    "status": "state",
    "string_attributes": {
      "background": "background.hex",
      "background_css": "background.css",
      "brand_ids" : "brands[*].id"
    },
    "localized_string_attributes": {
      "meta_title": "metaTitle",
      "meta_description": "metaDescription",
      "content":"content.html",
      "slugs": "seoLink"
    },
    "numeric_attributes": {},
    "localized_numeric_attributes": {},
    "datetime_attributes": {
      "published_at":"publishedAt"
    },
    "localized_datetime_attributes": {}
  }

...

Code Block
curl https://boxalino-di-transformer-krceabfwya-ew.a.run.app/test/sample \
-X POST \
-d "[{\"connector\":{\"type\":\"prismic\",\"options\":{\"url\":\"https:\/\/rtux-integration.cdn.prismic.io\/api\/v2\/\",\"access_token\":\"MC5ZSkU4SnhBQUFDSUFXSXZR.77-9QO-_vWR577-977-9HO-_ve-_ve-_vXPvv73vv71LeO-_vUNi77-9Ii3vv73vv73vv71sC2Xvv71A77-9IA\",\"query\":[\"[at(document.type, \\\"category\\\")]\"]}},\"document\":{\"type\":\"content\"},\"mapping\":{\"id\":\"id\",\"type\":\"type\",\"creation\":\"first_publication_date\",\"last_update\":\"last_publication_date\",\"persona_type\":\"\",\"persona_id\":\"\",\"title\":\"data.name\",\"short_description\":\"\",\"description\":\"data.description\",\"images\":\"data.header_image.url\",\"link\":\"uid\",\"tags\":{\"default\":\"tags\"},\"parent_content_ids\":\"data.parent_category.id\",\"contents\":[],\"products\":[],\"customers\":[],\"stores\":\"\",\"status\":\"data.status\",\"string_attributes\":{\"default_tags\":\"tags\",\"version\":\"version\"},\"localized_string_attributes\":{\"category_title\":\"data.category_title\",\"slugs\":\"slugs\",\"linked_language_id\":\"alternate_languages[*].id\"},\"numeric_attributes\":{\"position\":\"data.position\",\"show_in_navigation\":\"data.show_in_navigation\"},\"localized_numeric_attributes\":{},\"datetime_attributes\":{},\"localized_datetime_attributes\":{}},\"languages\":{\"de\":\"en-de\",\"fr\":\"fr-ch\"}},{\"connector\":{\"type\":\"prismic\",\"options\":{\"url\":\"https:\/\/rtux-integration.cdn.prismic.io\/api\/v2\/\",\"access_token\":\"MC5ZSkU4SnhBQUFDSUFXSXZR.77-9QO-_vWR577-977-9HO-_ve-_ve-_vXPvv73vv71LeO-_vUNi77-9Ii3vv73vv73vv71sC2Xvv71A77-9IA\",\"query\":[\"[at(document.type, \\\"blog\\\")]\"]}},\"document\":{\"type\":\"content\"},\"mapping\":{\"id\":\"id\",\"type\":\"type\",\"creation\":\"first_publication_date\",\"last_update\":\"last_publication_date\",\"persona_type\":\"\",\"persona_id\":\"\",\"title\":\"data.title\",\"short_description\":\"\",\"description\":\"data.content\",\"images\":\"data.header_image.url\",\"link\":\"uid\",\"tags\":{\"default\":\"tags\",\"category\":\"data.category.tags\"},\"parent_content_ids\":\"data.category.id\",\"contents\":[],\"products\":[],\"customers\":[],\"stores\":\"\",\"status\":\"data.status\",\"string_attributes\":{\"tags\":\"tags\",\"category_uid\":\"data.category.uid\"},\"localized_string_attributes\":{\"slugs\":\"slugs\",\"alternate_languages\":\"alternate_languages[*].id\",\"meta_title\":\"data.meta_title\",\"content\":\"data.content\"},\"numeric_attributes\":{\"position\":\"data.position\"},\"localized_numeric_attributes\":{\"product_ids\":\"data.product_ids[*].id\"},\"datetime_attributes\":{},\"localized_datetime_attributes\":{}},\"languages\":{\"de\":\"en-de\",\"fr\":\"fr-ch\"}},{\"connector\":{\"type\":\"graphql\",\"options\":{\"endpoint\":\"https:\/\/api-eu-central-1.graphcms.com\/v2\/ckll4a83ni7og01yzfr3k9yc4\/master\",\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImdjbXMtbWFpbi1wcm9kdWN0aW9uIn0.eyJ2ZXJzaW9uIjozLCJpYXQiOjE2MjI1NjIzMzMsImF1ZCI6WyJodHRwczovL2FwaS1ldS1jZW50cmFsLTEuZ3JhcGhjbXMuY29tL3YyL2NrbGw0YTgzbmk3b2cwMXl6ZnIzazl5YzQvbWFzdGVyIiwiaHR0cHM6Ly9tYW5hZ2VtZW50LW5leHQuZ3JhcGhjbXMuY29tIl0sImlzcyI6Imh0dHBzOi8vbWFuYWdlbWVudC5ncmFwaGNtcy5jb20vIiwic3ViIjoiZjZlMTcyNGYtOTI2NS00OTFjLWEwMzktYzFkNGI2ZDExZDA5IiwianRpIjoiY2twZTdweDVoZGR2bzAxejU1NjNwZjc1cCJ9.MjYP8I7OvwyOkiHiB22LPwOfRzEt_ilvp6jHTVufkQEs6UTxJeuOEDvcojbMAgiEa3lStbc3mOVDezOQhMoLdD-UYoSzGyKmzIBI76vsVv5xbkhKwnLBnmX2ssRHMfOgIuyEpG16SwNiyKuBOZdhC39dapEWwSn2bzWqSi4Y-LvIdsANlHfgdwzVzkJNfNAO-2oOMQC4h-QfBlUVoSEQPYLPmGDOUpcawnHXc60Lyg9rCdxooG9YVzXUeqoi4SIc8feHH4My4s_Eb9mprP6sewezTIb4ldPCVwAlh2xl5BrWYDLLNbhgVMmUVaNZjXSS40egT4xxIWiNPw4axCAKZbgsk78lgHo51t0hz8j6qIfn9G_ZNzMagKQRupx4guuMQXiXg30WjSE09HBv6QjDLQRz9A89eRAKCiGVddKGAvXy_cZrAi2OZ_gtsX993wR-kt6AtNZ7s2U5IZPribvLbiNBMtwh1kRfz_t_bUFLCJs7J332odSDkxL38LqR7oRNStZv6EqAXmelWYqBsUvnwZWI3DYqjysYfjb4JALSTwOa4zfDHDkzlaKOiIZwZkI0GroSed_fmL6cfkpmN63CRY3qNQfwG7cXT0mOuOTJSzRBw1QigfCVnM_M2881eBaBdpdwXw3zF7FlxJL1Y0uMSQ0RZ2l3WC81xH7KqUUlUPw\",\"type\":\"blogs\",\"fields\":\"{ title __typename locale createdAt active id metaDescription metaTitle publishedAt seoLink updatedAt content {  html text } headerImage { url id } stage background { css hex } brands { id name } createdBy { id name } history { createdAt } publishedBy { id name } updatedBy { id name } }\",\"filters\":\"active:true\",\"locales\":[\"de_CH\",\"fr_CH\"]}},\"document\":{\"type\":\"content\"},\"mapping\":{\"id\":\"id\",\"type\":\"__typename\",\"creation\":\"createdAt\",\"last_update\":\"updatedAt\",\"persona_type\":\"createdBy.name\",\"persona_id\":\"createdBy.id\",\"title\":\"title\",\"short_description\":\"\",\"description\":\"content.text\",\"images\":\"headerImage.url\",\"link\":\"seoLink\",\"tags\":{\"brands\":\"brands[*].name\"},\"parent_content_ids\":\"\",\"contents\":[],\"products\":[],\"customers\":[],\"stores\":\"\",\"status\":\"state\",\"string_attributes\":{\"background\":\"background.hex\",\"background_css\":\"background.css\",\"brand_ids\":\"brands[*].id\"},\"localized_string_attributes\":{\"meta_title\":\"metaTitle\",\"meta_description\":\"metaDescription\",\"content\":\"content.html\",\"slugs\":\"seoLink\"},\"numeric_attributes\":{},\"localized_numeric_attributes\":{\"display\":\"active\"},\"datetime_attributes\":{\"published_at\":\"publishedAt\"},\"localized_datetime_attributes\":{}},\"languages\":{\"demeta_title\":\"de_CHmetaTitle\",\"frmeta_description\":\"fr_CHmetaDescription\"}}]" \
-H "Content-Type: application/json" \
-H "mode: F" \
-H "type: content"

In the sample above, the following BODY is used:

[ { "connector": { "type": "prismic", "options": { "url": "https://rtux-integration.cdn.prismic.io/api/v2/", "access_token": "MC5ZSkU4SnhBQUFDSUFXSXZR.77-9QO-_vWR577-977-9HO-_ve-_ve-_vXPvv73vv71LeO-_vUNi77-9Ii3vv73vv73vv71sC2Xvv71A77-9IA", "query": [ "[at(document.type, \"category\")]" ] } }, "document": { "type": "content" }, "mapping
,\"content\":\"content.html\",\"slugs\":\"seoLink\"},\"numeric_attributes\":{},\"localized_numeric_attributes\":{\"display\":\"active\"},\"datetime_attributes\":{\"published_at\":\"publishedAt\"},\"localized_datetime_attributes\":{}},\"languages\":{\"de\":\"de_CH\",\"fr\":\"fr_CH\"}}]" \
-H "Content-Type: application/json" \
-H "mode: F" \
-H "type: content"
Expand
titleJSON body content for the SAMPLE request
Code Block
languagejson

In the sample above, the following BODY is used:

Expand
titleJSON body content for the SAMPLE request
Code Block
languagejson
[
  {
    "connector": {
      "idtype": "idprismic",
      "typeoptions": "type", {
        "creationurl": "first_publication_datehttps://rtux-integration.cdn.prismic.io/api/v2/",
        "lastaccess_updatetoken": "last_publication_dateMC5ZSkU4SnhBQUFDSUFXSXZR.77-9QO-_vWR577-977-9HO-_ve-_ve-_vXPvv73vv71LeO-_vUNi77-9Ii3vv73vv73vv71sC2Xvv71A77-9IA",
        "persona_typequery": "",[
          "persona_id": "",[at(document.type, \"category\")]"
        "title": "data.name",]
      }
 "short_description": "",  },
    "descriptiondocument": "data.description",{
      "imagestype": "data.header_image.url",content"
    },
    "linkmapping": "uid",{
      "tagstitle": {
 "data.name",
      "defaultdescription": "tags"
      }data.description",
      "parent_content_idsimages": "data.parentheader_categoryimage.idurl",
      "contentstags": [],{
        "productsdefault": [],"tags"
      "customers": []},
      "storesparent_content_ids": "data.parent_category.id",
      "status": "data.status",
      "string_attributes": {
        "default_tags": "tags",
        "version": "version"
      },
      "localized_string_attributes": {
        "category_title": "data.category_title",
        "slugs": "slugs",
        "linked_language_id": "alternate_languages[*].id"
      },
      "numeric_attributes": {[
        "data.position":,
        "data.position",
 show_in_navigation"
      ],
      "raw" : {
        "showlocalized_instring_navigationattributes" : [
          "data.showheader_in_navigation"
 image",
    },       "localized_numeric_attributes": {},"data.description"
       "datetime_attributes": {}, ]
      "localized_datetime_attributes": {}
    },
    "languages": {
      "de": "en-de",
      "fr": "fr-ch"
    }
  },
  {
    "connector": {
      "type": "prismic",
      "options": {
        "url": "https://rtux-integration.cdn.prismic.io/api/v2/",
        "access_token": "MC5ZSkU4SnhBQUFDSUFXSXZR.77-9QO-_vWR577-977-9HO-_ve-_ve-_vXPvv73vv71LeO-_vUNi77-9Ii3vv73vv73vv71sC2Xvv71A77-9IA",
        "query": [
          "[at(document.type, \"blog\")]"
        ]
      }
    },
    "document": {
      "type": "content"
  
 },
    "mapping": {
      "id": "id",
      "type": "type",       "creation": "first_publication_date",]
      }
 "last_update": "last_publication_date",  },
    "persona_typedocument": "",{
      "persona_idtype": "content",
    },
    "titlemapping": "data.title",{
      "short_descriptiontitle": "data.title",
      "description": "data.content",
      "images": "data.header_image.url",
      "link": "uid",
      "tags": {
        "default": "tags",
        "category": "data.category.tags"
      },
      "parent_content_ids": "data.category.id",
      "contents": [],
      "products": [],
      "customers": [],
      "stores": ""id",
      "status": "data.status",
      "string_attributes": {
        "tags": "tags",[
         "category_uid": "data.category.uid"
      }],
      "localized_string_attributes": {
        "slugs": "slugs",
        "alternate_languages": "alternate_languages[*].id",
        "meta_title": "data.meta_title",
        "content": "data.content"
      },
      "numeric_attributes": {[
        "position": "data.position"
      }],
      "localized_numeric_attributes": {
        "product_ids": "data.product_ids[*].id"
      },
      "datetime_attributesraw" : {},
        "localized_datetimestring_attributes" : { [
          "data.header_image",
          "data.content",
          "data.title"
        ]
      }
    },
    "languages": {
      "de": "en-de",
      "fr": "fr-ch"
    }
  },
  {
    "connector": {
      "type": "graphql",
      "options": {
        "endpoint": "https://api-eu-central-1.graphcms.com/v2/ckll4a83ni7og01yzfr3k9yc4/master",
        "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImdjbXMtbWFpbi1wcm9kdWN0aW9uIn0.eyJ2ZXJzaW9uIjozLCJpYXQiOjE2MjI1NjIzMzMsImF1ZCI6WyJodHRwczovL2FwaS1ldS1jZW50cmFsLTEuZ3JhcGhjbXMuY29tL3YyL2NrbGw0YTgzbmk3b2cwMXl6ZnIzazl5YzQvbWFzdGVyIiwiaHR0cHM6Ly9tYW5hZ2VtZW50LW5leHQuZ3JhcGhjbXMuY29tIl0sImlzcyI6Imh0dHBzOi8vbWFuYWdlbWVudC5ncmFwaGNtcy5jb20vIiwic3ViIjoiZjZlMTcyNGYtOTI2NS00OTFjLWEwMzktYzFkNGI2ZDExZDA5IiwianRpIjoiY2twZTdweDVoZGR2bzAxejU1NjNwZjc1cCJ9.MjYP8I7OvwyOkiHiB22LPwOfRzEt_ilvp6jHTVufkQEs6UTxJeuOEDvcojbMAgiEa3lStbc3mOVDezOQhMoLdD-UYoSzGyKmzIBI76vsVv5xbkhKwnLBnmX2ssRHMfOgIuyEpG16SwNiyKuBOZdhC39dapEWwSn2bzWqSi4Y-LvIdsANlHfgdwzVzkJNfNAO-2oOMQC4h-QfBlUVoSEQPYLPmGDOUpcawnHXc60Lyg9rCdxooG9YVzXUeqoi4SIc8feHH4My4s_Eb9mprP6sewezTIb4ldPCVwAlh2xl5BrWYDLLNbhgVMmUVaNZjXSS40egT4xxIWiNPw4axCAKZbgsk78lgHo51t0hz8j6qIfn9G_ZNzMagKQRupx4guuMQXiXg30WjSE09HBv6QjDLQRz9A89eRAKCiGVddKGAvXy_cZrAi2OZ_gtsX993wR-kt6AtNZ7s2U5IZPribvLbiNBMtwh1kRfz_t_bUFLCJs7J332odSDkxL38LqR7oRNStZv6EqAXmelWYqBsUvnwZWI3DYqjysYfjb4JALSTwOa4zfDHDkzlaKOiIZwZkI0GroSed_fmL6cfkpmN63CRY3qNQfwG7cXT0mOuOTJSzRBw1QigfCVnM_M2881eBaBdpdwXw3zF7FlxJL1Y0uMSQ0RZ2l3WC81xH7KqUUlUPw",
        "type": "blogs",
        "fields": "{\r\n    title\r\n    __typename\r\n    locale\r\n    createdAt\r\n    active\r\n    id\r\n    metaDescription\r\n    metaTitle\r\n    publishedAt\r\n    seoLink\r\n    updatedAt\r\n    content {\r\n      html\r\n      text\r\n    }\r\n    headerImage {\r\n      url\r\n      id\r\n    }\r\n    stage\r\n    background {\r\n      css\r\n      hex\r\n    }\r\n    brands {\r\n      id\r\n      name\r\n    }\r\n    createdBy {\r\n      id\r\n      name\r\n    }\r\n    history {\r\n      createdAt\r\n    }\r\n    publishedBy {\r\n      id\r\n      name\r\n    }\r\n    updatedBy {\r\n      id\r\n      name\r\n    }\r\n  }",
        "filters": "active:true",
        "locales": [
          "de_CH",
          "fr_CH"
        ]
      }
    },
    "document": {
      "type": "content"
    },
    "mapping": {
      "id": "id",
      "type": "__typename",
      "creation": "createdAt",
      "last_update": "updatedAt",
      "persona_type": "createdBy.name",
      "persona_id": "createdBy.id",
      "title": "title",
      "short_description": "",
      "description": "content.text",
      "images": "headerImage.url",
      "link": "seoLink",
      "tags": {
        "brands": "brands[*].name"
      },
      "parent_content_ids": "",
      "contents": [],
      "products": [],
      "customers": [],
      "stores": "",
      "status": "active",
      "string_attributes": {
        "background": "background.hex",
        "background_css": "background.css",
        "brand_ids": "brands[*].id"
      },
      "localized_string_attributes": {
        "meta_title": "metaTitle",
        "meta_description": "metaDescription",
        "content": "content.html",
        "slugs": "seoLink"
      },
      "numeric_attributes": {},
      "localized_numeric_attributes": {
        "display":"active"
      },
      "datetime_attributes": {
        "published_at": "publishedAt"
       },
      "localized_datetime_attributes": {}
    },
    "languages": {
      "de": "de_CH",
      "fr": "fr_CH"
    }
  }
]

...