HTTPS SSH

Dizeez API Documentation

Genes API:

GET /genes/

Returns an array of all possible Gene objects that match the filtering queries.

Query string parameters:

?range: The number of genes to return (example: ?range=50 returns 50 different disease objects)

?area: The areas of disease to return (example: ?area=cancer returns diseases that are linked to cancer)

?family: The genes that fall under a particular protein family (example: ?family=kinases returns diseases are linked to specific kinases)

Sample JSON object:

This will return an array of objects of type Gene, which can be seen in the next section.

GET /genes/[id]

Returns a specific disease by Entrez ID parameter.

Sample JSON object:

{
    "id": "6756", 
    "gene_symbol" : "SSX1"
    "gene_name": "synovial sarcoma, X breakpoint 1", 
    "family" : "transcriptional repressor",
    "disease": 
    {
        "disease_name" : "synovial sarcoma",
        "area" : "cancer"
        "doid" : "5485", 
    }
}

POST /genes/

Adds a new Gene object into the database. Returns a success or error message.

Sample JSON objects:

{
    "success" : "true",
    "id": "6756",
    "code" : "100",
    "message" : "Gene successfully added to the database."
}

{
    "success" : "false",
    "id": "null",
    "code" : "101",
    "message" : "Gene improperly formatted."
}

PUT /genes/[id]

Updates an existing Gene object in the database. Returns a success or error message.

Sample JSON objects:

{
    "success" : "true",
    "code" : "200",
    "message" : "Gene successfully updated in the database."
}

{
    "success" : "false",
    "code" : "201",
    "message" : "Gene improperly formatted."
}

DELETE /genes/[id]

Deletes an existing Gene object in the database. Returns a success or error message.

{
    "success" : "true",
    "code" : "300",
    "message" : "Gene successfully deleted from the database."
}

{
    "success" : "false",
    "code" : "301",
    "message" : "Gene was not deleted due to database error."
}

Games API:

GET /games/

Returns a list of all possible Game objects that match the filtering queries.

Query string parameters:

?range: The number of games to return. (example: ?range=50 returns 50 games)

?user: Returns the games that involve this user. (example: ?user=clarence returns games where user clarence is playing)

Sample JSON object:

This will return an array of objects of type Game, which can be seen in the next section.

GET /games/[id]

Returns a specific Game object with the information given by the query.

Sample JSON object:

{
    "id" : "5678",
    "round" : "3",
    "namer" : "ben",
    "guesser" : "clarence",
    "points" : "110",
    "guess_target" : "synovial sarcoma",
    "types" : 
    {
        "clue_type:" "gene",
        "guess_type": "disease"
    },
    "identifiers" : 
    {
        "clue_identifier" : "entrez",
        "guess_identifier" : "hdo"
    },
    "clues" : 
    [
        {
            "id" : "5678_7157",
            "value" : "TP53",
            "guessed_time" : "2012-05-09T08:51:57.936Z"
        },
        {
            "id" : "5678_3717",
            "value" : "JAK2",
            "guessed_time" : "2012-05-09T08:52:58.760Z"
        }
    ],
    "guesses" : 
    [
        {
            "id" : "5678_3257",
            "value" : "osteosarcoma",
            "guessed_time" : "2012-05-09T08:59:42.418Z"
        },
        {
            "id" : "5678_9032",
            "value" : "breast cancer",
            "guessed_time" : "2012-05-09T08:59:43.174Z"
        }
    ],
    "complete" : "false"
}

GET /games/[game_id]/guesses/

Return a list of all possible Guess objects in the specified Game that match the filtering queries.

NOTE: This resource concatenates both the "clues" and "guesses" fields in the Game. To return only a single field, use the "?type" filter.

Query string parameters:

?range: The number of guesses to return (example: ?range=50 returns 50 guesses)

?type: The type of guesses to return. (example: ?type=disease will return the guesses that are of type "disease")

Sample JSON object:

This returns an array of objects of type Guess, which can be seen in the next section.

GET /games/[game_id]/guesses/[guess_id]

Returns a specific Guess object in the specified Game with the information given by the query.

Sample JSON object:

{
    "id" : "5678_9032",
    "value" : "breast cancer",
    "type" : "disease",
    "identifier" : "hdo",
    "guessed_time" : "2012-05-09T08:59:43.174Z"
}

POST /games/

Adds a new Game object into the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "id" : "5678",
    "code" : "100",
    "message" : "Game successfully added to the database."
}

{
    "success" : "false",
    "id" : "null",
    "code" : "101",
    "message" : "Game improperly formatted."
}

POST /games/[game_id]/guesses/

Adds a new Guess object into the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "id" : "5678_9032",
    "code" : "110",
    "message" : "Guess in Game successfully added to the database."
}

{
    "success" : "false",
    "id" : "null",
    "code" : 111",
    "message" : "Guess in Game improperly formatted."
}

PUT /games/[id]

Updates an existing Game object in the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "id" : "5678",
    "code" : "200",
    "message" : "Game successfully updated in the database."
}

{
    "success" : "false",
    "id" : "5678",
    "code" : "201",
    "message" : "Game improperly formatted."
}

PUT /games/[game_id]/guesses/[guess_id]

Updates an existing Guess object in a specified Game in the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "id" : "5678_3257",
    "code" : "210",
    "message" : "Guess in Game successfully updated in the database."
}

{
    "success" : "false",
    "id" : "null",
    "code" : "211",
    "message" : "Guess in Game improperly formatted."
}

DELETE /games/[id]

Deletes an existing Game object in the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "code" : "300",
    "message" : "Gene successfully deleted from the database."
}

{
    "success" : "false",
    "code" : "301",
    "message" : "Gene was not deleted due to database error."
}

DELETE /games/[game_id]/guesses/[guess_id]

Deletes an existing Guess object from the specified Game in the database. Returns a success or error message.

Sample JSON object

{
    "success" : "true",
    "id" : "5678_3257",
    "code" : "310",
    "message" : "Guess successfully deleted from Game."
}

{
    "success" : "false",
    "id" : "5678_3257",
    "code" : "311",
    "message" : "Guess was not deleted from Game due to database error."
}

Users API:

GET /users/

Returns a list of all possible User objects that match the filtering queries.

Query string parameters:

?range: The number of users to return. (example: ?range=50 will return 50 users)

?starts_with: The letters the user to be searched for starts with. (example: ?starts_with=clar can return user "clarence")

Sample JSON object:

This returns an array of User objects, detailed below.

GET /users/[name]

Returns a single User object with the given username.

Sample JSON object:

{
    "id": "2345",
    "name": "clarence",
    "games_played": "6",
    "points": "450"
}

POST /users/

Adds a new User object to the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "name": "clarence",
    "code" : "100",
    "message" : "User successfully added to the database."
}

{
    "success" : "false",
    "name": "null",
    "code" : "101",
    "message" : "User improperly formatted."
}

PUT /users/[name]

Updates an existing User object in the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "name" : "clarence",
    "code" : "200",
    "message" : "User successfully updated in the database."
}

{
    "success" : "false",
    "name" : "clarence",
    "code" : "201",
    "message" : "User improperly formatted."
}

DELETE /users/[name]

Deletes an existing User object in the database. Returns a success or error message.

Sample JSON object:

{
    "success" : "true",
    "name" : "clarence",
    "code" : "300",
    "message" : "Gene successfully deleted from the database."
}

{
    "success" : "false",
    "name" : "clarence",
    "code" : "301",
    "message" : "Gene was not deleted due to database error."
}