HTTP GET /Api/Public
Responsecode 200 OK
HTTP GET /Api/Private
Authorization: Bearer
Responsecode 200 OK
Responsecode 401 UNAUTHORIZED
HTTP GET /Api/Claims
Responsecode 200 OK
Content-Type: application/json
[
{
"type": "iss",
"value": "https://rpgcharapi.eu.auth0.com/"
},
{
"type": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
"value": "uniqueIdForUser"
},
{
"type": "aud",
"value": "https://rpgCharAuthUrlIdentifier.hi"
},
{
"type": "aud",
"value": "https://rpgcharapi.eu.auth0.com/userinfo"
},
{
"type": "iat",
"value": "1557211299"
},
{
"type": "exp",
"value": "1557218499"
},
{
"type": "azp",
"value": "6bD17UhET0jgkqvnuCZ7Zcv06tipiVx1"
},
{
"type": "scope",
"value": "openid profile email "
}
]
HTTP GET /api/mock
Responsecode 200 OK
Content-Type: application/json
{
"profile": {
"characterName": "Testy testerson",
"characterImage": "Url here",
"background": "Is this a duplicate from Features and traits?",
"playerName": "U+1F618",
"race": "U+1F364",
"alignment": "Truly evil",
"diety": "Null",
"typeClass": "God",
"gender": "No",
"age": "23",
"level": 2,
"exp": "Milestone"
},
"traits": [
{
"name": "Trait name",
"race": "Racism",
"description": "Trait"
}
],
"items": [
{
"name": "Woah",
"desc": "Oh no",
"qty": 1,
"weight": 154.0,
"cost": 14,
"currencyDenomination": "SP",
"equippable": false,
"isEquipped": false
}
],
"abilityScores": [
{
"value": 8,
"name": "cha"
},
{
"value": 7,
"name": "con"
},
{
"value": 6,
"name": "dex"
},
{
"value": 5,
"name": "int"
},
{
"value": 4,
"name": "str"
},
{
"value": 3,
"name": "wis"
}
],
"status": [
{
"identifier": "Dead,y",
"type": "Forcy",
"name": "Unknown",
"value": 13
}
],
"hitDice": [
{
"hitDiceUsed": 1,
"extraHitDice": 0
}
],
"health": {
"maxHitpoints": 6,
"tempHitpoints": 2,
"damage": 1
},
"savingThrows": [
{
"name": "Dex",
"proficiency": true
},
{
"name": "Int",
"proficiency": false
}
],
"skills": [
{
"bonusModifier": 1,
"name": "Prospecting",
"abilityScore": "wis",
"proficiencyModifier": 2.0
},
{
"bonusModifier": 4,
"name": "Sneaking",
"abilityScore": "dex",
"proficiencyModifier": 0.5
}
],
"hitDiceType": [
{
"hitDiceType": "d8"
}
],
"deathSave": [
{
"deathSaveSuccess": false,
"deathSaveFailure": true
},
{
"deathSaveSuccess": true,
"deathSaveFailure": false
}
],
"treasure": [
{
"platinum": 1,
"gold": 0,
"electrum": 4,
"silver": 0,
"copper": 0
}
],
"characterAppearance": [
{
"height": "Height",
"weight": "Weight",
"hairColor": "Hair",
"eyeColor": "Eye",
"skinColor": "Skin"
}
],
"featuresTraits": [
{
"background": "Noble",
"ideals": "Few",
"flaws": "Very",
"bonds": "Bondy bond"
}
],
"equipment": {
"weapons": [
{
"name": "Weapon",
"type": "Type",
"dmg": "2d6",
"handedness": "Left",
"proficiencyModifier": 0.5,
"price": 1,
"currencyDenomination": "d",
"hit": -1,
"toHitModifier": -1,
"weight": 1,
"range": "5ft",
"damageType": "Force",
"property": "Prop",
"description": "Lightsaber",
"quantity": 1
}
],
"armor": [
{
"name": "Name",
"type": "Type",
"price": 1,
"magicalModifier": 1,
"currencyDenomination": "What",
"weight": 12,
"class": 11,
"stealth": "1",
"description": "Desc",
"equipped": "eq"
}
]
},
"magicItems": [
{
"name": "Boy",
"type": "Unknown",
"rarity": "Legendary",
"requiresAttunement": true,
"attuned": true,
"maxCharges": 1,
"charges": 0,
"weight": 14,
"description": "No ide"
}
],
"notes": [
{
"text": "Test text",
"isSavedChatNotes": true
}
],
"spells": {
"spellcastingAbility": "All so fuck you",
"spellSaveDc": 19,
"spellAttackBonus": 42,
"spellsKnown": 1,
"cantripsKnown": 1,
"invocationsKnown": 1,
"maxPrepared": 13,
"spellSlots": [
{
"level": 1,
"usedSpellSlots": 0,
"resetsOn": "Seconds",
"availableSpellSlots": 0
}
],
"spellList": [
{
"name": "Lie",
"prepared": true,
"alwaysPrepared": true,
"type": "All",
"saveAttr": "Int",
"dmg": "6d8",
"dmgType": "Psycic",
"school": "Godlike",
"level": 99,
"description": "Tells a lie",
"castingTime": "1 turn",
"range": "32ft",
"components": "Verbal",
"duration": "Lifetime",
"materialComponents": "None",
"isRitual": false
}
],
"cantrips": [
{
"name": "Lie",
"type": "All",
"saveAttr": "Int",
"dmg": "6d8",
"dmgType": "Psycic",
"school": "Godlike",
"description": "Tells a lie",
"castingTime": "1 turn",
"range": "32ft",
"components": "Verbal",
"duration": "Lifetime",
"materialComponents": "None",
"isRitual": false
}
]
},
"feats": [
{
"name": "Halfling nibleness",
"description": "Allows you to sneak past friends"
}
],
"id": "5d570c55973bac2e48a57af0",
"ownerID": "Unique ID for owner from identity federation",
"_created": "2019-08-16T20:04:37.561Z",
"_lastUpdated": "2019-08-16T20:04:37.561Z",
"gameSystem": "RpgCharModel"
}
The Generic controller under the root path of \ is a result of testing reflection and having fun with generics with a result of a working API.
This will return a list of all ID's connected to user logged in.
HTTP GET /
Responsecode 200 OK
Content-Type: application/json
["Array","of","the","ids"]
Current supported gameSystems are RpgChar and CallOfCthulu.
HTTP POST /create/{gameSystem}
{
Optional Json body
}
Responsecode 200 OK
Content-Type: application/json
"{idOfNewCharacter}"
This will return all the properties of the requested id (if found) as a list of URLs.
HTTP GET /{id}
Example response for a campaign
Responsecode 200 OK
Content-Type: application/json
{
"characters": "/5cf11bbb8ca3773b6ce45eda/characters",
"session": "/5cf11bbb8ca3773b6ce45eda/session",
"campaignImage": "/5cf11bbb8ca3773b6ce45eda/campaignImage",
"campaignType": "/5cf11bbb8ca3773b6ce45eda/campaignType"
}
Using the result from the previous request you get a series of links you can do GET or PUT requests to,
if you send a GET request to a property url you will get the structure of that property.
HTTP GET /{id}/profile
Responsecode 200 OK
Content-Type: application/json
{
"characterName": null,
"playerName": null,
"occupation": null,
"age": null,
"sex": null,
"residence": null,
"birthplace": null
}
Continuing to use the result from our previous GET we can see what properties are available.
We will use this to update the characterName and occupation as an example.
HTTP PATCH /{id}/profile
{
"characterName": "H.P. LoveCraft",
"occupation": "Weird writer"
}
Responsecode 200 OK
Content-Type: application/json
{
"characterName": "H.P. LoveCraft",
"playerName": null,
"occupation": "Weird writer"
"age": null,
"sex": null,
"residence": null,
"birthplace": null
}
This deletes a character
HTTP DELETE /{id}
Responsecode 200 OK
Content-Type: application/json
{Id of deleted character}
Campaigns are quite simple. A list of characterIds and sessions.
Create one, add some characters and start playing sessions!
Create a campaign for a game system, currently supported are RpgCharModel and CallOfCthulu
HTTP POST /campgain/create/{gameSystem}
Responsecode 200 OK
Content-Type: application/json
{Id of new campagin}
To add a character simply send add the ID of the character to a campaign, make sure they are created using the same gameSystem!
HTTP POST /campgain/{campaignId}/add/{characterId}
Responsecode 200 OK
Content-Type: application/json
{Id of campagin}
This api and its methods are for getting and manipulating either an entire RpgChar or only parts of its model.
All of the methods available in /RpgChar are also available under the alias /characters
It's made with the idea that you can access parts of the model using the same accessor as in JavaScript. Access the api by using /RpgChar/{idOfChar}/{partToGetOrModify}
HTTP GET /RpgChar
Responsecode 204 No Content
The model structure is identical to the the one returned from api/Mock.
The return type of this is a list of characters.
Responsecode 200 OK
Content-Type: application/json
[
{
"abilityScores": {...},
"characterAppearance": {...},
"deathSave": {...},
"equipment": {...},
"feats": {...},
"featuresTraits": {...},
"health": {...},
"hitDice": {...},
"hitDiceType": {...},
"id": "5cd122da686a1f1b20a79b16",
"items": {...},
"magicItems": {...},
"notes": {...},
"ownerID": "uniqueIdForUser",
"profile": {...},
"savingThrows": {...},
"skills": {...},
"spells": {...},
"status": {...},
"traits": {...},
"treasure": {...}
},
{
"abilityScores": {...},
"characterAppearance": {...},
"deathSave": {...},
"equipment": {...},
"feats": {...},
"featuresTraits": {...},
"health": {...},
"hitDice": {...},
"hitDiceType": {...},
"id": "5cd1249b5dea4bee34710778",
"items": {...},
"magicItems": {...},
"notes": {...},
"ownerID": "uniqueIdForUser",
"profile": {...},
"savingThrows": {...},
"skills": {...},
"spells": {...},
"status": {...},
"traits": {...},
"treasure": {...}
},
{
"abilityScores": {...},
"characterAppearance": {...},
"deathSave": {...},
"equipment": {...},
"feats": {...},
"featuresTraits": {...},
"health": {...},
"hitDice": {...},
"hitDiceType": {...},
"id": "5cd1295c510de6556472430e",
"items": {...},
"magicItems": {...},
"notes": {...},
"ownerID": "uniqueIdForUser",
"profile": {...},
"savingThrows": {...},
"skills": {...},
"spells": {...},
"status": {...},
"traits": {...},
"treasure": {...}
}
]
HTTP GET /RpgChar/{id}
Responsecode 200 OK
Content-Type: application/json
{
"abilityScores": {...},
"characterAppearance": {...},
"deathSave": {...},
"equipment": {...},
"feats": {...},
"featuresTraits": {...},
"health": {...},
"hitDice": {...},
"hitDiceType": {...},
"id": "idPassedInTheRequest",
"items": {...},
"magicItems": {...},
"notes": {...},
"ownerID": "uniqueId",
"profile": {...},
"savingThrows": {...},
"skills": {...},
"spells": {...},
"status": {...},
"traits": {...},
"treasure": {...}
}
This method can take either nothing, an id for the new character, or an id for the new character and a model. It will always return the ID for the character if it can be created.
HTTP POST /RpgChar/
HTTP POST /RpgChar/{id}
HTTP POST /RpgChar/{id} with JsonBody
Responsecode 200 OK
Content-Type: application/json
"idOfNewCharacter"
This method is a lot like a previous create character, but it does not allow you to send in a body, but will instead pre-fill all fields with non-null variables, saving a lot of null-checks if such is wanted.
Request has an optional id.
HTTP GET /RpgChar/newChar/
HTTP GET /RpgChar/newChar/{id}
HTTP POST /RpgChar/newChar/
HTTP POST /RpgChar/newChar/{id}
Responsecode 200 OK
Content-Type: application/json
"idOfNewCharacter"
HTTP DELETE /RpgChar/{id}
Responsecode 200 OK
Content-Type: application/json
"idOfDeletedCharacter"
By using the part of the model you can get just a scoped response, this makes it more light weight for the front end if you want to load several characters, or if you want to test with just certain parts of the code.
HTTP GET /RpgChar/{id}/Profile
Responsecode 200 OK
Content-Type: application/json
{
"characterName": "Testy testerson",
"characterImage": "Url here",
"background": "Is this a duplicate from Features and traits?",
"playerName": "U+1F618",
"race": "U+1F364",
"alignment": "Truly evil",
"diety": "",
"typeClass": "God",
"gender": "No",
"age": "23",
"level": 2,
"exp": "Milestone"
}
HTTP GET /RpgChar/{id}/Traits
Responsecode 200 OK
Content-Type: application/json
{
"traits": [
{
"name": "Trait name",
"race": "Racism",
"description": "Trait"
}
]
}
HTTP GET /RpgChar/{id}/Items
Responsecode 200 OK
Content-Type: application/json
{
"items":[
{
"name": "Woah",
"desc": "Oh no",
"qty": 1,
"weight": 154,
"cost": 14,
"currencyDenomination": "SP"
}
]
}
HTTP GET /RpgChar/{id}/AbilityScores
Responsecode 200 OK
Content-Type: application/json
{
"abilityScores": {
"str": "4",
"dex": "6",
"con": "7",
"int": "5",
"wis": "3",
"cha": "8"
}
}
HTTP GET /RpgChar/{id}/Status
Responsecode 200 OK
Content-Type: application/json
{
"status": [
{
"identifier": "Dead,y",
"type": "Forcy",
"name": "Unknown",
"value": 13
}
]
}
HTTP GET /RpgChar/{id}/HitDice
Responsecode 200 OK
Content-Type: application/json
{
"hitDice": [
{
"hitDiceUsed": 1,
"extraHitDice": 0
}
]
}
HTTP GET /RpgChar/{id}/Health
Responsecode 200 OK
Content-Type: application/json
{
"health": {
"maxHitpoints": 6,
"tempHitpoints": 2,
"damage": 1
}
}
HTTP GET /RpgChar/{id}/SavingThrows
Responsecode 200 OK
Content-Type: application/json
{
"savingThrows": [
{
"name": "Dex",
"proficiency": true
},
{
"name": "Int",
"proficiency": false
}
]
}
HTTP GET /RpgChar/{id}/Skills
Responsecode 200 OK
Content-Type: application/json
{
"skills": [
{
"bonusModifier": 1,
"name": "Prospecting",
"abilityScore": "Wis",
"proficiencyModifier": 2
}
]
}
HTTP GET /RpgChar/{id}/HitDiceType
Responsecode 200 OK
Content-Type: application/json
{
"hitDiceType": [
{
"hitDiceType": "d8"
}
]
}
HTTP GET /RpgChar/{id}/DeathSave
Responsecode 200 OK
Content-Type: application/json
{
"deathSave": [
{
"deathSaveSuccess": false,
"deathSaveFailure": true
},
{
"deathSaveSuccess": true,
"deathSaveFailure": false
}
]
}
HTTP GET /RpgChar/{id}/Treasure
Responsecode 200 OK
Content-Type: application/json
{
"treasure": [
{
"platinum": 1,
"gold": 0,
"electrum": 4,
"silver": 0,
"copper": 0
}
]
}
HTTP GET /RpgChar/{id}/CharacterAppearance
Responsecode 200 OK
Content-Type: application/json
{
"characterAppearance": [
{
"height": "Height",
"weight": "Weight",
"hairColor": "Hair",
"eyeColor": "Eye",
"skinColor": "Skin"
}
]
}
HTTP GET /RpgChar/{id}/FeaturesTraits
Responsecode 200 OK
Content-Type: application/json
{
"featuresTraits": [
{
"background": "Noble",
"ideals": "Few",
"flaws": "Very",
"bonds": "Bondy bond"
}
]
}
HTTP GET /RpgChar/{id}/Equipment
Responsecode 200 OK
Content-Type: application/json
{
"equipment": {
"weapons": [
{
"name": "Weapon",
"type": "Type",
"dmg": "2d6",
"handedness": "Left",
"proficiencyModifier": 0.5,
"price": 1,
"currencyDenomination": "d",
"hit": -1,
"toHitModifier": -1,
"weight": 1,
"range": "5ft",
"damageType": "Force",
"property": "Prop",
"description": "Lightsaber",
"quantity": 1
}
],
"armor": [
{
"name": "Name",
"type": "Type",
"price": 1,
"magicalModifier": 1,
"currencyDenomination": "What",
"weight": 12,
"class": 11,
"stealth": "1",
"description": "Desc",
"equipped": "eq"
}
]
}
}
HTTP GET /RpgChar/{id}/MagicItems
Responsecode 200 OK
Content-Type: application/json
{
"magicItems": [
{
"name": "Boy",
"type": "Unknown",
"rarity": "Legendary",
"requiresAttunement": true,
"attuned": true,
"maxCharges": 1,
"charges": 0,
"weight": 14,
"description": "No ide"
}
]
}
HTTP GET /RpgChar/{id}/Notes
Responsecode 200 OK
Content-Type: application/json
{
"notes": [
{
"text": "Test text",
"isSavedChatNotes": true
}
]
}
HTTP GET /RpgChar/{id}/Spells
Responsecode 200 OK
Content-Type: application/json
{
"spells": {
"spellcastingAbility": "All so fuck you",
"spellSaveDc": 19,
"spellAttackBonus": 42,
"spellsKnown": 1,
"cantripsKnown": 1,
"invocationsKnown": 1,
"maxPrepared": 13,
"spellSlots": [
{
"level": 1,
"usedSpellSlots": 0,
"resetsOn": "Seconds",
"availableSpellSlots": 0
}
],
"spellList": [
{
"name": "Lie",
"prepared": true,
"alwaysPrepared": true,
"type": "All",
"saveAttr": "Int",
"dmg": "6d8",
"dmgType": "Psycic",
"school": "Godlike",
"level": 99,
"description": "Tells a lie",
"castingTime": "1 turn",
"range": "32ft",
"components": "Verbal",
"duration": "Lifetime",
"materialComponents": "None",
"isRitual": false
}
],
"cantrips": [
{
"name": "Lie",
"type": "All",
"saveAttr": "Int",
"dmg": "6d8",
"dmgType": "Psycic",
"school": "Godlike",
"description": "Tells a lie",
"castingTime": "1 turn",
"range": "32ft",
"components": "Verbal",
"duration": "Lifetime",
"materialComponents": "None",
"isRitual": false
}
]
}
}
HTTP GET /RpgChar/{id}/Feats
Responsecode 200 OK
Content-Type: application/json
{
"feats": [
{
"name": "Halfling nibleness",
"description": "Allows you to sneak past friends"
}
]
}
The following methods are all sub methods on a RpgChar for setting fields, they all use the PATCH verb and only fields passed inn will be updated.
The structure is the same as for getting parts and they all compliment them, the return of all api methods are the updated part.
Meaning if you update the health of a character using HTTP PATCH /RpgChar/{id}/Health you will get in return the same object as if you called HTTP GET /RpgChar/{id}/Health.
HTTP PATCH /RpgChar/{id}/Profile
HTTP PATCH /RpgChar/{id}/Traits
HTTP PATCH /RpgChar/{id}/Items
HTTP PATCH /RpgChar/{id}/AbilityScores
HTTP PATCH /RpgChar/{id}/Status
HTTP PATCH /RpgChar/{id}/HitDice
HTTP PATCH /RpgChar/{id}/Health
HTTP PATCH /RpgChar/{id}/SavingThrows
HTTP PATCH /RpgChar/{id}/Skills
HTTP PATCH /RpgChar/{id}/HitDiceType
HTTP PATCH /RpgChar/{id}/DeathSave
HTTP PATCH /RpgChar/{id}/Treasure
HTTP PATCH /RpgChar/{id}/CharacterAppearance
HTTP PATCH /RpgChar/{id}/FeaturesTraits
HTTP PATCH /RpgChar/{id}/Equipment
HTTP PATCH /RpgChar/{id}/MagicItems
HTTP PATCH /RpgChar/{id}/Notes
HTTP PATCH /RpgChar/{id}/Spells
HTTP PATCH /RpgChar/{id}/Feats