Back to top

Graph Bank API

All API access is over HTTPS, and accessed from the https://api.graphbank.org. All data is sent and received as JSON.

Some APIs require authentication. Users can get API access token from user settings page.

graphs

Resources related to graphs

Graph database entry

Get a graph entry
GET/v1/graphs/{id}

Example URI

GET /v1/graphs/id
URI Parameters
HideShow
id
number (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "url": "https://graphbank.org/graphs/1000",
  "id": 1000,
  "name": "Test",
  "description": "Test graph",
  "vertices": 10,
  "edges": 20,
  "mdeg": 15,
  "aspl": 2.1,
  "connected": 1,
  "regular": 1,
  "submitted_by": "anonymous",
  "submitted_at": "2017-01-05T20:35:05.882463"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "id": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "vertices": {
      "type": "number"
    },
    "edges": {
      "type": "number"
    },
    "mdeg": {
      "type": "number"
    },
    "aspl": {
      "type": "number"
    },
    "connected": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "1: connected 0: non-connected"
    },
    "regular": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "1: regular 0: non-regular"
    },
    "submitted_by": {
      "type": "string"
    },
    "submitted_at": {
      "type": "string"
    }
  },
  "required": [
    "url",
    "id"
  ]
}

Graph database

Upload a graph
POST/v1/graphs/upload{?access_token}

Description

  • Available only for registered users

Example URI

POST /v1/graphs/upload?access_token=
URI Parameters
HideShow
access_token
string (required) 
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "Test graph 1",
  "description": "This is test graph 1",
  "content": "0 1\\n1 2\\n3 4"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "content": {
      "type": "string",
      "description": "adjacency list"
    }
  },
  "required": [
    "name",
    "description",
    "content"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "url": "https://graphbank.org/graphs/1000",
  "id": 1000,
  "is_success": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "id": {
      "type": "number"
    },
    "is_success": {
      "type": "number",
      "enum": [
        0,
        1
      ]
    }
  },
  "required": [
    "is_success"
  ]
}

Graph database entry

Delete a graph entry
DELETE/v1/graphs/{id}{?access_token}

Description

  • Available only for registered users

  • Only works for the user who submitted the graph

Example URI

DELETE /v1/graphs/id?access_token=
URI Parameters
HideShow
id
number (required) 
access_token
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1000,
  "is_success": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "is_success": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "1: success 0: fail"
    }
  },
  "required": [
    "id"
  ]
}

Generated by aglio on 26 Feb 2017