Initial Testing¶
This specific section should help you to verify and understand how and if you requests work.
The First Request¶
To make your first request I recommend a program like Postman.
But why would we need that?
Simply because it is easier to use if you want to make requests to the API and you can quickly test and check specific API endpoints. You can add your API Key which we will need for some actions and you can format the JSON much more easier as well.
Once you downloaded the program you will be prompted to sign in (You can skip that at the bottom). Afterwards we can try to make our first request to the WAX ExpressTrade API.
Our first request will not require an VGO API Key. At the top input bar where it says
Enter request URL
type in something like https://api-trade.opskins.com/ICase/GetCaseSchema/v1
and choose GET
as your request method.If it was successful, you should see something like that in the image above.
Well that was easy, but you also could have done that request in your browser by typing in the URL.
The Second Request¶
Now we want to make a request that requires the API Key. The WAX ExpressTrade API has a “Basic Authorization” System. This means we have to convert your VGO API Key to Base64 before we make our request.
- Head over to https://www.base64encode.org/.
- Type in your API Key and add a colon
:
at the end of it so it looks something like this47319062320152072c7da23f51327d:
- Hit ENCODE and copy the Base64 string
- Head over to Postman again and click on the tab “Headers”
- For the Key you need to type in
Authorization
and for the Value you have to type inBasic YOUR_BASE64_STRING
- Once this header is set you can choose an API endpoint that requires the API key. In this case I chose
https://api-trade.opskins.com/IItem/GetItems/v1/
to get all the items and stats to each item in the cases.
If you messed up something it probably will have a response like
{
"status": 401,
"time": 1535573754,
"message": "API Key Required"
}
Troubleshooting¶
- Check if you have ticked the box to send the
Authorization Header
- Check your
Key
andValue
for this specific header - Check your Base64-String. Does it end with “==” or not?
- Check your String before converting it to Base64. Have you added to colon
:
? - Try a new API Key, or this one, used for the tutorial
NDczMTkwNjIzMjAxNTIwNzJjN2RhMjNmNTEzMjdkOg==
Conclusion¶
So you have successfully requested data from the WAX ExpressTrade API. You can also POST data to the API. Search for a POST request in the “Advanced Documentation”, add your API Key like we did in the tutorial above and POST your data.
Of course you can try different endpoints, scroll through all the JSON-Data the server has returned and check it’s content or use other request types such as POST.
But all in all this is pretty easy isn’t it? But we want to implement this into a website, not just requesting data in Postman to view it.