HTTP request action block

This page explains how to use CharmCord variables through the BotGhost custom builder.

Where to find this action block?

Simply type API in the search bar of the Blocks and you should find this block ready to be dragged into your Custom Builder.

While BotGhost has covered what the action block does, we will cover specifically how to use the Request Builder to access your variables through CharmCord.

What to put in the Request Builder?

GET & POST requests

Currently, CharmCord Database supports these two methods. Make sure you use the right method according to the specific endpoints otherwise your request may return an error.

  • GET allows you to retrieve information only

  • POST executes a function according to the endpoint

Request URL

This is where you insert the correct URL for the specific request.

To access variables in your CharmCord database, you would input https://www.charm-cord.com/database/ followed by the endpoints specified in Managing Variables and Set/Get Variables pages.

Path

This tells the API where it needs to go.

Currently you only use this when managing variables via the POST method and you can alter the URL as shown.

URL Params

This is also known as Query in the documents here. This tells the API what it needs to do.

  • key is the specific part of the variable you are referring to and should be entered exactly as noted in the documents

  • value is the information you set for that part of the variable, e.g. the name of your variable or the data associated with the variable

Testing the HTTP request

Provided that you entered the correct key and value in the right places as specified, testing your request should return something like this.

Otherwise, you will know what went wrong based on the response.

Note that testing a request does execute the action! Be careful what you do put in the request to avoid changing something you didn't want to.

Last updated