I saw a post talking about API keys and why they should be private and I was wondering what are they?
APIs give one program access to another program,
For example, if I had a discord API inside of roblox, it would give me access to discord’s services from roblox.
API keys can be seen as a verification so that only those who should be accessing can access it.
You can see it as a key to your house, people with the key can access your house, you shouldnt give this away to other people or they can access your house with unrestricted access.
Also, how do you use them?
30 Characters
Usually you would be provided one by the service you want to communicate to.
When you send a request to the other service, you would pass along that API key to the service, and the service would verify that you are the person they are expecting based on the API key they have on their end.
so you mean like discord or like another scripting application like visual studio?
30Characters?
Let’s say you and your friends have all started riding your bikes a lot and they are starting to break. You all want to repair them yourselves to save some money but that means you all need the right tools. Instead of purchasing the tools individually you decide to open your own bike repair shop for your friends to all come in and use the tools. Now you can all save money by sharing those same tools.
Some other bike enthusiasts see your free repair shop and also start using your tools eventually breaking some which really sucks. To stop this you give each of your friends a key to your shop so only they can enter.
In this example the bike shop is the API, it provides a service you want to limit to a set of users. Users without a key cannot use your API. You can also have varying levels of access, for example your key might let you get into a private room where you keep all your own stuff but your friend’s keys won’t let them in there.
An API can provide any kind of service, including dangerous tools such as admin commands for your game, so it’s important to keep your keys private.
i like that anwser but how do i use them like when im coding?
You just include them when you make an API request, similar to adding an argument to a function call. This differs depending on the API being used and typically there will be documentation showing you how to provide an API key.
sorry for asking so much I’m new to programming how do I do that I still don’t understand how to make an API request i asked you in pm
So for example in a game if you have a higher level then you can enter secret places. So in this case the secret place is the API and the key is the higher level. Am I right?
yes but how do you make them?
30 Characters
Most developers don’t make APIs. They just utilize other APIs such as Trello, Discord, etc.
ohh ok i want to make one for discord
Describe what you want it to do.
i just want to make a API bot or a webhook so i can chat on my discord through roblox.