Authenticating with API Key

To get started with Discord Place API, you need to authenticate your requests using an API key. This key is used to verify your identity and access the data you need to manage your bot effectively.

API keys should be kept secure and not shared with anyone. If you suspect that your API key has been compromised, you can regenerate it at any time.

Using API Key

To authenticate your requests with an API key, you need to include the key in the Authorization header of your HTTP requests.

Here's an example of how to include your API key in a certain languages:

const axios = require('axios');

const apiKey = process.env.DISCORD_PLACE_API_KEY; // You should use environment variables to store your API key

const mockData = { // This is just a mock data to demonstrate the usage
  command_count: 0
}

axios.patch('https://api.discord.place/bots/YOUR_BOT_ID/stats', mockData, {
  headers: {
    'Authorization': apiKey
  }
})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });

You've successfully authenticated your requests with an API key. You can now use this key to access the data you need to manage your bot effectively. If you have any questions or need further assistance, feel free to reach out to our support team.

Last updated