import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationVariant = await client.applicationVariants.create({
account_id: 'account_id',
application_spec_id: 'application_spec_id',
configuration: {
edges: [{ from_field: 'from_field', from_node: 'from_node', to_field: 'to_field', to_node: 'to_node' }],
nodes: [{ id: 'id', application_node_schema_id: 'text_input_schema' }],
},
name: 'name',
version: 'V0',
});
console.log(applicationVariant);
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"configuration": {
"metadata": {},
"nodes": [
{
"id": "<string>",
"application_node_schema_id": "text_input_schema",
"configuration": {}
}
],
"edges": [
{
"from_node": "<string>",
"to_node": "<string>",
"from_field": "<string>",
"to_field": "<string>"
}
]
},
"version": "V0",
"application_spec_id": "<string>",
"draft": true,
"published_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
Creates a application variant
This API can be used to create a application variant. To use this API, review the request schema and pass in all fields that are required to create a application variant.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationVariant = await client.applicationVariants.create({
account_id: 'account_id',
application_spec_id: 'application_spec_id',
configuration: {
edges: [{ from_field: 'from_field', from_node: 'from_node', to_field: 'to_field', to_node: 'to_node' }],
nodes: [{ id: 'id', application_node_schema_id: 'text_input_schema' }],
},
name: 'name',
version: 'V0',
});
console.log(applicationVariant);
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"configuration": {
"metadata": {},
"nodes": [
{
"id": "<string>",
"application_node_schema_id": "text_input_schema",
"configuration": {}
}
],
"edges": [
{
"from_node": "<string>",
"to_node": "<string>",
"from_field": "<string>",
"to_field": "<string>"
}
]
},
"version": "V0",
"application_spec_id": "<string>",
"draft": true,
"published_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
Successful Response
The response is of type object
.