With the latest release of the Kinvey management console, we introduced our customers to a brand new feature, the API console. Today I’ll go over what the API console is, and how to get the most out of your learning and debugging efforts by using this powerful tool.
What is the API Console?
The API console is essentially an in-browser version of curl, a popular command line utility for making HTTP requests. Our version is inspired by hurl.it, the awesome web based version of curl from Twilio Labs. You can specify a URL, the HTTP method (GET, POST, PUT, or DELETE), and any additional headers you might want.
To try it out for yourself, head over to the Kinvey management console and navigate to an app backend you’ve created. Pick any collection, and you’ll see an “API Console” tab next to the Data Browser.
From here, you make requests to the Kinvey backend to query and post data to this collection. Note that we went ahead and prefilled the Authorization header for you so you don’t have to worry about base 64 encoding your username and password. Rollover the Authorization header to see the decoded version.
Another handy tip: the URL Target field will suggest possible API endpoints as you type. This can be a quick and easy way to explore the API itself. Just start typing to see some of your options.
A word of warning, however: be careful experimenting with live, production apps in the API Console. These are real requests affecting real data, so its probably best to learn about the DELETE requests on some test data!
When you are ready to try out the API, go ahead and hit “Send Request”. You should see your request as it was sent to the Kinvey backend, and the response received.
This is a great tool for debugging – not sure if you’ve got your queries wrong or if your application code is the problem? Just plug your API request in here and see the result.
If you’ve tested your queries and still are having trouble, fear not! If you got a response other than what you expected, just grab the request id from the response headers (X-Kinvey-Request-Id) and reference that when you email firstname.lastname@example.org. Our engineers will be able to look up your request and walk through the issue with you!