Data Modeling with the RESTful API
Let’s create a class called “Todo”:
Bash
curl -vX POST https:
//apiomat
.org
/yambas/rest/modules/TodoListMain/metamodels
\
-d metaModelName=Todo -u admin0815@example.com:123456
Save / remember the meta model ID that is in the URL of the location header of the response.
The “Todo” class now gets a “description” attribute of type string. For the request url use the meta model ID from before here:
Bash
curl -vX POST https:
//apiomat
.org
/yambas/rest/modules/TodoListMain/metamodels/
<METAMODELID>
/attributes
\
-d attributeType=String -d attributeName=description -u admin0815@example.com:123456
You may add more classes and attributes here (for a Todo class a “done” and “untilDate” atttribute would make sense).
If you are ready, deploy your app (in our case using the LIVE system):
Bash
curl -vX PUT https:
//apiomat
.org
/yambas/rest/modules/TodoListMain
\
-d
"{\"moduleStatus\":{\"LIVE\":\"DEPLOYED\"}}"
-u admin0815@example.com:123456 \
-H
"Content-Type: application/json"
* link only available in Enterprise Documentation