I'm trying to implement a C application that retrieves data from ArangoDB using REST and the graph API, but when I try to create a graph I get the message:
{"error":true,"code":501,"errorNum":9,"errorMessage":"unknown path '_api/graph'"}
I can successfully use the document API to insert documents but the graph API doesn't work.
In ArangoDB 1.1, this error is expected, because ArangoDB 1.1 does not yet have the graph API at /_api/graph.
It should work with ArangoDB 1.2. The current version of ArangoDB can be retrieved via either
arangod --version
or
curl -X GET http://127.0.0.1:8529/_api/version
(IP address and/or port may need to be adjusted)
If the server reports a version number less than 1.2, then the graph API is not yet available. If the server reports a version number of at least 1.2, then please try accessing the URL via cURL:
curl -X POST --dump - --data '{"vertices":"myVertices","edges":"myEdges","_key":"myGraph"}' http://127.0.0.1:8529/_api/graph
This should return something non-HTTP 501 result, e.g.:
HTTP/1.1 201 Created
server: triagens GmbH High-Performance HTTP Server
connection: Keep-Alive
content-type: application/json; charset=utf-8
content-length: 137
{"graph":{"_id":"_graphs/myGraph","_rev":"12347803","_key":"myGraph","vertices":"myVertices","edges":"myEdges"},"error":false,"code":201}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With