Hi,
I’m trying to create a new entity through the Rest API by following
the office guide CUBA REST API
I followed these steps:
- Created a new CUBA project with version 7.2.7 of the CUBA framework
test_cuba_project.zip (371.3 KB)
with Mysql server 5.7.29
test_db.zip (8.7 KB)
-
I added the Add-ons rest API (com.haulmont.addon.restapi:restapi-global:7.2.1)
-
I created a simple “test_NewEntity” entity and creating a single string field
-
I started the application directly from CUBA Studio (latest version)
-
From admin UI I created a new “REST” role where I enabled the ability to create new instances of the entity and enabled the use of the rest API
-
I have assigned the role “REST” to the Admin
-
From postman I logged into the application as admin usr and got the token
{
“access_token.” “4df23e8f-65a8-450f-b53a-e50a201547c3”,
“token_type”: “bearer”,
“refresh_token.” “f69e9b82-b1f9-426f-852d-54b3fc3d0c38”,
“expires_in”: 43199,
“brooms.” “rest-api”
} -
With
postman
I send a http POST as indicated in the online guide
CUBA REST API
with the body :
{
“entityName.” “test_NewEntity”,
“testField”: “test_value”
}
but I get this response:
[
{
“message.” “may not be null.”
“messageTemplate.” “{javax.validation.constraints.NotNull.message}”,
“path.” “testField.”
“invalidValue”: null
}
]
Can you please give me some suggestions?
Thanks Massimo