AnsweredAssumed Answered

How to set scriptingObjects when script block token created through api

Question asked by Sham Chikkegowda on Feb 18, 2019
Latest reply on Feb 19, 2019 by Sanford Whiteman

Creating the script token using the end point /rest/asset/v1/folder/{id}/tokens.json?folderType=Program as attached. Token created fine. When try to use that in email template throwing the error "No usable value for scriptingObjects Expected object but got JString()". If i create the same token manually email delivers fine. The difference between API & Manual Creation is below


API Response

{"name":"test","type":"script block","value":"{\"codeBlock\":\"#set($ed1 = \\\"ok\\\")\",\"scriptingObjects\":\"\"}"}


Manual One

{"name":"test","type":"script block","value":"{\"codeBlock\":\"#set($ed1 = \\\"ok\\\")\",\"scriptingObjects\":{}}"}


So how to set scriptingObjects through api call ?




Thanks for your time.


cc:Sanford Whiteman