Skip to content
Marco Vázquez edited this page May 13, 2019 · 11 revisions

Welcome to the yorha-api wiki!

Currently the api has four possible routes for client consume.

  • localhost:8080/automatas

  • localhost:8080/weapons

  • localhost:8080/podprograms

  • localhost:8080/bosses

With the basic http methods.

Every method have basic auth. User: admin, Password: password

  • GetAll: localhost:8080/{route}

  • GetOne: localhost:8080/{route}/{id}

  • Post: localhost:8080/{route}

  • Put: localhost:8080/{route}/{id}

  • Delete: localhost:8080/{route}/{id}

localhost:8080/automatas

Get

{
    "ID": 1,
    "CreatedAt": "2019-03-22T20:37:12-06:00",
    "UpdatedAt": "2019-03-22T20:37:12-06:00",
    "DeletedAt": null,
    "Name": "9S",
    "Occupation": "YoRHa",
    "Photo": "https://nierautomata.wiki.fextralife.com/file/Nier-Automata/yorha_2S_character.png",
    "RaceID": 1,
    "Race": {
        "ID": 1,
        "CreatedAt": "2019-03-22T20:37:12-06:00",
        "UpdatedAt": "2019-03-22T20:55:04.095414252-06:00",
        "DeletedAt": null,
        "Name": "Android"
    }
}

Post

It is necessary to previously have the Race with id 2 in the proper table.

{
    "name": "9S",
    "occupation": "YoRHa",
    "photo": "https://nierautomata.wiki.fextralife.com/file/Nier-Automata/yorha_2S_character.png",
    "raceID": 2
}

localhost:8080/weapons

Get

{
    "ID": 1,
    "CreatedAt": "2019-03-23T17:44:12-06:00",
    "UpdatedAt": "2019-03-23T17:44:12-06:00",
    "DeletedAt": null,
    "Name": "Beastbane",
    "MinAttack": 190,
    "MaxAttack": 210,
    "Ability": "Beast roar",
    "Photo": "https://nierautomata.wiki.fextralife.com/file/Nier-Automata/beastbane_01.jpg",
    "ClassID": 1,
    "Class": {
        "ID": 1,
        "CreatedAt": "2019-03-23T17:44:12-06:00",
        "UpdatedAt": "2019-03-23T17:48:29.592897867-06:00",
        "DeletedAt": null,
        "Name": "Small sword"
    }
}

Post

It is necessary to previously have the Class with id 1 in the proper table.

{
    "name": "Beastbane",
    "minAttack": 190,
    "maxAttack": 210,
    "ability": "Beast roar",
    "photo": "https://nierautomata.wiki.fextralife.com/file/Nier-Automata/beastbane_01.jpg",
    "classID": 1
}

localhost:8080/podprograms

Get

{
    "ID": 1,
    "CreatedAt": "2019-03-22T20:37:12-06:00",
    "UpdatedAt": "2019-03-22T20:37:12-06:00",
    "DeletedAt": null,
    "Name": "R10: Laser",
    "Program": "R010",
    "Cooldown": 1300,
    "Photo": "https://vignette.wikia.nocookie.net/nier/images/7/7b/R010_Laser.jpg/revision/latest?cb=20190204040046"
}

Post

{
    "name": "R10: Laser",
    "program": "R010",
    "cooldown": 1300,
    "photo": "https://vignette.wikia.nocookie.net/nier/images/7/7b/R010_Laser.jpg/revision/latest?cb=20190204040046"
}

localhost:8080/bosses

Get

{
    "ID": 2,
    "CreatedAt": "2019-03-22T20:37:12-06:00",
    "UpdatedAt": "2019-03-22T20:37:12-06:00",
    "DeletedAt": null,
    "Name": "Engels",
    "Faction": "Special unit machines",
    "Zones": [
        {
            "ID": 2,
            "CreatedAt": "2019-03-22T20:37:12-06:00",
            "UpdatedAt": "2019-03-22T20:37:26-06:00",
            "DeletedAt": null,
            "Name": "Abandoned factory",
            "BossID": 2
        },
        {
            "ID": 3,
            "CreatedAt": "2019-03-22T20:37:12-06:00",
            "UpdatedAt": "2019-03-22T20:37:26.252385044-06:00",
            "DeletedAt": null,
            "Name": "City ruins",
            "BossID": 2
        }
    ],
    "Photo": "https://vignette.wikia.nocookie.net/nier/images/1/1b/Engels.png/revision/latest?cb=20170430090743"
}

Post

It will create the zones associations as well with the current boss id in the proper table.

{
    "name": "Engels",
    "faction": "Special unit machines",
    "zones": [
        {
            "Name": "Abandoned factory",
        },
        {
            "Name": "City ruins",
        }
    ],
    "photo": "https://vignette.wikia.nocookie.net/nier/images/1/1b/Engels.png/revision/latest?cb=20170430090743"
}

Put

In put method, if the requested zone have id it will be updated otherwise the zone will be created.

{
    "name": "Engels",
    "faction": "Special unit machines",
    "zones": [
        {
            "id": 2,
            "name": "Abandoned factory"
        },
        {
            "id": 3,
            "name": "City ruins"
        }
    ],
    "photo": "https://vignette.wikia.nocookie.net/nier/images/1/1b/Engels.png/revision/latest?cb=20170430090743"
}