transform
POSTALL/CreateFormCommandsFromSampleJSON
Arguments
- jsonCharacter
sample json data from which the form definition commands should be created
Returns
- resultJSON Object
Returns an object with these properties:
- errorboolean
true if there was an error
- errorTextstring
- resultobject
- commandsobject array
an array of objects. Each object in the array represents the definition of an object (i.e. heading, dataGroup, field, etc.) in a TransForm form.
Description
Takes sample JSON data and returns the form definition commands to create a TransForm form that matches the schema of the sample JSON data. Once you have the form definition commands, you can use the CreateNewFormDefinition method to create a new TransForm form definition.
CURL
CURL --insecure -H "apikey:Your_api_key" -H "accept: application/json" -d "{"""json""":{}}" https://transform.alphasoftware.com/transformAPIVersion1.a5svc/CreateFormCommandsFromSampleJSONNode
var request = require('request')
var path = 'https://transform.alphasoftware.com/transformAPIVersion1.a5svc/CreateFormCommandsFromSampleJSON';
var data = {"json": "{}"};
var dataJSON = JSON.stringify(data)
request.post(
{
headers: {apikey: "Your_api_key"},
url: path,
form: dataJSON},
function(err,httpResponse,body){
if(err) console.log(err)
console.log(body)
}
)Xbasic
dim apikey as c = "Your_api_key"
dim postdata as c
postdata = <<%txt%
{
"json": "{}"
}
%txt%
dim url as c = "/CreateFormCommandsFromSampleJSON"
dim pr as p
pr = a5dialogHelper_transformAPIQuery(url,postdata,apikey)
if pr.error = .f. then
dim result as c
result = pr.result
else
dim errorText as c
errorText = pr.errorText
end if