Raygun Reduces Tedious API Tasks with Postman
Approximately 50,000 developers use Raygun across 120+ countries. Billions of events are processed every single day through the Raygun platform, recording software errors and end user performance profiles to help technology companies build better software.
Launched in 2013, Raygun is headquartered in Wellington, New Zealand with a U.S. head office in Seattle, Washington. The team has 12 engineers building and maintaining the technology that deals with huge data volumes. The company is a software intelligence platform that records software errors (crash reporting) and end-user performance profiles (real user monitoring) to help technology companies create better user experiences and build better software.
Postman collections and folders for reusing payloads
During development, the team often needs to send data to the Raygun real user monitoring (RUM) API in various server environments. Postman is a convenient tool for building, saving, and sharing payloads. Organizing common examples within collections and folders makes it easy to find and resend the various types of requests that the team works with in their day-to-day.
Postman environments for switching server environments
Frequently, the engineers must change the endpoints’ URL to direct the requests to either the local, office, or production environment. However, the process of manually updating the URL is tedious and prone to errors. To streamline this step, the team created Postman environments. A few minutes of work up front to set up these environments saves time during every request thereafter.
“Postman provides a way to do this work for you, condensing this task down to a simple selector that switches between environments for all requests at once,” says Software Developer Jason Fauchelle.
Generate session IDs in Postman pre-request script
The Raygun API requires all payloads to contain a timestamp and session ID. The team relies on a Postman pre-request script to generate variables that are required for Raygun POST requests. Specifically, Raygun uses a collection-level script to create these elements. This is code that is written in JavaScript that will execute prior to every request grouped within that collection.
In other words, the team writes code in the Postman pre-request script section to generate required values, like a timestamp or session ID, before the request is sent. These values are saved as Postman variables. Then, these variables are included in the JSON body of the POST requests sent to the Raygun API.
In this manner, the developer can focus on editing parts of the payload based on what they are testing at the time. The other elements are taken care of automatically by Postman.
Sending data to the API quickly and efficiently helps when I’m working on features and bug fixes. Postman is specifically designed to share, test, and monitor APIs.
It’s one of the best tools in my workflow.
Jason Fauchelle, Software Developer