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:
- 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).
- Under Platform API Docs, go to Organizations
GET /organizations/objects/definitions
. - Click Try It Out, and then Execute.
- Your response body should contain all the Object Definition(s) that you will need to transfer over from one environment to another.
- 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.
- 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). - After you have your element ID or Key available, you should be able to perform the call and it will look like this:
- 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.
- 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.
- 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). - 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:
POST /organizations/elements/{keyOrId}/transformations/{objectName}
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: