A short tutorial showing how to grab your HQ Trivia API Authentication Key for Use with HQ Trivia Bots or API Calls.
- Charles Proxy
- An iOS or Android Device (We will be using iOS but the process is the same)
- A computer that can run Charles Proxy.
First we need to open Charles Proxy. If you haven't already downloaded it go ahead and do that now. Navigate to Proxy > Proxy Settings like this.
From here you will need to setup your proxy settings. We need to change our port to something other than 8080. I chose 8000.
After this we need to setup our SSL settings. To do this navigate to Proxy > SSL Proxying Settings.
![alt text[(https://i.imgur.com/vedJ6th.png)
From here we need to add a client. For HQ Trivia we can add this:
After that we need to set-up the client certificates. In order to do this navigate to the Client Certificate tab in your SSL Proxying Settings. Add a new client and input this:
(Replace the "phone local host" with whatever your phones IP Address is. You can find this by going to Settings > Wifi > The little (i) next to your Wi-Fi connection.)
Picture of Charles:
My iPhones IP:
Now we move to our phone. For this tutorial I'm using iOS 12 on an iPhone 7 so it should work for anybody. On Android everything is practically the same but when installing the root certifiate you just navigate to the directory you saved it in (easiest to save to SD card) and press on the certificate. It will auto-install it.
On our iPhone we need to navigate to Settings. From Settings go into Wifi settings and press on the little (i) next to your home network. It should bring you to a screen like this:
From here press on Proxy and change it to Manual. Fill in the information with the IP from your computer. (You can find this with ipconfig on Windows and ifconfig on Unix)
Replace "computer.local.host" with your computers IP address. (Mine was 10.0.0.144. Common ones include 192.168.0.XXX, 192.168.1.XXX, and 10.0.0.XXX)
Now we need to start the intercepter in Charles Proxy in order to download the SSL Certificate. In order to do this press the little Recorder button on Charles Proxy shown here:
Now we need to navigate to charlesproxy.com/getssl on our device. You should get something like this pop up:
Press allow and continue the installation of the certificate. If you are on Android is basically the same thing just save it to an SD Card or your file system, naviagte to it and press on the cert to install it.
Now we need to go to Settings > General > About > Certificate Trust > and Trust Charles Proxy. It should look like this:
We are all set-up to start using Charles Proxy on our devices!
Now for the fun part. Intercepting the traffic and pulling our API key from the headers. For the HQ Trivia API you need your user authentication which is sent everytime you open the app.
Start recording on Charles Proxy and open up HQ Trivia on your device. You will see https://api-quiz.hype.space show up with some directories below it. These should look like this in the sidebar:
If you have this it's working! Simply click on any file inside that directory and in the right window of Charles Proxy you will see this!
That "Authentication:" key is what we need. You're all set-up to start calling the HQ Trivia API now with your Authentication Key! Hope this helped out!
Twitter: @maxbridgland Discord Link for Dev Server: Here Donations: Here