Creating Vertex is not working - mentioned in documentation

Tried the POST command with inline data for creating Vertex named User as specified in the documentation. How do we fix this error.

Request :
curl -X POST -H “Authorization: Bearer b29g47t9fo34ah8oio9j0leurhnav6do” -d ‘{“vertices”:{“User”:{“id6”:{“id”:{“value”:“id6”}}}}}’ “http://localhost:9000/graph/ManiRTest

Response :
{“version”:{“edition”:“enterprise”,“api”:“v2”,“schema”:4},“error”:true,“message”:“The input vertex type: ‘User’ is not a valid vertex type.”,“code”:“REST-30200”}

Hi Mani,

Welcome to the TigerGraph community!

Sorry for the trivial question: do you have “User” vertex type defined in your graph?

No, it is a fresh installation. can I do that using curl/REST++ APIs?
Mani.

No, not at this stage.
To define your graph, including the vertices and edges, you need to use either GraphStudio (where you can do this visually) or GSQL (both a language and a command line tool, where you can programmatically create the objects).
Once you have created a schema=graph, you can start populating it.
We have good introduction material on TigerGraph Academy, I suggest to have a look at it. Not too long, not too complicated.

One more thing, a clarification: TigerGraph is a “schema on write” kind of database, i.e. you need to define the schema, the (logical) storage structure before you can insert/load data (similar to relational databases).
This allows us to optimise data storage and retrieval early on. And (unlike relational databases) we can still easily extend the schema if/when there are new requirements (e.g. data sources).

Thanks for this clarification, I was looking around to create the schema programmatically, like in other graph databases. Thanks for the academy link, will go through the same…

I tried this, I am able to add vertex data using the following example :
‘{“vertices”:{“User”:{“id6”:{“id”:{“value”:“id6”}}}}}’
However when I try to add with edges it gives the following error :
{“version”:{“edition”:“enterprise”,“api”:“v2”,“schema”:23},“error”:true,“message”:“The input source vertex type: ‘Starts’ is not a valid vertex type.”,“code”:“REST-30200”}
It gives error for Vertex when I am passing edges data!
Is there a documentation of the syntax of the input json objects for vertex and edge, I am not able to find it in the Tigergraph academy or in the documentation, syntax and/or example will help

Could you show me the JSON you tried to use to create the vertex?

The format of the JSON document is described here.