Exporting and Importing Transformations and Objects between Environments

Imagine a quick scenario: I have built all of my integrations in the Staging environment and now I am ready to go into Production. However, in addition to my element instances, I want to transfer over all the transformations I have created. 

How do I do that? Here are all the steps that you will need to accomplish that task:

  1. Identify at what level the resources and transformations were created, there are 3 possible different levels: Organization, Account, and Instance levels.

    The example provided here is for an Organization level transformation; however, the concept is still the same for all the other levels, as all that will change are the Platform API Docs endpoints you will be calling (Organizations, Accounts, Instances).

  2. Under Platform API Docs, go to Organizations GET /organizations/objects/definitions  .
  3. Click Try It Out, and then Execute.
  4. Your response body should contain all the Object Definition(s) that you will need to transfer over from one environment to another.

    XtlO8TJFWWsjHm7W4sUhnu0EuUGx8yPFtKgNioVJtr2sZBK1g7jUNmBLcDeGN0hvsHAuWB5LJai8-KPuR_Zh-2n5dfi2JLH8issYiBGN6Z2XWCL90_r16VDZz-I95Qojl.png

    NbzZtODvrEEGhk_dnDfLpvw09teaAGHU9_zy0KdS7skRTExr6XGnPz-YcfnB_UJ5ssJj-2mpzpUpSDcTpUe26n-Fd-fFmGskoyrrr1BeMqTGJzD-ajvVMGctu6EBKRbH9.png

  5. Save the payload returned to a text editor, preferably in a JSON format. You will need to import it later via API to make the process a little bit easier.
  6. The next step will be to get the transformations for each element you have available. On the same page you are currently on (Under Platform API Docs go to Organizations), search for GET/organizations/elements/{keyOrId}/transformations where the {keyOrId} is the KEY or ID of your element (you can find the ID by going into the elements Catalog and searching for the element name, and the ID should be right underneath the element name).
  7. After you have your element ID or Key available, you should be able to perform the call and it will look like this:

    r5VAiorTrKo-6lCMYcO9PWmACrIe8Ta8jkC7nHPDu6PDj9ZN3zKVAKM8AtJvAHESh8yzJX-UIBsptaQfH9Zn0p6COCTpPn5veFubvIbOoVl75nKeVzwKz_rvgibXhEow5RjHPazN.png

    d20fVDa2TH5wpCKIQPLCdImBapB-5n_s-rBGrMz74PU1kULvEFuP0VQg1byDXaM18GeasPVuBdD83R8tl3tHsadtDem5mcq4QeZfwFsmazCMPfr3-V0yAV1HZoRQfPLqH.png

  8. Save the payload returned in a text editor, preferably in a JSON format, you will need to import it later via API to make the process a little bit easier.
  9. After you have finished exporting all the transformations, we are now ready to go ahead and start transferring (importing) those transformations to the new environment.
  10. First we will go ahead and post all of our object definitions by calling  POST/organizations/objects/definitions  (post the payload received from the first call).

    waEeQNWetvECAilpWlfyyO-lFgbTWm25veWpuFI0u_skpRTAUy3Fww3xOYXne9OiEC_dc0m7kFJdpKsm9R2RX3eVE9-A26y-AnYLGU8n6YZ05ROUUeUhQKCfcsb-xKbVT.png

  11. Now that all your Object Definitions have been POSTed, you can now post all the transformations, on the same manner you have exported them (one by one), we will do the same to POST them, here is an example:
  12. POST /organizations/elements/{keyOrId}/transformations/{objectName}

    printscreen.png

And here is an example payload (essentially, all you will do is remove the object name from the original transformation retrieved):

{  
  "level":"organization",
  "objectName":"accrualify_credit",
  "vendorName":"creditmemo",
  "startDate":"2018-01-09 18:05:26.095578",
  "fields":[  
    {  
      "type":"string",
      "path":"id",
      "vendorPath":"CreditNoteID",
      "level":"organization"
    }
  ],
  "configuration":[  
    {  
      "type":"passThrough",
      "properties":{  
        "fromVendor":false,
        "toVendor":false
      }
    },
    {  
      "type":"inherit"
    }
  ],
  "isLegacy":false
}

More information can be found by reading: