Fortnite & Discord Integration

Number of APIs: 6

Overview

This collection allows you to configure a Discord bot to get user stats from the popular video game Fortnite. By leveraging the Fortnite-API and Qodex Monitors, when a user in Discord makes a request, it automatically triggers a Monitor run in Qodex and sends the information back to Discord using webhooks.

Steps

  • Obtain [Qodex API key]
  • Populate the environment with username and environment variables.
  • Run the request called Create webhookUrl to run Monitor. Copy the webhookUrl from the response. This URL will be the destination of a POST request sent by the Discord Bot, which will ultimately trigger a manual monitor run.
  • Set up your own Bot and Webhooks in Discord. Copy the Webhook URL from Discord Server and the Discord Bot token.
  • Copy Discord Bot code from GitHub repo.
  • Set up a server for your Discord Bot to be run, or just copy/paste into a REPL environment for testing.
  • Make a valid request from Discord and your bot should return user stats: !fn user <username>.
  1. Receive Discord message and reply with info - Get Fortnite user stats GET {{base_url}}/stats/br/v2?name={{query_name}}

  2. Receive Discord message and reply with info - Post message to Discord POST https://discord.com/api/webhooks/{{discord_webhook_id}}

  3. Qodex Webhook - Create webhookUrl to run Monitor POST https://api.getpostman.com/webhooks

  4. Qodex Webhook - Qodex Webhook to run Collection POST https://newman-api.getpostman.com/run/13455110/f6ca46ad-c81a-486f-982e-cf1de489ccdf

  5. Fortnite Stats - Create Leaderboard GET {{base_url}}/stats/br/v2?name={{default_user}}

  6. Fortnite Stats - Get Playlists GET {{base_url}}/playlists