{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the edge was created successfully. ",
"code": "202"
},
{
"reason": "is returned if the edge collection was not found. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "True",
"name": "collection",
"description": "Creates a new edge in the collection identified by collection name. "
},
{
"dataType": "String",
"paramType": "query",
"required": "True",
"name": "from",
"description": "The document handle of the start point must be passed in from handle. "
},
{
"dataType": "String",
"paramType": "query",
"required": "True",
"name": "to",
"description": "The document handle of the end point must be passed in to handle. "
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "edge-document",
"description": "A JSON representation of the edge document must be passed as the body of the POST request. This JSON object may contain the edge's document key in the _key attribute if needed. "
}
],
"notes": "from handle and to handle are immutable once the edge has been created.
In all other respects the method works like POST /document, see @ref RestDocument for details.
",
"summary": "creates an edge",
"httpMethod": "POST",
"examples": "Create an edge and reads it back:
unix> curl -X POST --data @- --dump - http://localhost:8529/_api/edge/?collection=edges&from=vertices/1&to=vertices/2\n{\"name\":\"Emil\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"193604828\"\nlocation: /_api/document/edges/193604828\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/193604828\", \n \"_rev\" : \"193604828\", \n \"_key\" : \"193604828\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/edge/edges/193604828\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"193604828\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/193604828\", \n \"_rev\" : \"193604828\", \n \"_key\" : \"193604828\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n\n