SA REST API : System Architect REST API : Create new definition instance by type name
  
Create new definition instance by type name
Syntax
http://<Machine Name|IP>:<Port>/SARest/SQL/<Server Name>/<Encyclopedia Name>/<Workspace ID>/Definitions/<Type Name>/Create?name=Fully Qualified Name
An update session can also be supplied with ..&updateSession=<SessionID>
Example
Create a new instance of an Entity definition called ‘!test name’ of model ‘model name’:
http://localhost:8889/SARest/SQL/MySQLServer/Samples/1/Definitions/Entity/Create?name=-dqu-model-spa-name-dqu-.-dqu-!test-spa-name-dqu-
Results
<CreateDefinitionResult>
   <DefinitionId>28578</DefinitionId>
   <DefinitionCreated>1</DefinitionCreated>
</CreateDefinitionResult>
Comments
The name, being supplied as part of the URL can contain special characters (see General usage instructions) such as -spa-, and these are replaced with the equivalent character.
Double-quotes, as indicated by -dqu-, are important where the item is keyed and the key value is being supplied as part of the name, and a name contains a space. The format is key.name or where there are multiple keys, the sequence is key1.key2[... .keyn].name. If keys are missing then they are assigned in reverse order.
In the case of Entity, if Model is not supplied then the default is Pool.
If you have a definition with two key properties (not counting the name), and only supply key.name, then the value “key” gets stored in the second key property that was defined.
Therefore, supply key1.-dqu--dqu-.name to get a definition with the first key of value key1. Note that supplying key1..name will not successfully find an existing definition.
Otherwise, where no defaults are programmed, missing keys get no value.
DefinitionCreated
Contains 1 to indicate that the definition was created or 0 if it was not.
DefinitionId
Contains a number greater than 0 if a definition exists with the given name.
This requires SAXT to be installed and for SAREST to have been configured with the SAXT URL.
Exceptions are returned as <Exception>Message Text</Exception>
See also
Handle encyclopedia transactions
Parent topic
System Architect REST API