This feature will allow you to easily copy forms between accounts, or between Sandbox and Production.
Before you can use this feature you will need to enable the formtitan api usage at => My Account => Api.
Before you can use this feature you will need to enable the formtitan api usage at => My Account => Api.
Formtitan endpoint url, you can find your subdomain at => My Account => Profile => Subdomain.
string endpointUrl = 'https://yoursubdomain. formtitan.com/api/v1/forms/ CopyFormsBetweenAccounts';
json sample, you can build this dynamically via apex.
destination formtitan apiKey, can be found at your destination formtitan account at => My Account => Api.
the DestinationftUserName is your subdomain,you can find your subdomain at => My Account => Profile => Subdomain.
the formId can be found at => Form Settings => General => Form ID.
the formId can be found at => Form Settings => General => Form ID.
string json2post = '{ "DestinationftAPIKey": "destinatinationApiKey", "DestinationftUserName": "your-destination-subdomain", "Forms": [ { "formID": "1040449", "formName": "test export" }, { "formID": "1040450", "formName": "test export1" } ] }';
HttpRequest req = new HttpRequest();
req.setEndpoint(endpointUrl);
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
// origin formtitan apiKey, can be found at => My Account => Api.
req.setHeader('ftAPIKey', 'originapiKey');
req.setBody(json2post);
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug('res body>>> ' +res.getBody());
// sample response from formtitan
{
"success": true,
"data": [
{
"sourceFormID": 1040449,
"formID": 1040456,
"formName": "test export",
}
]
}