I'm trying to clone a form via the API but I'm getting some unexpected results when compared to cloning emails/landing pages. When I clone a form, if the original form is approved it then gains a draft. I've not noticed this when cloning any other content.
Also, when I click on my cloned form, it takes me through to Design Studio rather than staying in Marketing Activities like forms cloned via the standard way in Marketo.
Any ideas what is causing this?
Here is my code:
ClonePostURL = host + "/rest/asset/v1/form/" + CloneID + "/clone.json?" + qs.ToString();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(ClonePostURL);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "application/json";
var wr = new StreamWriter(request.GetRequestStream());
wr.Write("&name=" + CloneName + "&folder={\"id\":" + CloneFolderID + ",\"type\":\"Folder\"}");
wr.Flush();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
var reader = new StreamReader(resStream);
return reader.ReadToEnd();