Example request
POST http://localhost:7474/db/data/node
Accept: application/json
Example response
201: Created
Content-Type: application/json
Location: http://localhost:7474/db/data/node/122
{
"extensions" : {
},
"paged_traverse" : "http://localhost:7474/db/data/node/122/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships" : "http://localhost:7474/db/data/node/122/relationships/out",
"traverse" : "http://localhost:7474/db/data/node/122/traverse/{returnType}",
"all_typed_relationships" : "http://localhost:7474/db/data/node/122/relationships/all/{-list|&|types}",
"all_relationships" : "http://localhost:7474/db/data/node/122/relationships/all",
"property" : "http://localhost:7474/db/data/node/122/properties/{key}",
"self" : "http://localhost:7474/db/data/node/122",
"outgoing_typed_relationships" : "http://localhost:7474/db/data/node/122/relationships/out/{-list|&|types}",
"properties" : "http://localhost:7474/db/data/node/122/properties",
"incoming_relationships" : "http://localhost:7474/db/data/node/122/relationships/in",
"incoming_typed_relationships" : "http://localhost:7474/db/data/node/122/relationships/in/{-list|&|types}",
"create_relationship" : "http://localhost:7474/db/data/node/122/relationships",
"data" : {
}
}Example request
POST http://localhost:7474/db/data/node
Accept: application/json
Content-Type: application/json
{
"foo" : "bar"
}Example response
201: Created
Content-Length: 1120
Content-Type: application/json
Location: http://localhost:7474/db/data/node/123
{
"extensions" : {
},
"paged_traverse" : "http://localhost:7474/db/data/node/123/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships" : "http://localhost:7474/db/data/node/123/relationships/out",
"traverse" : "http://localhost:7474/db/data/node/123/traverse/{returnType}",
"all_typed_relationships" : "http://localhost:7474/db/data/node/123/relationships/all/{-list|&|types}",
"all_relationships" : "http://localhost:7474/db/data/node/123/relationships/all",
"property" : "http://localhost:7474/db/data/node/123/properties/{key}",
"self" : "http://localhost:7474/db/data/node/123",
"outgoing_typed_relationships" : "http://localhost:7474/db/data/node/123/relationships/out/{-list|&|types}",
"properties" : "http://localhost:7474/db/data/node/123/properties",
"incoming_relationships" : "http://localhost:7474/db/data/node/123/relationships/in",
"incoming_typed_relationships" : "http://localhost:7474/db/data/node/123/relationships/in/{-list|&|types}",
"create_relationship" : "http://localhost:7474/db/data/node/123/relationships",
"data" : {
"foo" : "bar"
}
}Note that the response contains URI/templates for the available operations for getting properties and relationships.
Example request
GET http://localhost:7474/db/data/node/346
Accept: application/json
Example response
200: OK
Content-Type: application/json
{
"extensions" : {
},
"paged_traverse" : "http://localhost:7474/db/data/node/346/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships" : "http://localhost:7474/db/data/node/346/relationships/out",
"traverse" : "http://localhost:7474/db/data/node/346/traverse/{returnType}",
"all_typed_relationships" : "http://localhost:7474/db/data/node/346/relationships/all/{-list|&|types}",
"all_relationships" : "http://localhost:7474/db/data/node/346/relationships/all",
"property" : "http://localhost:7474/db/data/node/346/properties/{key}",
"self" : "http://localhost:7474/db/data/node/346",
"outgoing_typed_relationships" : "http://localhost:7474/db/data/node/346/relationships/out/{-list|&|types}",
"properties" : "http://localhost:7474/db/data/node/346/properties",
"incoming_relationships" : "http://localhost:7474/db/data/node/346/relationships/in",
"incoming_typed_relationships" : "http://localhost:7474/db/data/node/346/relationships/in/{-list|&|types}",
"create_relationship" : "http://localhost:7474/db/data/node/346/relationships",
"data" : {
}
}Example request
GET http://localhost:7474/db/data/node/35000000
Accept: application/json
Example response
404: Not Found
Content-Type: application/json
{
"message" : "Cannot find node with id [35000000] in database.",
"exception" : "NodeNotFoundException",
"stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.node(DatabaseActions.java:154)", "org.neo4j.server.rest.web.DatabaseActions.getNode(DatabaseActions.java:210)", "org.neo4j.server.rest.web.RestfulGraphDatabase.getNode(RestfulGraphDatabase.java:234)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}Example request
DELETE http://localhost:7474/db/data/node/131
Accept: application/json
Example response
204: No Content
The relationships on a node has to be deleted before the node can be deleted.
Example request
DELETE http://localhost:7474/db/data/node/132
Accept: application/json
Example response
409: Conflict
Content-Type: application/json
{
"message" : "The node with id 132 cannot be deleted. Check that the node is orphaned before deletion.",
"exception" : "OperationFailureException",
"stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.deleteNode(DatabaseActions.java:231)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNode(RestfulGraphDatabase.java:248)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}Copyright © 2013 Neo Technology