Documentation example
Feat APIβ
Feat API is a CRUD (Create, Retrieve, Update, Delete) API that enables a community to manage TRPG (Tabletop Role-Playing Game) feats in an online database.
π Tip: Feats are abilities players can select to enhance their characters in numerous TRPGs, such as Pathfinder, Dungeons & Dragons, or Starfinder.
You can either use cURL commands or the Swagger UI to manage feats with the Feat API. Some commands require a valid API Key to authenticate requests, which you can generate using Discord.
https://feat-api.onrender.com/
Generating API Keysβ
Creating, updating, and deleting feats requires a valid API Key!
To generate an API Key:
- Log in to your Discord account, and open the #general channel of the Technical Writer's Weekly Discord group.
π Tip: If you are not a member of the Technical Writer's Weekly Discord group, or you don't have a Discord account, you can follow this link to sign up!
- Enter
!createApiKey
in the #general channel.
- Check your direct messages. A Discord bot called "featAPIKey" should have sent you your API Key.
That's it! You can add your API Key to your HTTP header to authenticate your requests.
Featsβ
You can manage the feats of the Feat API database using cURL commands or the Swagger UI.
Listing featsβ
To list all feats in the Feat API database:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Enter the following cURL command:
curl -X GET "https://feat-api.onrender.com/feats/get" -H "accept: application/json"
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on GET /feats/get to expand the tab.
- Click Try it out.
- Click Execute.
Retrieving a feat by IDβ
To retrieve a feat by filtering on its ID:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Enter the following cURL command replacing
FEAT-ID
with the ID of the feat you are trying to find:curl -X GET "https://feat-api.onrender.com/feats/get/FEAT-ID" -H "accept: application/json"
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on GET /feats/get/{/_id} to expand the tab.
- Click Try it out.
- Insert the feat ID you are trying to retrieve in the _id field.
- Click Execute.
Retrieving a feat by nameβ
To retrieve a feat by filtering on its name:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Enter the following cURL command replacing
FEAT-NAME
with the name of the feat you are trying to find:curl -X GET "https://feat-api.onrender.com/feats/get/find/FEAT-NAME" -H "accept: application/json"
π Tip: Make sure to replace "spaces" with %20, "(" with %28, and ")" with %29.
For example, you can filter on the feat called: "Awesome Blow (Monster)" by entering
curl -X GET "https://feat-api.onrender.com/feats/get/find/Awesome%20Blow%20%28Monster%29" -H "accept: application/json"
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on GET /feats/get/{/featName} to expand the tab.
- Click Try it out.
- Insert the name of the feat you are trying to retrieve in the featName field.
- Click Execute.
Creating a featβ
βΉοΈ Note: You must have a valid API Key to create feats. For more information on how to generate one, check out Generating API Keys! To create a new feat:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Call the POST method of the
feats/create
endpoint and set the following parameters in the request body:- "name": "string"
- "flavortext": "string"
- "prereq": "string"
- "benefit": "string"
- "source": "string"
π Tip: You will see a message pop up in the #general channel of the Technical Writer's Weekly Discord group that your feat has been created.
π Example: If you would like to add a feat called "Arcane Blast", it would look like this, simply replace `API-KEY` with your API Key:
curl -X POST "https://feat-api.onrender.com/feats/create" -H "accept: */*" -H "Authorization: API-KEY" -H "Content-Type: application/json" -d "{\"name\":\"Arcane Blast\",\"flavortext\":\"You can convert any spell into an attack.\",\"prereq\":\"Arcane spellcaster, caster level 10th.\",\"benefit\":\"As a standard action, you can sacrifice a prepared spell or unused spell slot of 1st level or higher and transform it into a ray, targeting any foe within 30 feet as a ranged touch attack. This attack deals 2d6 points of damage plus an additional 1d6 points of damage for every level of the spell or spell slot you sacrificed. 0-level spells may not be sacrificed in this manner.\",\"source\":\"Pathfinder Advanced Playerβs Guide\"}"
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on Authorize to bring up the Available authorizations panel.
- Add your API Key in the textbox, click Authorize, and close the panel.
- Click on POST /feats/create to expand the tab.
- Click Try it out.
- Fill out the values in the Request body.
- Click Execute.
π Tip: You will see a message pop up in the #general channel of the Technical Writer's Weekly Discord group that your feat has been created.
Updating a featβ
βΉοΈ Note: You must have a valid API Key to update feats. For more information on how to generate one, check out Generating API Keys!
To update a feat:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Call the PATCH method of the
feats/update/{_id}
endpoint replacing the _id with the ID of the feat you are trying to update. - Add your API Key to the header.
- Set the following parameters in the request body:
- "name": "string"
- "flavortext": "string"
- "prereq": "string"
- "benefit": "string"
- "source": "string"
π Example: If you would like to change the name of the feat called "Alertness" to "Awareness", it would look like this, simply replace `API-KEY` with your API Key:
curl -X PATCH "https://feat-api.onrender.com/feats/update/FEAT-ID" -H "accept: */*" -H "Authorization: API-KEY" -H "Content-Type: application/json" -d "{\"name\":\"Awareness\",\"flavortext\":\"You often notice things that others might miss.\",\"prereq\":\"N/A\",\"benefit\":\"You get a +2 bonus on Perception and Sense Motive skill checks. If you have 10 or more ranks in one of these skills, the bonus increases to +4 for that skill.\",\"source\":\"Pathfinder RPG Core Rulebook\"}"
Even though the only thing being changed is the feat's name, the other parameters must also be defined.
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on Authorize to bring up the Available authorizations panel.
- Add your API Key in the textbox, click Authorize, and close the panel.
- Click on PATCH /feats/update/{_id} to expand the tab.
- Click Try it out.
- Insert the feat ID you are trying to update in the _id field.
- Fill out the values in the Request body.
- Click Execute.
Deleting a featβ
βΉοΈ Note: You must have a valid API Key to delete feats. For more information on how to generate one, check out Generating API Keys!
To delete a feat:
- cURL
- Swagger UI
- Open the terminal or a CLI app of your choosing.
- Enter the following cURL command replacing
FEAT-ID
with the ID of the feat you are trying to delete and theAPI-KEY
with your API Key:curl -X DELETE "https://feat-api.onrender.com/feats/FEAT-ID" -H "accept: */*" -H "Authorization: API-KEY"
- Open https://swagger-test.onrender.com/docs/ in a browser of your choosing.π Tip: Depending on the current website capacity, this may take up to two minutes.
- Click on Authorize to bring up the Available authorizations panel.
- Add your API Key in the textbox, click Authorize, and close the panel.
- Click on DELETE /feats/delete/{_id} to expand the tab.
- Click Try it out.
- Insert the feat ID you want to delete in the _id field.
- Click Execute.