Runscope API Monitoring    Learn More →

Posts filtered by tag: code samples

How to Write Your First AWS Lambda Function

How to Write Your First AWS Lambda Function

By Mike Mackrory on .

Have you been looking for a quick and straightforward guide to writing your first AWS Lambda function? If so, we have got you covered. This article explains everything you need to know to create your first Lambda function, and how to upload and run it in the AWS Cloud.

AWS Lambda in a Nutshell

AWS Lambda is a serverless computing platform that allows engineers to create a small function, configure the function in the AWS console, and have the code executed without the need to provision servers—paying only for the resources used during the execution. As many organizations move towards implementing serverless architectures, AWS Lambda would be the central building block they’ll use. […]

Read More →

Categories: apis, code samples, serverless, tutorial


How to Sync your OpenAPI Schema in Stoplight with GitHub and Runscope

How to Sync your OpenAPI Schema in Stoplight with GitHub and Runscope

By Glen Semino on .

This is a post from our Featured Guest Series! Glen Semino shows how to combine Stoplight and GitHub APIs with Runscope to keep your OpenAPI Schema always versioned and up to date.

If you're interested in sharing your knowledge on our blog, check out our Featured Guest Series page for more details.

About a month ago after I and part of the SYNQ team attended the APIDays SF conference, we reflected on what we had learned at the conference. One of the things we realized was that our API spec documentation needed quite a bit of improvement. And among the tools discussed in the conference was Stoplight, which helps one design, document, mock, and test APIs. 

We decided to give Stoplight a try to rewrite and edit our API spec. Once we started, I noticed that I was often manually syncing our Open API spec (OAS) file that Stoplight generates with our GitHub repo. I wanted a way to automate this process so that regardless of what gets edited/changed in Stoplight, Stoplight and GitHub are always in sync. 

This is where Runscope came to save the day. Using the export function Stoplight offers in addition to GitHub’s API, I was able to automate syncing our Stoplight OAS spec file with our GitHub repo every minute using Runscope. In this tutorial, we're going to walk through this workflow step-by-step so that you can do it too!

The Setup

These are the things you will need to do to create the necessary API requests in Runscope to automate the syncing process...

Read More →

Categories: code samples, howto, monitoring, openapi


Playing with Node.js and the Runscope API on Glitch

Playing with Node.js and the Runscope API on Glitch

By Heitor Tashiro Sergent on .

I've been wanting to create a project on Glitch for quite some time. Glitch is a startup/product/friendly community where you can create and remix Node.js projects, use an online code editor to personalize them, and you don't have to worry about hosting or deployment. And it's free! It's a really great way to start a project and prototype an idea, without having to worry about those million little things that can get in the way of your dream app.

I thought it'd be fun to share a few projects I made using the Runscope API, and how you can use them to extend Runscope functionality or create custom features for use cases you might have, like creating a custom dashboard that displays API metrics using C3.js.

Here we'll take a look at three projects:

  • runscope-oauth - Uses Passport.js + passport-oauth2 + the Runscope API authentication.
  • runscope-batch-edit - Remix of runscope-oauth, uses the Runscope API to get a list of user buckets + list of tests in a bucket + set multiple tests schedules + set multiple tests default environments.
  • runscope-api-metric - Remix of runscope-oauth, uses the Runscope API to get a test's metrics information (avg. response time, success ratio, etc.)...

Read More →

Categories: apis, code samples, howto


Copying Runscope Environments using the Runscope API

Copying Runscope Environments using the Runscope API

By Sam Aybar on .

The Runscope UI provides a lot of flexibility for our customers to monitor and test APIs. You can easily manage the tests you have written, whether that means exporting them, duplicating them, or moving them to a different bucket.

Sometimes, however, our customers want to do something that we don’t have built-in. This is where the benefits of having a robust API come into play. For example, one customer recently expressed interest in being able to export an environment for backup purposes; another customer wanted to copy a shared environment to a different bucket.

Environments are one of the key elements in creating reusable API tests, especially when it comes to testing local, staging, and production APIs. This blog post outlines two example Python scripts to address these needs of importing/exporting environments. You can find these scripts at...

Read More →

Categories: code samples, howto, tutorial


Making Requests to the AWS API with Signature Version 4 and Script Libraries

By Heitor Tashiro Sergent on .

We recently had a customer that wanted to test and monitor a few endpoints for the AWS API. For security reasons, most requests to AWS APIs have to be signed using their Signature Version 4 signing process. There are several SDKs and libraries that can help with that signing process, but we wanted something that we could integrate with our script engine with plain JavaScript.
 
One of the most powerful features that Runscope has is the ability to add pre-request or post-response scripts to your API tests, so you can programmatically change your requests based on your API requirements. For example, you can add custom headers before your API request is made, or remove sensitive information from your API responses before they are stored and shared for viewing.
 
So, we put together an aws4.js library based off of mhart/aws4 Node.js library, that you can add...

Read More →

Categories: apis, code samples, testing, tutorial


Working with the Azure Storage REST API in automated testing

Working with the Azure Storage REST API in automated testing

By Chris Kirby on .

This is a guest post by Chris Kirby, Director of Technology at Authenticom. He's a big fan of automating processes, beer, and games. You can follow him on TwitterGitHub, and his blog.

Testing! Every developer's favorite topic :). For me, if I can save time through automation, them I'm interested. Automated testing for a developer typically starts with unit tests, which even if you don't subscribe to TDD, you've written at least one of them just to see what all the fuss was about. Like me, I'm sure you saw that testing complex logic at build time has huge advantages in terms of quality and taking risks. However, even with the most comprehensive tests at 100% coverage, you've still got more work to do on your journey towards a bug-free existence.

Given that most modern applications rely on a wide variety of cloud platform services, testing can't stop with the fakes and mocks...good integration testing is where it's at to get you the rest of the way. Integration testing is nothing new of course, it's just more...

Read More →

Categories: apis, code samples, customers, howto, testing


Everything is going to be 200 OK®