Symptom:
On exporting and reimporting TML in YAML format in the REST API v2 Playground, the following error message is returned:
Invalid YAML/JSON syntax in file.
Conditions:
This issue occurs because when reimporting TML invalid characters are added to the TML YAML content in the Playground resulting in an invalid syntax error.
Workaround:
We recommend the following steps to work around this issue:
-
On the REST API v2 Playground, export the TML in YAML format.
-
Copy the edoc output from the API response in the code panel.
-
Paste it in a text editor such as Sublime.
For example,"guid: a162289a-c1ab-427e-9985-8fb5f7c7e539\nliveboard:\n name: Liveboard 1\n"
-
Check if the output is enclosed in quotation marks ("). Remove the quotation marks and update the TML text as shown here:
guid: a162289a-c1ab-427e-9985-8fb5f7c7e539\nliveboard:\n name: Liveboard 1\n
-
On the Import Metadata TML API page, go to body > metadata_tmls parameter.
-
Add / remove objects in that list based on how many TML objects you want to import.
-
Click VIEW JSON to view the object properties in JSON format.
The request body JSON appears as shown in this example:{ "metadata_tmls": [ "metadata_tmls3" ], "import_policy": "PARTIAL", "create_new": false, "all_orgs_context": false }
-
Replace
metadata_tmls3
with the text copied from step 4. Ensure that the text you copy doesnโt include additional characters and quotation marks.{ "metadata_tmls": [ "guid: a162289a-c1ab-427e-9985-8fb5f7c7e539\nliveboard:\n name: Liveboard 1\n" ], "import_policy": "PARTIAL", "create_new": false, "all_orgs_context": false }
-
Execute the API call by clicking Try it Out.
If you still get an error, try out the steps shown in this video: