<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Runscope - Medium]]></title>
        <description><![CDATA[Everything is going to be 200 OK® - Medium]]></description>
        <link>https://medium.com/runscope?source=rss----b1ca1755dd85---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Runscope - Medium</title>
            <link>https://medium.com/runscope?source=rss----b1ca1755dd85---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:44:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/runscope" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Debug Common API Errors]]></title>
            <link>https://medium.com/runscope/how-to-debug-common-api-errors-46d6e1e28a3?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/46d6e1e28a3</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[runscope]]></category>
            <category><![CDATA[api-monitoring]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Fri, 01 Mar 2019 00:16:21 GMT</pubDate>
            <atom:updated>2019-03-01T00:36:08.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JH-Dyb9_nwNgqOHevUWnpQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/wFsbpYoGjOI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Debugging and troubleshooting APIs is something that any developer that works with APIs has to go through at some point. In an ideal world, APIs would always return a 200 OK with just the right data that we need, or in case of a failure, it would return us the perfect status code and error message allowing us to easily understand what went wrong.</p><p>In reality, APIs don’t always work like that. API developers might have constraints that do not allow them to implement the most informative status code or error message, API errors can be triggered by real-world conditions that are hard to account or test for, and sometimes ourselves, as API users, can make requests with typos or mistakes that APIs just don’t know how to handle.</p><p>In this post, we’re going to focus on <strong>API users</strong> and what they can do to debug common API errors they might encounter when testing and working with APIs, whether these APIs are public or private.</p><h3>Status Codes</h3><p>When working with APIs, every HTTP request that is sent to the server will be responded to with an <a href="https://httpstatuses.com/">HTTP status code</a>. HTTP status codes can be grouped into five different categories, by looking at their first digit:</p><ul><li>1xx — Informational</li><li>2xx — Success</li><li>3xx — Redirection</li><li>4xx — Client Error</li><li>5xx — Server Error</li></ul><p>We’re going to be focusing on the 4xx client error codes in this post, as they are the more common errors we might see when working with APIs, and which can usually be solved by the API user itself. We’ll also talk a little bit about the 5xx error category at the end.</p><h3>General Tips</h3><p>Before we dive into the specifics of a few HTTP status codes, there are certain tips that we can apply to any API debugging attempt.</p><h3>Use an API Testing Tool</h3><p>Use a tool that allows you to make, edit, replay, and inspect API calls. There are quite a few that I can recommend, such as <a href="https://www.runscope.com/">Runscope</a> itself, <a href="https://www.getpostman.com/">Postman</a>, <a href="https://paw.cloud/">Paw</a>, <a href="https://insomnia.rest/">Insomnia</a>, <a href="https://curl.haxx.se/">cURL</a>, <a href="https://httpie.org/">HTTPie</a>. Most of these tools are free or have trials, and they can save you a ton of time when debugging errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aglH6S_eLFnLKZ6-1CM-g.png" /><figcaption>The Runscope test editor, showing a sample GET request to the Star Wars API root endpoint: https://swapi.co/api</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UnpA-uizcZdrX7yvEdlbRA.png" /><figcaption>A cURL example, showing a request and its response in a terminal application to the Star Wars API root endpoint.</figcaption></figure><p>Another advantage of using a tool that allows you to make and replay API requests is they can help you isolate an issue due to a bad API call, or something in your app environment (a configuration issue, firewall, etc.) preventing the API call from returning a 200 status code.</p><p>I remember when I first started developing mobile apps, I would sometimes run a Windows Phone app in debug mode and go through several steps to get to an API call I was trying to debug. Don’t be like me.</p><h3>Read the Docs</h3><p>I can’t stress this enough, and not only because I enjoy writing documentation, but <strong>please read the docs</strong>.</p><p>I have been guilty of not following this advice as well but, reading the docs can be the difference between being stuck with an issue for 1 hour, or making a successful API call and moving on to your next task.</p><p>API documentation, when thorough and well-written, will give you all the answers you might need to successfully work with an API. How to authenticate, how to get an access token, what methods and endpoints are supported, and even what errors you might encounter and how to fix them.</p><h3>Be Careful with Copy+Pasting</h3><p>Copy and pasting code snippets from API documentation, or StackOverflow answers, is really easy, but be careful with those.</p><p>Examples can be outdated and contain general errors or use an old API version that’s not supported anymore. Copy+pasting code has an even trickier issue where certain characters might completely change how your API call works.</p><p>I had an error once where I copy+pasted a piece of text as a query parameter to an API request that should have included a ‘ symbol. Except that the text editor I was using converted the ‘ symbol to a ’ symbol (it might be hard to see, but they are different). When I pasted the text to my API call, that caused it to keep returning a 400 error, and it probably took me 30 minutes to debug.</p><p>Now, let’s get to the less general advice, and dig in into specific status codes!</p><h3>400 Bad Request</h3><p>A 400 status code means that the server could not process an API request due to <strong>invalid syntax</strong>. A few possibilities why this might happen are:</p><ul><li>A typo or mistake while building out the request manually, such as mistyping the API endpoint, a header name or value, or a query parameter. This can also be caused if the request is missing a required query parameter, or the query parameter value is invalid or missing</li><li>A malformed JSON body, for example, missing a set of double-quotes, or a comma. If you need to make an API request with a JSON body, I highly recommend writing it using a linter, whether you use a <a href="https://jsonlint.com/">web editor</a> or <a href="https://atom.io/packages/linter-jsonlint">code editor plugin</a></li><li>The request is missing authentication information, or the Authorization header provided could not be validated</li></ul><p>The main advice when debugging a 400 Bad Request error is to review every piece of text. Make sure there are no typos in the endpoint, headers (name and values), and body. If you copied and pasted any part of your API request, pay extra attention that they don’t include any mistakes or random characters that could be causing an issue.</p><p>Our last bullet point above (missing authentication information) is a good example of something you might see when working with multiple APIs. One API might send you a 400 status code for a request that has invalid authentication credentials, while another one might send you a 401 unauthorized status code, which can be used specifically for that purpose.</p><p>The 400 bad request status code sometimes is used as a catch-all for multiple types of errors. So if you have checked your API request for any invalid syntax and haven’t found any errors, try to see if any of the other 4xx status code solutions could help you with debugging.</p><h3>401 Unauthorized</h3><p>The 401 Unauthorized status code is returned when the API request is missing authentication credentials or the credentials provided are invalid.</p><p>APIs can be fickle, and that’s especially true when creating and formatting the Authorization header. OAuth 2 tokens, for example, need to be prepended with “Bearer” for them to work:</p><pre>Authorization: Bearer your_api_token</pre><p>It’s also important when using HTTP Basic authentication to pay close attention to the syntax of the header value. The form is as follows:</p><pre>Authorization: Basic base64_encode(username:password)</pre><p>Another thing to be mindful of, for cases where you only have a username, or only a password, make sure to <a href="https://stripe.com/docs/api/authentication">include the colon</a> (“:”) before encoding. Otherwise, the authentication will fail.</p><h3>403 Forbidden</h3><p>The 403 Forbidden status code looks similar to the 401 code, but they shouldn’t be confused with each other.</p><p>Usually, when you see the 403 status code, the API request that is being made includes some form of authorization. But, different from the 401 status code, the server <strong>does recognize the authorization credentials</strong> and accepts is as valid. The issue this time is that the authenticated user cannot access the resource for that endpoint. For example, the user might be trying to access account-level information that’s only viewable by the account administrator, and the credentials being passed on the API request are for a regular user account.</p><p>Another reason this status code might be returned is in case the user did not request an API access token with the <strong>correct permissions</strong>.</p><p>To fix the API call for those two situations, make sure that the credentials you are using have the access-level required by the endpoint, or that the access token has the correct permissions.</p><p>A less common reason we might see this error is if we’re not explicit about the Accept header value. Some APIs require you to include those headers on requests. That way, the server knows what information the client is sending, and also what format they expect to receive in return.</p><h3>404 Not Found</h3><p>404 Not Found one of those status codes that we don’t have to be working with APIs to see. But, specifically for APIs, it can usually mean a few different things:</p><ul><li>The endpoint does not exist</li><li>The endpoint exists, but the resource cannot be found</li><li>The endpoint exists and the resource can be found, but the user does not have the required permissions to access it, and so the server returns a 404 status code</li></ul><p>For the first two cases, there’s not much we can do as an API user, except double-check that the endpoint really does exist in the documentation, or double-check that there are no misspellings or typos.</p><p>For the third case, the advice is similar to what we covered in the previous status code, 403. Make sure that the authorization credentials you are using actually have access to that endpoint, as some APIs might return a 404 error instead of 403.</p><h3>429 Too Many Requests</h3><p>The 429 Too Many Requests is one of the longer ones, and it’s also self-explanatory. We’re calling the API too often.</p><p>It’s common for public and <a href="https://developer.foursquare.com/docs/api/troubleshooting/rate-limits">3rd-party APIs</a> to include some form of <strong>rate-limiting</strong>. That is a way to limit how many requests the user can make over a period of time. This serves to protect the API provider from having a user of making too many API calls, which can take up too many resources and potentially cause API slowdowns or even crashes for all users.</p><p>If you run into this error, there are several things that you can try to fix it:</p><ul><li>A <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After"><em>Retry-After</em> header</a> might be included, indicating the Date or time in seconds when the user can retry the request</li><li>Check the API documentation for the specifics of their rate-limiting. Sometimes, users might be able to give additional forms of authentication, upgrade their accounts, or reach out to the API support team to increase the rate limits</li><li>Caching API responses is another strategy that can help mitigate this error. If you’re working with an API and you don’t rely on always up-to-date information, caching the response every x amount of seconds/minutes/hours/days and displaying the saved API response can you help you avoid limits or surcharges</li></ul><h3>5xx Error Codes</h3><p>5xx status codes generally mean that the server has encountered an error, and can’t resolve the API request being made. Some of the more common status codes you might encounter are:</p><ul><li>500 Internal Server Error</li><li>502 Bad Gateway</li><li>503 Service Unavailable</li><li>504 Gateway Timeout</li></ul><p>A 5xx status usually means that the error is on the server side, not on the user side of things. So the general advice is to:</p><ul><li>Try again later. The server might be under too much load at the moment</li><li>Check the API status page, if one is available, for more information if there’s maintenance going on, or the API is down</li></ul><h3>Conclusion</h3><p>We’ve covered just a few of the most common HTTP status codes you might encounter when debugging or troubleshooting APIs. Hopefully, with this information, you will feel more comfortable when encountering those issues and know about the tips and tricks you can use to find the solution.</p><p>If you have any other issues you would like to see added here, or any additional tips that you might have for fixing API errors, <a href="/service/mailto:help@runscope.com">we’d love to hear from you</a>!</p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/how-to-debug-common-api-errors"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46d6e1e28a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/how-to-debug-common-api-errors-46d6e1e28a3">How to Debug Common API Errors</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Easy Steps to Cloud Operational Excellence]]></title>
            <link>https://medium.com/runscope/3-easy-steps-to-cloud-operational-excellence-5469e8cc3b7b?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/5469e8cc3b7b</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[live-streaming]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Bruce Wang]]></dc:creator>
            <pubDate>Wed, 31 May 2017 18:45:50 GMT</pubDate>
            <atom:updated>2017-05-31T18:45:49.487Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a lot of tools out there, and sometimes its hard to sift through them all. Here’s a simple guide to combine 3 tools, <a href="http://www.runscope.com/">Runscope</a>, <a href="http://pagerduty.com/">PagerDuty</a> and <a href="https://www.statuspage.io/">StatusPage</a> to create a powerful cloud operational workflow that will give you peace of mind and clear visibility to your application for your customers and internal teams alike!</p><p>In case you’re not familiar with the tools, here’s a quick rundown:</p><ul><li>Runscope — highly flexible API testing and monitoring service</li><li>PagerDuty — incident management system</li><li>StatusPage — Customer-facing API health status page</li></ul><h3><strong>The workflow</strong></h3><p>It’s important to implement tools for specific purposes, and we wanted to integrate these 3 tools to help manage our operational process better.</p><p>In the following examples, we’re going to show you how we added a new feature to our product (<a href="https://docs.synq.fm/api/#!/video/stream">Live Streaming APIs</a>), and added operational visibility to it.</p><p>First let’s walk you through our workflow:</p><ul><li>A Runscope test monitors the service on a schedule and sometimes tests from different geo locations depending on how it has been configured</li><li>If a Runscope test fails, PagerDuty creates an incident, alerts our Slack channel, and alerts the appropriate engineers</li><li>PagerDuty also updates the service status on StatusPage to alert our customers the service is having problems</li><li>Once the problem is resolved and the Runscope test that was failing starts to pass, the incident on PagerDuty will resolve itself and the service on StatusPage will revert back to operational status automatically</li></ul><h3>Step 1: Create a Runscope test for the Live Streaming API</h3><p>Runscope provides an easy way to make POST requests on an API and then make assertions on the response.</p><p>Here is what our POST request to our live streaming service looks like in Runscope:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*ffGk4I43Ds0b6ODk." /></figure><p><em>Note: the {{xxx}} is a variable that can be set from previous tests or configured via “environment” specific settings. You may hard code values in the beginning, but using variables is invaluable for creating richer tests across your various service environments</em></p><p>When our live stream API is called, the JSON response we expect should include a playback and stream url, so we just need to add some simple assertions in Runscope</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/0*hI6S-8Bj4vezz-Q_." /></figure><p>We check that the HTTP response is 200 and then we check that playback_url and stream_url are not empty. We also save the values that are in playback_url and stream_url</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/0*HiOXoE_Lt78MFz3C." /></figure><p>The reason for saving the values is that we will then call our video details API and assert that the values stream_url and playback_url are present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*qc2-KyDH4l35IU5j." /></figure><p>We then make the assertion on the details API that the playback_url and stream_url are the values we expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*2_Fx2PR8HYNzEpNY." /></figure><p>After we built this test, we put it on a schedule using the ‘Schedules’ menu in Runscope and we were ready to add a PagerDuty alert so that we could be notified if the test for the live streaming API fails.</p><h3>Step 2: Setting up PagerDuty with Runscope</h3><p>Luckily, Runscope and PagerDuty have a pre-built integration. So all we had to do was go to PagerDuty and create a new service under the ‘Configuration’ menu. When adding the service for ‘Integration Type’ we specified ‘Runscope’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*TegknikeBJd7mjZh." /></figure><p>Then we configured the ‘Incident Settings’ and ‘Incident Behavior’ and then simply clicked ‘Add Service’ . Once the service was added, we were able to see it under our ‘Services’ in PagerDuty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AgZcCiz6iuTJZbxM." /></figure><p>To then connect to our live stream test in Runscope to PagerDuty, we went into Runscope under ‘Connected Services’ and clicked the button that said ‘Connect PagerDuty’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/0*Yt4hE3TyyQxGyvMB." /></figure><p>Then the Runscope system asked us to authorize our PagerDuty account with Runscope, so we put in our PagerDuty credentials and clicked ‘Authorize Integration’. Finally we choose the service from PagerDuty that we want to integrate with Runscope and clicked ‘Finish Integration’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/0*Jrn7y4rzrYWU9a1j." /></figure><p>Once we did that, inside of ‘Connected Services’ in Runscope we could see our PagerDuty integration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t94n1zaPI9sQFs4P." /></figure><p>As you can see from screenshot our PagerDuty service called ‘SYNQ Live Stream Check’ is now integrated into Runscope. The last step was connecting the PagerDuty service to our Runscope test for the live streaming service. To do that we simply went to the live stream Runscope test and went into the ‘Editor’, we then modified the integrations for the environment we are using. Then we just flipped the integration to ‘ON’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/0*jTHrYMVJ4KJB14Za." /></figure><p><em>Note: Again, this notification is available in a per environment setting, as you can see this environment is “Production”</em></p><p>We now had the live stream test from Runscope connected to PagerDuty. Thus we would get alerted by text message or phone call if the Runscope test fails. In addition to that, we connected PagerDuty to our Slack channel following this <a href="https://www.pagerduty.com/docs/guides/slack-integration-guide/">guide</a> , so that if a PagerDuty incident is triggered by Runscope, we get alerted on our Slack channel. The last piece left was to connect PagerDuty to StatusPage, so that our clients could be alerted if the live streaming service fails.</p><h3>Step 3: Adding the Live Streaming Service to StatusPage</h3><p>Now that we have a way to monitor and alert our live streaming service, we need to expose this to our clients. We do this with our public facing <a href="http://synq.statuspage.io/">StatusPage</a> (having a transparent operational status is very important and you can read more about that <a href="https://medium.com/synqfm-ops/building-mops-modern-ops-process-transparent-status-and-rcas-72b716964bb8">here</a>.)</p><p>To connect PagerDuty and StatusPage, we followed this <a href="https://www.pagerduty.com/docs/guides/statuspage-io-integration-guide/">PagerDuty guide</a>. Once we had both of the accounts connected, the rest of the setup occurred on StatusPage. Inside of our StatusPage configuration, we now had a section for PagerDuty. Inside that section, to connect a component to a PagerDuty service, we needed to add a rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/0*6afNmxecV27MYF3T." /></figure><p>Under the `SYNQ Live Stream Check’, we clicked ‘Add Rules’ and then that brought us to another page, where we were able to connect the ‘Live Stream’ component on our StatusPage to the PagerDuty ‘SYNQ Live Stream Check’ service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*eIxF4mSjwxpINdYW." /></figure><p>We clicked on ‘Save Rules’ and we were done. On StatusPage under ‘PagerDuty Setup’ and ‘Active Services’ we could now see our ‘SYNQ Live Stream Check’ present:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*M7_899o4qgnIbKcy." /></figure><p>Now our public facing StatusPage shows our ‘Live Stream’ status!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XHxZCAduYrBJvKTa." /></figure><p>If our live stream service test failed on Runscope the ‘Live Stream’ component on our status page goes from ‘Operational’ to ‘Degraded’.</p><h3>Mayday! Mayday! We have a Problem</h3><p>Although our live stream service was still in alpha, we had no issues and our Runscope test for the service were all green. Then one day, we get a text message from PagerDuty, alerting us that our Runscope test for our live stream service was failing. In the meantime we were also alerted on Slack and our ‘Live Stream’ component on StatusPage went from ‘Operational’ to ‘Degraded’.</p><p>Next, we immediately went into our live stream Runscope test and noticed that we were not getting the appropriate HTTP response code from our live stream API. We knew at this point that our live stream service was having an actual failure. We then checked the server logs for our streaming servers in Amazon Cloudwatch and we noticed that it was not taking any requests for creating new streams. We eventually traced this to a backend service we depended on that that ran out of resources.</p><p>There were two issues we discovered. One, we were not deleting old and unused streams, which resulted in excessive streams and running out of resources. The second issue was that our Runscope tests were running too often, thus exacerbating the issue by creating 288 unused streams a day. We learned that in some cases running a Runscope test too often is not ideal and that building a test and monitoring model around new features can help you find bugs in your platform.</p><h3>Conclusion</h3><p>Thanks for sticking with us for the whole article. Hopefully you got a lot of value in it, and feel free to ask us any questions you may have about our process or any individual services we use in the comments below. Happy Service Building!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5469e8cc3b7b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/3-easy-steps-to-cloud-operational-excellence-5469e8cc3b7b">3 Easy Steps to Cloud Operational Excellence</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Year’s Resolution: How (and Why) to Give Back to the Developer Community]]></title>
            <link>https://medium.com/runscope/new-years-resolution-how-and-why-to-give-back-to-the-developer-community-3ab72141e2b6?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ab72141e2b6</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:20 GMT</pubDate>
            <atom:updated>2017-05-08T19:41:52.789Z</atom:updated>
            <content:encoded><![CDATA[<p>A new year has arrived, and that usually means new resolutions for most of us. One resolution that has been on my mind for 2017 is a simple question: how can I give back to the developer community this year?</p><p>Having worked as a developer, developer evangelist, and content writer in the past few years, I have gotten a lot of help from a lot of different sources: discussions with friends and work colleagues; talks and workshops at meetups and conferences; online communities like Stack Overflow, Hacker News, Slack groups, Facebook groups, etc.</p><p>But, consuming that knowledge is often easier than contributing to it. For example, it probably took me a good couple years before I started interacting and upvoting on the Stack Overflow community. It took even longer for me to be comfortable writing and sharing my first blog post.</p><p>So, if you made a similar resolution to give back to the developer community this year and need some help on how to get started, we’re going to cover a few different ways that you can do that. First, we’re going to talk about online communities: <strong>GitHub</strong>, <strong>Stack Overflow</strong>, <strong>social media</strong>, and <strong>writing</strong>. Then we’ll move to offline communities and talk about <strong>meetups</strong>, <strong>conferences</strong>, and <strong>public speaking</strong>.</p><p>Every section will include some general advice, and also some more in-depth links. But before we get to the actionable advice, let’s talk a little bit about why we should give back.</p><h3>Why Give Back?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_Y7w-tpzZAa4l252c4dJw.png" /><figcaption><a href="https://www.flickr.com/photos/ter-burg/8823162570/in/photolist-erF1QA-dZCoFb-7CXDzE-4xhiUJ-7WMA8z-ocmhK9-otyEiT-PRdKQ-8Zrpg5-8ZroNh-8Zom6z-eqJHRr-8Zom1z-8ZroUq-8ZokDF-8ZokJn-erN9UC-8ZrpNL-4gMESa-8ZomPe-erF1ib-5koTXW-eqJJB4-eqJKo8-5z6hud-eqJPYp-5ZuauN-5SfCfZ-5J6Nd-erEZUq-PUEbb-fmxTgz-ffZoCR-eqJQd4-btw5Ea-erJrJb-eqJPKH-8M13Ly-8KwDAJ-ffZthR-erJrVC-eqJNt4-eqJJbk-8KDP9p-fgekVN-eqJMhP-npu539-8Zomaz-8ZokNn-8Zomnr">“Wikimedia Hackathon 2013, Amsterdam</a>” by <a href="https://www.flickr.com/photos/ter-burg/">Sebastiaan ter Burg</a> is licensed under <a href="https://creativecommons.org/licenses/by/2.0/">CC BY 2.0</a> / Cropped from original</figcaption></figure><p>There are plenty of ways to go about giving back, but before we get to that, maybe you’re asking yourself: <strong>why should I give back</strong>? Well, helping others can make us happy (and some might say that’s the secret of happiness). There’s a Chinese saying that goes: “If you want happiness for an hour, take a nap. If you want happiness for a day, go fishing. If you want happiness for a year, inherit a fortune. If you want happiness for a lifetime, help somebody.” If you’re more skeptical, <a href="http://greatergood.berkeley.edu/article/item/can_helping_others_help_you_find_meaning_in_life">there are actual scientific studies to back up how helping others positively impacts your life</a>.</p><p>Besides happiness and meaningfulness, giving a helping hand can also boomerang back into your life in a variety of positive ways. Helping open-source projects, for example, could lead you to meet other developers who might be your future co-workers. Or speaking at a conference might help you cross an item off your bucket list, and help you give better presentations in the future.</p><p>So, let’s get started!</p><h3>Online Communities</h3><h4>Stack Overflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*ZrxT5H8FUsR3x7sJPL4hwQ.png" /></figure><p>I can’t count how many times Stack Overflow has helped me solve some horrible bugs, or how to center a div with CSS. And it’s really easy to give back here:</p><ul><li>Nothing like a website’s own guide, so definitely check out <a href="http://stackoverflow.com/help">Stack Overflow’s Help Center</a>. That includes a good collection of guidelines and suggestions, from what topics you can ask about, to how their reputation system works.</li><li><a href="http://stackoverflow.com/help/be-nice"><strong>Be nice</strong></a>.</li><li>If you find a question and answer that helps you solve your problem, make sure to upvote both the answer AND the question. That can help other people that run into the same issue more easily find it.</li><li>It’s also common for answers to get outdated. If you see that, don’t be afraid to suggest an edit to an answer, or write your own. Maybe a new version of a Node.js library came out that changed a method’s signature, or maybe you just found a better way to center a div with CSS.</li><li>It’s okay to <a href="http://stackoverflow.com/help/self-answer">answer your own questions</a>! If you couldn’t find a solution on the website and want to document it for other people, that’s encouraged. If you have a little bit of reputation, you can even post a question with an answer to it at the same time.</li></ul><h4>Slack Groups</h4><p>The popular work chat app is not only good for use as part of a company. A lot of developer communities have embraced the platform and created public Slack channels that you can join, in favor of the usual Google Groups. For example, you can find specific communities focused on one language like <a href="https://slofile.com/slack/clojurians">Clojure</a>, to more broad ones like <a href="https://slofile.com/slack/devolio-devchat">DevChat</a>.</p><p>There’s no official Slack communities directory, but here are two that I found that include some popular developer communities:</p><ul><li><a href="https://slofile.com/">https://slofile.com/</a></li><li><a href="https://www.hamsterpad.com/">https://www.hamsterpad.com/</a></li></ul><p>You can also create your own Slack group. Besides groups for specific languages, another option is to create a group for your local community, city, or even country. <a href="https://blog.bufferapp.com/slack-community">Buffer has a great blog post about starting your own group</a> that covers why you should do it, how to promote it, moderate, and even measure success with KPIs if you’re into it.</p><h4>Twitter</h4><p>One of the best ways to keep up-to-date with news is Twitter. But building a good follower list can be a challenge. That’s why <a href="https://support.twitter.com/articles/76460">Twitter lists</a> can give you a big hand when you’re trying to follow a specific topic. They’re a curated list of folks that others (or you) can create, and it makes it really simple to follow a specific topic, be it a programming language, to a list of people attending a conference.</p><p>There’s no way to search for lists right from Twitter, but you can do a Google Search filtering by site, and it should give you back a few good results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dI1amVA36aypVvti.png" /><figcaption>Search query: site:twitter.com js developers list</figcaption></figure><p>Some conferences also make Twitter lists for speakers or attendants, and that’s usually a good way to start interacting online and meeting people even before the event starts.</p><h3>Writing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9KBtM_hGaG3jQHmd9DoWg.png" /></figure><p>Chris Wolfgang from Codeship wrote a blog post last year on “<a href="https://blog.codeship.com/tech-writing-why-developers-should-write/">Why Developers Should Write</a>”, and I highly recommend it. I’m biased here, but I really believe <strong>writing is one of the best ways to give back to the community</strong>.</p><p>This doesn’t mean you have to start your own blog and write a 3000-word blog post every single day. There are better (and saner) ways to help your fellow developers with writing</p><ul><li>As I mentioned before, writing question and answers on Stack Overflow is awesome.</li><li>If you don’t want to start your own blog, another option you have is writing guest posts for other companies. Some will even pay you for it, but before you start writing make sure to reach out to these companies first. They might be only interested in certain topics, and sometimes they might even help you brainstorm some ideas for you to write about.</li><li>If you’d like to start your own blog, that’s awesome! There are a few ways you can go about, like hosting your own with a platform like Wordpress or <a href="https://ghost.org/">Ghost</a>. My favorite though is writing on <a href="https://medium.com/">Medium</a>. It’s a pleasure to write (and read) on it, it’s super easy to get started, and it gives you some help in reaching readers with the Facebook/Twitter connections, and their newsletters.</li><li>Besides having your personal blog on Medium, you can also contribute to publications there. A popular one for JavaScript is <a href="https://medium.com/javascript-scene">JavaScript Scene</a>, and if you write something interesting you can submit your post to published in it.</li></ul><p>Another great post/talk on this is Kristina Thai’s “<a href="https://realm.io/news/altconf-kristina-thai-better-engineer-through-writing/">Become a Better Engineer Through Writing</a>”. She gives a great overview of the benefits and challenges of different forms of writing you can do (journal vs. Q&amp;A forums vs. blogging vs. tutorials). She also shares her journey on starting her own blog, from getting a couple visits a day to being invited to speak at conferences all over the world. And the best advice I think she gives for getting started, you do not have to be the expert. So, don’t be afraid of writing even a really tiny blog post about an issue you just solved, or a new open-source project you started.</p><h4>Facebook Groups &amp; Quora</h4><p>I’m just going to mention these two: Facebook Groups are still a good way to participate in developer communities, and Quora can sometimes be an underrated source of knowledge for developer questions, but there’s some good content in there as well.</p><h4>GitHub</h4><p>As a developer, this might be the place where you spend most of your time next to your IDE. You can find the most popular open-source projects hosted on GitHub, and it may also be where your company keeps its private repositories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*J--r6mzRwH6Bt7u4Gkg14Q.png" /></figure><ul><li>If you’re new to open-source, check out GitHub’s guide on <a href="https://guides.github.com/activities/contributing-to-open-source/">Contributing to Open-source</a>, and Erika Heidi’s post on <a href="http://www.erikaheidi.com/blog/a-beginners-guide-to-open-source-making-your-first-contribution">A Beginner’s Guide to Open Source: The Best Advice for Making your First Contribution</a>.</li><li>Nowadays, it is really common for even the smallest project to use some sort of open-source framework or library. These are maintained by people, most of them in their free-time. So, if you find a bug, go to the project’s repository and see if there’s an open issue for it already. If not, open one and try to be as descriptive as possible. Maybe give it a try in fixing it. Reading other people’s code is a great way to level up as a developer too.</li><li>You can also find events that encourage people to start contributing to open-source like <a href="https://hacktoberfest.digitalocean.com/">Digital Ocean’s Hacktoberfest</a>, which happens every year in October. If you scroll down to the bottom and look at the “Resources” section, they also link to some excellent guides about how to contribute.</li><li>A sort of pattern that some projects that need help use is adding tags to certain issues named “help wanted”. That makes it super easy to search GitHub for issues that you can try to help. You can do a GitHub search for <a href="https://github.com/search?utf8=%E2%9C%93&amp;q=state%3Aopen+label%3A%22help+wanted%22&amp;type=Issues&amp;ref=searchresults"><em>state:open label:”help wanted”</em></a>, filter by language, and find projects you can contribute to.</li><li>Open-sourcing your projects is another great way to help the community. But, as they say, with great power comes great responsibilities. So, sharing your code for other people to use is great, but remember to also include a license with it. That way people can know whether they are free to use it, change it, or distribute it. GitHub even made this easier by creating a website appropriately called <a href="http://choosealicense.com/">choosealicense.com</a>.</li></ul><h3>Offline Communities</h3><h4>Meetups</h4><p>This is one of the best ways to give back, and also reap some huge rewards. As humans, social interaction is proven to have all sort of positive effects in our lives. Meetups can help you meet some great people, and also pick up some new skills.</p><p><a href="https://www.meetup.com/">Meetup.com</a> is the biggest platform for organizing and finding these events. And, especially if you live in a big city, it’s easy to find developer meetups by creating an account there and searching for your favorite programming languages.</p><p>If you’re already part of a few meetups, know that most organizers can always use a helping hand. Putting events together takes a tremendous amount of work, so even something as small as inviting your friends, making sure to attend after you RSVP, interacting with other people, and taking pictures and posting them on social media, every little gesture is appreciated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHrDfNh6F8a4oAR2xjSAkQ.png" /></figure><p>And if you want to do even more, start your own meetup! Maybe your city doesn’t have a JavaScript meetup yet, or you want to meet more people that are working with Docker. As I mentioned before, putting together an event is a tremendous amount of work, but there are a few resources that can help you.</p><p>Buffer has another great post, this one titled <a href="https://blog.bufferapp.com/meetups">“How to Host a Meetup For Your Community: The Who, What, Where, When, And How</a>”. I especially like the checklist they have at the end of it.</p><p>A great option for starting a meetup, but getting a head start with a little more support and resources, is to look for organizations such as CoderDojo.</p><p><a href="https://coderdojo.com/">CoderDojo</a> is a “worldwide movement of free, volunteer-led, community-based programming clubs for young people.” Greg Bulmash is the Lead Organizer for Seattle’s CoderDojo, and he has been doing it even before he became a technical evangelist at Amazon. He says “Besides helping prime the pump for the next generation of developers, it helps a lot of public spirited grown-up devs get a chance to build our mentoring skills, connect with peers (fellow volunteers), and get the good karma and happy brain chemistry that comes from seeing a kid light up because they grasped a new concept.”</p><p>There are also some great organizations out there who are making a difference by empowering women, and making the developer community a more diverse field. For example, RailsGirls, a non-profit volunteer community, aims to “give tools and a community for women to understand technology and to build their ideas”.</p><p>Helping organize one of these events that have the backing of an organization are usually a little bit easier. They already have experience and resources that you can use, and a community of experienced people to support you.</p><p>Here are a few other organizations that you might be able to help as an organizer or volunteer:</p><ul><li><a href="https://codeclub.org.uk/">Code Club</a></li><li><a href="http://www.devoxx4kids.org/">Devoxx4Kids</a></li><li><a href="https://www.womenwhocode.com/">Women Who Code</a></li><li><a href="https://www.girldevelopit.com/">Girl Develop It</a></li><li><a href="http://www.blackgirlscode.com/">Black Girls Code</a></li><li><a href="http://www.writethedocs.org/">WriteTheDocs</a></li></ul><h4>Conferences</h4><p>Similar to meetups, conferences have much of the same benefits but in a bigger scale. You can meet even more people, listen to and learn from some great speakers, and maybe even do some workshops to polish your skills.</p><p>And also similar to meetups, giving a helping hand during conferences can also come in a multitude of ways:</p><ul><li>Small things like taking pictures during the conferences and sharing on social media are always helpful. Triple bonus if it’s a picture of a speaker that includes a thank you for a talk that you really liked.</li><li>A lot of conferences need volunteers, from people to help during the registration process to assisting speakers set up their talks. So if you have some free time, don’t be afraid to reach out to organizers and offer to help. That may also help you save some money, and if you’re an introvert, it’s a great way to help you meet new people.</li><li>If you consider yourself more of an introvert, Adam Duvander from Zapier wrote a great blog post on “<a href="https://zapier.com/engineering/introvert-conferences/">How to Attend Conferences as an Introvert</a>”, so definitely check that out.</li></ul><h4>Brown Bag Lunch</h4><p>A cool practice that some companies put together is having “brown bag lunches”. That usually involves an office lunch, and a talk by someone from the company or an external speaker.</p><p>Brown Bag lunches are great ways to disseminate knowledge across the company, especially when you have multiple teams working separately. It’s also a great space to talk about new technologies or personal projects, and even practice a talk that you might be preparing for a meetup or conference.</p><h4>Giving Talks</h4><p>Giving talks could be its own separate blog post, so I just wanted to share some resources and general tips if you’re thinking about doing it:</p><ul><li>It might be tempting to just go and try to give a talk at a conference, but speaking to a huge crowd can be really intimidating. You might want to work your way up the chain by first practicing giving a talk to friends or colleagues (internal talks at companies are great). You can then start giving talks at meetups, who usually need more speakers every month. And then, finally, start presenting at conferences.</li><li>Don’t be afraid to reuse talks, especially if they’re well received. Practice makes perfect, and that’s the same way with presentations.</li><li>Having great slides can make or break a presentation, so do give some thought to them. And by all means, avoid walls of text. Chris Heilmann gives some great advice here on “<a href="http://developer-evangelism.com/slides.php">Prepare great slide decks for presentations</a>”.</li><li>TED talks are really popular, and they even have a book about public speaking! It’s called <a href="https://www.ted.com/read/ted-talks-the-official-ted-guide-to-public-speaking">The Official TED Guide to Public Speaking</a> by Chris Anderson, and it can truly change the way you approach giving talks.</li><li>Bonus: if you have some extra time, check out <a href="http://waitbutwhy.com/2016/03/doing-a-ted-talk-the-full-story.html">Tim Urban’s post (Wait But Why) on his experience doing a TED talk</a>.</li></ul><h3>Do What Works Best for You</h3><p>Giving back and helping others is great, and these are just a few ways to do it. It can help you achieve that New Year’s resolution, give you a sense of meaningfulness, and even include a few extra benefits like making new friends, landing a new job, or learning a new skill.</p><p>If you would like to talk more about any of the topics mentioned here, please <a href="https://twitter.com/heitorburger">reach out to me on Twitter</a>, and I’ll be happy to help. :)</p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/new-years-resolution-how-and-why-to-give-back-to-the-developer-community"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab72141e2b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/new-years-resolution-how-and-why-to-give-back-to-the-developer-community-3ab72141e2b6">New Year’s Resolution: How (and Why) to Give Back to the Developer Community</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to GraphQL]]></title>
            <link>https://medium.com/runscope/introduction-to-graphql-be8eeeb573e9?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/be8eeeb573e9</guid>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:12 GMT</pubDate>
            <atom:updated>2017-05-03T15:34:44.936Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*TtleRJTBaAYE9N_i-vhocg.png" /></figure><p>During the past year or so you might have heard or come across an article about GraphQL, especially if you’re working with React. More recently, <a href="http://githubengineering.com/the-github-graphql-api/">GitHub</a> announced GraphQL support to one of their APIs. If you’re wondering what GraphQL is and how it works, below is a quick primer.</p><p>In this article, we’ll cover the basics of GraphQL, with some examples of how you can easily test a GraphQL API using Runscope.</p><h3>What’s GraphQL?</h3><p>GraphQL is a query language, created by <a href="https://facebook.github.io/react/blog/2015/05/01/graphql-introduction.html">Facebook</a> in 2012. They have been using it internally and in production for a while, and more recently they have published a specification for it, which has received a really positive response from the developer community. Companies like GitHub, Pinterest, and Coursera, have already started adopting it and using externally and internally.</p><p>A few advantages of using GraphQL are:</p><ul><li><strong>Hierarchical</strong> — query is shaped like the data it returns.</li><li><strong>Client-specified queries</strong> — queries are encoded in the client rather than the server. They return exactly what the client asks for, and no unnecessary data.</li><li><strong>Strongly typed</strong> — you can validate a query syntactically and within the GraphQL type system before execution. This also helps leverage powerful tools that improve the development experience, such as <a href="https://github.com/graphql/graphiql">GraphiQL</a>.</li><li><strong>Introspective</strong> — you can query the type system using the GraphQL syntax itself. This is great for parsing incoming data into strongly-typed interfaces, and not having to deal with parsing and manually transforming JSON into objects.</li></ul><p>One of the biggest potential advantages when using GraphQL is having an efficient way to get resources from an endpoint by querying for exactly which resources you need. It can also help in retrieving resources that would typically take multiple API calls, by using a single request instead.</p><p>Here’s an example GraphQL query to retrieve a specific person from an API:</p><pre>{<br>  user(id: 1234) {<br>    name<br>    profilePic<br>  }<br>}</pre><p>And here is an example response:</p><pre>{<br>  &quot;user&quot; {<br>    &quot;name&quot;: &quot;Luke Skywalker&quot;<br>    &quot;profilePic&quot;: &quot;http://vignette3.wikia.nocookie.net/starwars/images/6/62/LukeGreenSaber-MOROTJ.png/revision/latest?cb=20150426200707&quot;<br>  }<br>}</pre><p>That is a really simple example, but it shows some of the underlying design principles of the language. For example, the user schema could include multiple fields, but our query can define just the necessary information that our application needs.</p><p>There’s much more to GraphQL, and I highly recommend heading to <a href="http://graphql.org/">GraphQL’s official website</a> and reading through its docs to learn more about it.</p><h3>How to test a GraphQL API with Runscope?</h3><p>Testing a GraphQL API with Runscope is pretty similar to testing a REST endpoint. For this example, I’m going to use <a href="https://developer.github.com/early-access/graphql/">GitHub’s GraphQL Projects API</a>. It’s still in early access, but it’s easy to <a href="https://developer.github.com/early-access/graphql/guides/accessing-graphql/">sign up</a> for it and start using it.</p><p>Let’s start with an introspection query, which will return our API’s GraphQL schema. First, we can set our Authorization header with GitHub’s API key in our Environment settings, which will be shared with all our requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xzD-PvCc8cLt9_kqJhwH0w.png" /></figure><h4>GET Introspection query</h4><p>Next, we can quickly set up our introspection query test by doing a GET to <a href="https://api.github.com/graphql">https://api.github.com/graphql</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z0-omPKoCqHJ0OMc7uB8RA.png" /></figure><p>After that, click “Save &amp; Run” to run the test and get back the full GraphQL schema from the GitHub Projects API.</p><h4>POST query</h4><p>We can also test a simple query to get our GitHub username by making a POST query, and adding a JSON body to our request with the query parameter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbxYN-IYByRfTejc_wrm8Q.png" /></figure><p>The API returns a JSON formatted response to us, and its structure is the same as our request. We can easily add an extra assertion to ensure we’re getting the correct data by accessing the property data.viewer.login:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Z905NwN8rb2PLmZJ0OF2Q.png" /></figure><blockquote><em>If you’re still getting familiar with writing queries, it can easier to first build your queries using </em><a href="https://developer.github.com/early-access/graphql/explorer/"><em>GitHub’s GraphQL Explorer</em></a><em>, and then paste them in your tests.</em></blockquote><h4>POST query with arguments</h4><p>Here are a couple more example queries that we can make. First, we can make a query to get an issue ID from a repository, and save that as a variable for use in later tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dg7c11mvCdHRK3Aq0aFJHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DKYh3QG_HwlMUVc6w_qX5Q.png" /></figure><h4>POST mutation</h4><p>Next, we can use a <em>mutation</em> query to add a reaction to the issue we grabbed in our last test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7x7EhvrBllZEwxyOxKCbw.png" /></figure><h3>What&#39;s next</h3><p>GraphQL is still in its early stages, but it already has an active and lively community, and it’s being adopted by some big companies. There are a lot of challenges ahead of it becoming more widely used, but just like any other API, testing and monitoring to make sure that everything is 200 OK is crucial.</p><p><em>Update: Check out Phil Sturgeon&#39;s guest blog post on &quot;</em><a href="https://blog.runscope.com/posts/you-might-not-need-graphql"><em>You Might Not Need GraphQL</em></a><em>&quot;.</em></p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/introduction-to-graphql"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be8eeeb573e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/introduction-to-graphql-be8eeeb573e9">Introduction to GraphQL</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Ways Subtests Can Improve Your API Monitoring and Testing]]></title>
            <link>https://medium.com/runscope/3-ways-subtests-can-improve-your-api-monitoring-and-testing-505a35fdb742?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/505a35fdb742</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[api-monitoring]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:10 GMT</pubDate>
            <atom:updated>2017-05-08T19:42:12.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wished you could <strong>reuse a set of tests</strong> and avoid that pesky duplication? Well, with the addition of <strong>Subtest Steps</strong>, now you can and it’s as easy as pie!</p><h3>Subtest Steps</h3><p>For starters, let’s take a look at the most common use cases for using subtests:</p><h4><strong>Reuse Common Functionality</strong></h4><p>Need to generate a <strong>refresh token</strong> on each test run? Now you can create a test to generate a token and use that test as a step in other tests. When the token generation process changes, <strong>you only need to update it in one place</strong>.</p><ul><li><strong>Setup/Teardown Steps</strong></li></ul><p>If your tests need to set up data before running, or clean up after themselves, subtests can <strong>group</strong> the required API calls for <strong>setup</strong> and <strong>teardown</strong> into a single, reusable step.</p><ul><li><strong>Organize Your Tests into Suites</strong></li></ul><p>Running a set of related tests as a group is now possible. Create <strong>suites</strong> of related tests and <strong>run them all together</strong> as a unit, with notifications for the result of the whole suite.</p><p>You can find the Subtest Step option in your Test Editor under “+Add Step”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDeTD_pMYWAav4C3wiIEjw.png" /></figure><p>And this is what it will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lX0u_EiV0EEdm7vfE8uVVw.png" /></figure><p>You can specify the test’s <strong>Bucket</strong>, <strong>Name</strong>, and <strong>Environment</strong> to be used as a subtest, and you can position it anywhere in your <em>Steps</em> workflow.</p><p>Subtests are a powerful tool to help you create a more robust set of tests, while also simplifying your workflow. To make things even better, you can also <strong>pass dynamic data</strong> from other steps <strong>to subtests</strong>, and <strong>extract data from the result</strong> to use in subsequent steps.</p><p>In the next weeks, we’ll be showing a few use cases for how you can use subtests to improve your API tests workflow. If there’s anything specific you would like to see, please let us know by reaching out to us on Twitter <a href="https://twitter.com/Runscope">@Runscope</a>, or email us at <a href="/service/mailto:help@runscope.com">help@runscope.com</a>.</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/3-ways-subtests-can-improve-your-api-monitoring-and-testing"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=505a35fdb742" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/3-ways-subtests-can-improve-your-api-monitoring-and-testing-505a35fdb742">3 Ways Subtests Can Improve Your API Monitoring and Testing</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Global API Monitoring: Analyze Your APIs Response Time from 16 Distributed Locations]]></title>
            <link>https://medium.com/runscope/global-api-monitoring-analyze-your-apis-response-time-from-16-distributed-locations-e3a417f023d8?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/e3a417f023d8</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[api-monitoring]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:10 GMT</pubDate>
            <atom:updated>2017-05-08T19:42:02.428Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvXYunolyB6qWoGJH4P80Q.png" /></figure><p>When your API is a core part of your business, one of the biggest challenges is ensuring that all your customers have a fast response time. Nowadays, even small businesses might have a distributed, global customer base, and you don’t want them suffering from a slow and unresponsive experience.</p><p>It’s crucial that your API is just as fast from your office, as it is from across the globe.</p><p>The year is almost over, but we’re still working hard here at Runscope. We’ve just added two new locations that you can use to test and monitor your API: <strong>Canada</strong> (Central) and <strong>London</strong>.</p><h3>Global API Monitoring</h3><p>That’s why we have you covered, now with <strong>16 global locations</strong> that you can use to test and monitor your APIs. More recently, we’ve just added <strong>Canada</strong> (Central) and <strong>London</strong> to the list. The full list includes:</p><ul><li>US Virginia</li><li>US California</li><li>US Illinois</li><li>US Texas</li><li>US Oregon</li><li>Ireland</li><li>Germany (Frankfurt)</li><li>Australia (Sydney)</li><li>Singapore</li><li>Hong Kong</li><li>Japan (Tokyo)</li><li>Brazil (São Paulo)</li><li>India (Mumbai)</li><li>US Ohio</li><li>Canada (Central)</li><li>London</li></ul><h3>How to Add Locations to Your Tests</h3><p>Activating new locations for your tests is really easy. Just open your API tests <em>Editor</em>, click on <em>Environment Settings</em>, select <em>Locations</em> on the left-hand side, and toggle the locations you wish to use:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*wag3ZMHs6aEApm0go4XQOA.gif" /></figure><p>Your <a href="http://blog.runscope.com/posts/api-performance-report"><strong>API Performance Report</strong></a> email will then show response times and success rates compared to the previous day for every location. This will help you stay ahead of any latency issues that are too small to cause a test failure, and pinpoint any problems even before your customers do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*jTSX_TJFoRYiKeV7Ro7vfg.png" /></figure><p>We also want to wish everyone happy holidays, and we look forward to another 200 OK year!</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/global-api-monitoring-analyze-your-apis-response-time-from-16-distributed-locations"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3a417f023d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/global-api-monitoring-analyze-your-apis-response-time-from-16-distributed-locations-e3a417f023d8">Global API Monitoring: Analyze Your APIs Response Time from 16 Distributed Locations</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Setup Phase with Subtests: How to Handle OAuth 2 Access Tokens using the Runscope API]]></title>
            <link>https://medium.com/runscope/creating-a-setup-phase-with-subtests-how-to-handle-oauth-2-access-tokens-using-the-runscope-api-f24b29013844?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/f24b29013844</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:08 GMT</pubDate>
            <atom:updated>2017-05-08T19:41:27.732Z</atom:updated>
            <content:encoded><![CDATA[<p>In a <a href="https://blog.runscope.com/posts/3-ways-subtests-can-improve-your-api-monitoring-and-testing">recent post</a>, we announced a new feature called Subtest Step. Today, we’re going to be looking at one of the most common use cases for it: creating a “Setup” phase to always refresh your access token. With this, you can easily monitor and test any API that implements OAuth 2, without having to worry if your token is valid or not.</p><p>A few things before we start:</p><ul><li>This tutorial is going to focus on how to handle Access and Refresh Tokens inside of Runscope. You should be familiar with OAuth 2, as we won’t be going to deep into it.</li><li>This should work for <strong>any API that implements OAuth 2</strong>.</li><li>If you need to quickly go through an Authorization Code Grant Flow to get your first access/refresh tokens, check out our <a href="https://www.runscope.com/oauth2_tool">OAuth Token Generator tool</a>.</li><li>To use the Runscope API, we’re going to need a Runscope access token. The API uses OAuth 2.0, so you’ll need to create an application from your <a href="https://www.runscope.com/applications">profile Applications page</a>. That will provide you with a Personal Access Token which can be used as an OAuth bearer token to access data in your account. If you need help creating an application, please check our blog post “<a href="https://blog.runscope.com/posts/getting-started-with-the-runscope-api">Quickstart Guide to the Runscope API</a>.”</li><li>Please <strong>be careful when making changes to a live environment</strong>. Make sure to thoroughly test the steps below in a separate environment or bucket before committing them to your production tests.</li></ul><h3>OAuth 2 Access and Refresh Tokens</h3><p>So, let’s say you went through an API’s Authorization Code Grant Flow, and got your access and refresh tokens. You’re ready to start creating tests for your API and monitoring it. But, <strong>before each test</strong>, you want to create a <strong>setup phase</strong> to get a <strong>new access token</strong>. How can we do that?</p><p>Well, three easy steps:</p><ol><li>Create a Shared Environment with your tokens</li><li>Create a new test that will: get new tokens, and update our Shared Environment using the Runscope API</li><li>Add our test from the previous step as a Subtest in any other test</li></ol><p>Let’s dive right in!</p><h3>Setting up a Shared Environment with an Access Token</h3><p>The first thing we should do is create a Shared Environment for our tests and add two variables for our tokens so that they are easily accessible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*e4zXCMr_vsgZWS47.gif" /></figure><p>Also make sure to copy our newly created shared environment UUID, which we will use in the next steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6g5YhsKEGpKmxGoj.png" /></figure><h3>Creating a New Test and Getting a New Access Token</h3><p>Now, we want to make sure we always get a new Access Token before each test as our setup phase. Let’s create a new test to do that.</p><p>The <strong>following steps</strong> are just an example <strong>placeholder</strong>. Every API is different, so <strong>this is where you will update your request with the necessary information for your API</strong>: the request endpoint that will return a new access and refresh tokens, any authorization headers, and any variables you might need.</p><p>For this tutorial, the only thing we want to make sure to do this for this step is to extract our new access and refresh tokens from the API response. We’re storing them in the variables newAccessToken and newRefreshToken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tQlRL5PGfsSilKGl.gif" /></figure><h3>Updating your Shared Environments Variables with the Runscope API</h3><p>Next, we are going to add two request steps to our test. Both requests are going to hit the same endpoint with two different HTTP methods:</p><pre>https://api.runscope.com/buckets/&lt;bucket_key&gt;/environments/&lt;environment_id&gt;</pre><p>The first thing we need to do is GET our shared environment settings and extract the JSON result.</p><p>You can see the endpoint includes a &lt;bucket_key&gt; and &lt;environment_id&gt; variables. We can replace the first with one of the <a href="https://www.runscope.com/docs/api-testing/variables#builtin-variables">built-in variables</a> in the Test Editor: {{runscope_bucket}}. That will automatically replace it with your test’s bucket key.</p><p>The second one, &lt;environment_id&gt;, can be replaced by the UUID from the shared environment you created at the beginning of the tutorial. So you can directly paste that at the end of the URL, or store it in an initial variable and use that instead.</p><p>We also need to use our Runscope API personal access token to access this endpoint. So, if you’re familiar with OAuth 2, all you need to do is add an Authorization header to our request with the format “Bearer your_runscope_api_key_here”.</p><h4>Getting the Shared Environment Settings</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*C-yM00FRJuc1rdkK.gif" /></figure><p>Remember to create a variable to extract and store the JSON result. That will include all the current settings for our shared environment.</p><h4>Updating and Saving the Shared Environment Settings</h4><p>For this next step, we’re going to start by duplicating our last request. Then, all we need to do is change our method to PUT instead of GET and add a small pre-request script to our test:</p><pre>var envSettings = JSON.parse(variables.get(&quot;envSettings&quot;));</pre><pre>envSettings.initial_variables.accessToken = variables.get(&quot;newAccessToken&quot;);</pre><pre>envSettings.initial_variables.refreshToken = variables.get(&quot;newRefreshToken&quot;);</pre><pre>request.body = JSON.stringify(envSettings);</pre><p>The script will do a few things:</p><ul><li>Retrieve the variable envSettings from the last step, which includes the JSON result of our shared environment settings.</li><li>Update our shared environment variables to include our new tokens.</li><li>Set our new shared environment settings to the request body, so it gets saved when we make our PUT request.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*phjXSeGzN_NGijQY.gif" /></figure><h3>Using the “Get Refresh Token” as a Subtest</h3><p>Now to the fun part! We’re ready to make authenticated requests to our API, and we can create as many API tests as we want and just reuse our Authentication Test as a Subtest. :)</p><p>To do that, make sure to:</p><ul><li>Set your test’s environment to use or inherit the shared environment containing your access token variable.</li><li>Add a subtest step to your test, and set it to our newly created test to refresh our access token.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JwiTH3dPVx5JCgjq.gif" /></figure><p>And now you can use your access token variable anywhere throughout your tests, and not have to worry about expired tokens.</p><h3>Bonus</h3><p>Sam, our awesome Customer Success Engineer here at Runscope, created a template for the steps above. So, if you know what you’re doing and just want a head start, <a href="https://gist.github.com/heitortsergent/551cfad6b0b8819860f86736d1445b2c">download this JSON</a> and import it as “Runscope API Tests.” To give it a try, all you need to do is create a shared environment and add two initial variables to the imported test:</p><ul><li>runscope_token - Your Runscope API token.</li><li>shared_environment - Your shared environment UUID.</li></ul><h4>Conclusion</h4><p>This is just one of the use cases for Subtest Steps, and we hope you find it useful! In some cases, you might want to check if your access token is expired before getting a new one, or only get one after a set period of time. If that’s something you’d like to see us write about, or need help setting up, please let us know at help@runscope.com.</p><p>In our next post about Subtests, we’ll cover how you can use them to better organize your tests.</p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/how-to-use-subtest-steps-to-handle-oauth2-access-tokens-runscope-api"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f24b29013844" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/creating-a-setup-phase-with-subtests-how-to-handle-oauth-2-access-tokens-using-the-runscope-api-f24b29013844">Creating a Setup Phase with Subtests: How to Handle OAuth 2 Access Tokens using the Runscope API</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retry on Failure + Threshold Alerts: Optimize Your Team’s Monitoring Notifications]]></title>
            <link>https://medium.com/runscope/retry-on-failure-threshold-alerts-optimize-your-teams-monitoring-notifications-6800121fe029?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/6800121fe029</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[api-monitoring]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:32:05 GMT</pubDate>
            <atom:updated>2017-05-08T19:41:40.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuyXPCnaaEpsrh4gy5shCA.png" /><figcaption><a href="https://www.flickr.com/photos/cogdog/8375701808/in/photolist-dL8EkS-68jcCS-8xQmwz-qNtrVy-7U3ASA-5U9jRQ-2ncg6c-e9jRX-cwC3QL-7xh5Rr-5U4Ynz-bgRV1k-6u6Jha-9Cpo2C-azDiP-adi58f-aSgSYP-5wBjRV-7Uc2y7-bmGghk-a4pD4T-4EmYXp-a3zri3-rjnz22-9Z3c6a-bbVhbt-om2YnM-471ZjP-8qQ2fX-9Z6fc9-9ap1TR-d1mxVf-9Wrx53-a1LCGS-d1mxZJ-9XFZPm-2nhNUA-46WZVf-9YJvmg-93VFQa-526Djj-4Q3WXY-5c6ya4-9Z3ij2-kx5BP4-rgaUys-a2Ci82-9h7E3n-267Udm-qxURpr">“Cabled</a>” by <a href="https://www.flickr.com/photos/cogdog/">Alan Levine</a> is licensed under <a href="https://creativecommons.org/licenses/by/2.0/">CC BY 2.0</a> / Cropped from original</figcaption></figure><p>Have you ever been notified of an API monitoring error late at night, only to find out that it was a temporary network error? Or do you have false positives in your API monitoring data that are affecting your customer reports?</p><p>Timeout errors can affect any API, maybe because of a temporary bad internet connection, or a complex database operation. And a lot of times, a simple re-run might return a 200 response. That’s why we recently added a new feature called <strong>Retry on Failure</strong>.</p><h3>How to Use Retry on Failure</h3><p>Retry on Failure will automatically re-run a single test run, immediately after a test fails. Failed re-runs will not re-run again.</p><p>You can find this option in your <strong>test environment settings</strong>, under the <strong>Behaviors</strong> menu. It’s set to off by default, and it’s available for both test-specific or shared environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5aSxKIPVqDIjv0s2P-Uz4A.png" /></figure><p>If you know that the API you’re monitoring suffers from intermittent issues, <a href="https://blog.runscope.com/posts/6-common-api-testing-mistakes-and-how-to-avoid-them">and that it is not part of a bigger problem</a>, definitely give this new feature a try. As we mentioned before, this can help you have a clearer picture of your API success/failure data, and get rid of false positives.</p><p>Another use case for this is if you’re monitoring your tests using a longer timeframe, such as 15 minutes or an hour. With retries active, you can get more accurate data, without waiting for a test to be re-run only after a long period.</p><p>As a best practice, retry on failure works especially well if combined with <a href="https://www.runscope.com/docs/api-testing/notifications"><strong>threshold notifications</strong></a>. It will help you get to thresholds more quickly, so make sure to review your email and <a href="https://www.runscope.com/connected-services">3rd-party notification settings</a> after activating it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zNYRQoyN7BLbfuQZcp6VdA.png" /></figure><h3>Questions and Feedback</h3><p>Retry on failure can reduce the number of notifications sent to your team because of temporary network errors, and give you more accurate data about your APIs.</p><p>If you need any help or run into any issues, please check out our <a href="https://www.runscope.com/support">support page</a> or reach out to our awesome support team at <a href="/service/mailto:help@runscope.com">help@runscope.com</a>.</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/retry-on-failure-threshold-alerts-optimize-your-teams-monitoring-notifications"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6800121fe029" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/retry-on-failure-threshold-alerts-optimize-your-teams-monitoring-notifications-6800121fe029">Retry on Failure + Threshold Alerts: Optimize Your Team’s Monitoring Notifications</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenAPI / Swagger Resource List for API Developers]]></title>
            <link>https://medium.com/runscope/openapi-swagger-resource-list-for-api-developers-9f6d769d9c9d?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/9f6d769d9c9d</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[swagger]]></category>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[open-api]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:31:23 GMT</pubDate>
            <atom:updated>2018-06-06T17:33:32.728Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*capVIyxzzTMA3Gpq6QgpXQ.png" /></figure><p>Update 06/06/18: Check out <a href="http://openapi.tools/">openapi.tools</a> for another great resource on OpenAPI tools.</p><h3>What is the OpenAPI / Swagger Specification?</h3><p>The OpenAPI Specification, formerly known as Swagger Specification, is a simple yet powerful way of describing RESTful APIs, in a machine and human readable format, using JSON or YAML. It has a large ecosystem of tools that can help you design, build, document, test, and visualize your APIs.</p><p>Here’s what a “Hello, World” example looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DC8LfKVdUT-9fYO4JzuUrA.png" /></figure><p>The OpenAPI spec seems to be the most popular option among the three major formats the community is currently using for describing APIs (<a href="http://raml.org/">RAML</a> and <a href="https://apiblueprint.org/">API Blueprint</a> being the two others). It is used by companies of all sizes, including Microsoft, Netflix, IBM, and Lyft, to name a few.</p><p>The three major benefits of creating and using an OpenAPI specification are:</p><ul><li><strong>Generating interactive documentation</strong> — API documentation is often overlooked, but it’s crucial for developers to understand how to interact with your endpoints, whether they’re internal or external code.</li><li><strong>Human readable and machine readable</strong> — The choice of JSON and YAML as the accepted formats is not by accident. Being language-agnostic is an important aspect of the OpenAPI specification widespread use, allowing teams to easily read and share them, while making it easy to create tooling around it for any programming language.</li><li><strong>Creating SDK for multiple languages</strong> — A big challenge that API companies face is providing client libraries for multiple languages and frameworks: Node.js, C#, Python, Ruby, Java, etc., the list could go on forever. OpenAPI tooling such as <a href="https://github.com/swagger-api/swagger-codegen">swagger-codegen</a> can help you do that with little work.</li></ul><p>Another benefit of the OpenAPI specification is that it does not require you to rewrite your existing API. You can even find unofficial specs for public APIs. However, OpenAPI is not a one-size-fits-all solution. Not all services can be described by the OpenAPI specification, and it was not intended to cover every possible case of RESTful APIs.</p><h3>Why the two different names?</h3><p>The Swagger specification development started in 2010, by <a href="http://www.wordnik.com/about">Wordnik</a>. It was later acquired by <a href="https://smartbear.com/news/news-releases/sponsorship-of-swagger/">SmartBear</a>, in 2015. In that same year, SmartBear created the <a href="https://www.openapis.org/">OpenAPI Initiative</a> (OAI) under the Linux Foundation, and <a href="https://www.programmableweb.com/news/%E2%80%8Bsmartbear-linux-foundation-launch-open-api-initiative-to-evolve-swagger/2015/11/10">donated the Swagger specification to it</a>, in order to advance a common standard across industries. A number of tech companies, including Google, IBM, and Microsoft, signed on as founding members of the OpenAPI Initiative, and the Swagger Specification was rebranded as the <strong>Open API Specification</strong>.</p><h3>Why are we writing this?</h3><p>Crafting good APIs is no easy task. OpenAPI brings a lot of benefits to this process, whether you approach it from a design-first or code-first perspective. The ecosystem of tools can help you generate interactive documentation, SDKs for your APIs in multiple languages, and server stubs.</p><p>But getting started with OpenAPI can be challenging. Figuring out how to start writing a spec from the ground up or for existing APIs, which tools, cloud providers, and frameworks support the specification, the differences between 1.2, 2.0, and the upcoming 3.0 versions, and finding open-source generators for your SDKs are only a few of the questions you can run into.</p><p>That’s why we decided to aggregate the best resources in a single place, and hopefully, guide you on this journey in implementing and making the most of your OpenAPI specification.</p><h3>What is included in here?</h3><p>We broke down this guide into the following topics:</p><ul><li>Writing Spec / Design</li><li>Documentation</li><li>Generators</li><li>Servers</li><li>Clients</li><li>Testing &amp; Monitoring</li><li>Gateways / Management</li><li>Public Specifications</li></ul><p>We really hope you find this useful, and please let us know if you think there are any additional resources we can add here.</p><h3>Writing Spec / Design</h3><p>With existing API projects, you can leverage generators to automatically create an OpenAPI specification and documentation for your project. Several of these projects also support code annotations so you can incorporate those in your docs, and you can find generators for the most popular languages and frameworks: Node.js, Python, C#, Go, etc.</p><p>The <a href="https://github.com/swagger-api/swagger-codegen">swagger-codegen</a> project is the official project from the <a href="https://github.com/swagger-api/">Swagger GitHub organization</a>, and it’s used by <a href="https://github.com/swagger-api/swagger-codegen#companiesprojects-using-swagger-codegen">several companies</a>. It includes options to generate client libraries, server stubs, and docs. We have included it here, and also in the Servers and Clients sections.</p><h4>Information and Tutorials</h4><ul><li><a href="https://www.openapis.org/">OpenAPI Initiative</a></li><li><a href="http://swagger.io/">Swagger</a></li><li><a href="https://github.com/OAI/OpenAPI-Specification">OAI/OpenAPI-Specification Repository</a></li><li><a href="https://blog.readme.io/what-is-swagger-and-why-it-matters/">ReadMe.io — What is Swagger and Why it Matters</a></li><li><a href="https://apihandyman.io/writing-openapi-swagger-specification-tutorial-part-1-introduction/">APIHandyman.io — Writing OpenAPI (Swagger) Specification Tutorial — 9 Part Series</a></li><li><a href="https://blog.uship.com/shippingcode/from-zero-to-swagger-retrofitting-an-existing-rest-api-to-an-api-specification-using-swagger/">uShip — From Zero to Swagger: Retrofitting an Existing REST API to an API Specification Using Swagger</a></li><li><a href="http://radar.oreilly.com/2015/09/building-apis-with-swagger.html">O’Reilly Radar — Building APIs with Swagger</a></li><li><a href="http://openapi-specification-visual-documentation.apihandyman.io/">APIHandyman — OpenAPI Specification Visual Documentation</a></li></ul><h4>Migration Guides</h4><ul><li><a href="https://github.com/OAI/OpenAPI-Specification/wiki/1.2-transition">OpenAPI Specification Wiki — Migration from Swagger 1.1 to Swagger 1.2</a></li><li><a href="https://github.com/OAI/OpenAPI-Specification/wiki/Swagger-1.2-to-2.0-Migration-Guide">OpenAPI Specification Wiki — Migration from Swagger 1.2 to Swagger 2.0</a></li></ul><h4>Upcoming 3.0 Specification</h4><ul><li><a href="https://www.openapis.org/blog/2017/03/01/openapi-spec-3-implementers-draft-released">OpenAPI Initiative — Open API Initiative Announces Release of the OpenAPI Spec v3 Implementer’s Draft</a> (<a href="https://github.com/OAI/OpenAPI-Specification/tree/3.0.0-rc0">GitHub, 3.0.0-rc0</a>)</li><li><a href="https://www.openapis.org/news/blogs/2016/10/tdc-structural-improvements-explaining-30-spec-part-2">OpenAPI Initiative — TDC: Structural Improvements: explaining the 3.0 spec, part 2</a></li><li><a href="https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/">ReadMe.io — A Visual Guide to What’s New in Swagger 3.0</a></li></ul><h4>Tools</h4><ul><li><a href="http://editor.swagger.io/#!/">Swagger Editor — Online Editor</a> (<a href="https://github.com/swagger-api/swagger-editor">GitHub Source</a>)</li><li><a href="https://stoplight.io/">Stoplight</a></li><li><a href="https://restlet.com/">Restlet</a></li><li><a href="https://help.apiary.io/swagger/">Apiary</a></li><li><a href="http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json">Swagger Validator</a></li><li><a href="http://bigstickcarpet.com/swagger-parser/www/index.html">Swagger 2.0 Parser and Validator</a></li><li><a href="https://marketplace.visualstudio.com/items?itemName=Arjun.swagger-viewer">Swagger Viewer for Visual Studio Code</a></li></ul><h3>Documentation</h3><p>One of the most popular benefits of creating an OpenAPI specification is using it to create an interactive documentation, allowing developers to quickly test your API directly from your docs. There are several tools to choose from here, including the open-source <a href="https://github.com/swagger-api/swagger-ui">Swagger-UI</a>, to <a href="https://readme.io/swagger">ReadMe.io</a>’s more extensive platform.</p><h4>Information and Tutorials</h4><ul><li><a href="https://engineering.gosquared.com/building-better-api-docs">GoSquared — Building better API Docs with React and Swagger</a></li><li><a href="http://idratherbewriting.com/learnapidoc/pubapis_swagger.html">I’d Rather Be Writing — Swagger tutorial</a></li></ul><h4>Public API Examples</h4><ul><li><a href="http://petstore.swagger.io/">PetStore Example</a></li><li><a href="https://watson-api-explorer.mybluemix.net/">Watson Developer Cloud Swagger Docs</a></li></ul><h4>Tools</h4><ul><li><a href="https://github.com/swagger-api/swagger-ui">Swagger UI</a></li><li><a href="https://readme.io/swagger">ReadMe.io</a></li><li><a href="https://github.com/Rebilly/ReDoc">ReDoc</a></li><li><a href="https://gelato.io/">Gelato.io</a></li><li><a href="http://stoplight.io/platform/docs/">Stoplight Hosted Docs</a></li><li><a href="https://github.com/sourcey/spectacle">Spectacle</a></li></ul><h3>Generators</h3><p>With existing API projects, you can leverage generators to automatically create an OpenAPI specification and documentation for your project. Several of these projects also support code annotations so you can incorporate those in your docs, and you can find generators for the most popular languages and frameworks: Node.js, Python, C#, Go, etc.</p><p>The <a href="https://github.com/swagger-api/swagger-codegen">swagger-codegen</a> project is the official project from the <a href="https://github.com/swagger-api/">Swagger GitHub organization</a>, and it’s used by <a href="https://github.com/swagger-api/swagger-codegen#companiesprojects-using-swagger-codegen">several companies</a>. It includes options to generate client libraries, server stubs, and docs. We have included it here, and also in the Servers and Clients sections.</p><h4>Information and Tutorials</h4><ul><li><a href="http://hirelofty.com/blog/auto-generate-swagger-docs-your-django-api/">Lofty Labs — Auto-Generate Swagger Docs for your Django API</a></li><li><a href="http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api">Baeldung — Setting Up Swagger 2 with a Spring REST API</a></li><li><a href="http://michal.karzynski.pl/blog/2016/06/19/building-beautiful-restful-apis-using-flask-swagger-ui-flask-restplus/">Michał Karzyński — Building beautiful REST APIs using Flask, Swagger UI and Flask-RESTPlus</a></li><li><a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger">Microsoft Docs — ASP.NET Web API Help Pages using Swagger</a></li></ul><h4>GitHub</h4><ul><li><a href="https://github.com/swagger-api/swagger-codegen">swagger-api/swagger-codegen</a></li><li><a href="https://github.com/Rebilly/generator-openapi-repo">Rebilly/generator-openapi-repo</a></li><li><a href="https://github.com/marcgibbons/django-rest-swagger/">marcgibbons/django-rest-swagger/</a></li><li><a href="https://github.com/noirbizarre/flask-restplus/">noirbizarre/flask-restplus/</a></li><li><a href="https://github.com/glennjones/hapi-swagger/">glennjones/hapi-swagger/</a></li><li><a href="https://github.com/springfox/springfox/">springfox/springfox/</a></li><li><a href="https://github.com/kongchen/swagger-maven-plugin/">kongchen/swagger-maven-plugin/</a></li><li><a href="https://github.com/zircote/swagger-php/">zircote/swagger-php/</a></li><li><a href="https://github.com/abelsilva/swaggerwcf">abelsilva/swaggerwcf</a></li><li><a href="https://github.com/domaindrivendev/Swashbuckle.AspNetCore">domaindrivendev/Swashbuckle.AspNetCore</a></li><li><a href="https://github.com/go-swagger/go-swagger">go-swagger/go-swagger</a></li><li><a href="https://github.com/swagger-api/swagger-play">swagger-api/swagger-play</a></li><li><a href="https://github.com/googleapis/gnostic">googleapis/gnostic</a></li></ul><h3>Servers</h3><p>The following tools can help you design and build OpenAPI-compliant APIs, while using your specification to handle parts of the plumbing, such as schema validation, input validation, and routing logic.</p><h4>Information and Tutorials</h4><ul><li><a href="https://blog.risingstack.com/swagger-nodejs/">RisingStack — Swagger for Node.js HTTP API Design</a></li><li><a href="https://www.infoq.com/presentations/java-rest-swagger">InfoQ — Creating Java REST Servers from Swagger API Definitions (Video)</a></li><li><a href="https://egghead.io/courses/build-node-js-apis-with-openapi-spec-swagger">egghead.io — Build Node.js APIs with OpenAPI Spec (Swagger) (Paid course)</a></li></ul><h4>Tools</h4><ul><li><a href="https://generator.swagger.io/">Swagger Generator</a></li></ul><h4>GitHub</h4><ul><li><a href="https://github.com/swagger-api/swagger-codegen">swagger-api/swagger-codegen</a></li><li><a href="https://github.com/swagger-api/swagger-node">swagger-api/swagger-node</a></li><li><a href="https://github.com/krakenjs/swaggerize-express/">krakenjs/swaggerize-express/</a></li><li><a href="https://github.com/krakenjs/swaggerize-hapi/">krakenjs/swaggerize-hapi/</a></li><li><a href="https://github.com/metosin/compojure-api/">metosin/compojure-api/</a> (<a href="http://www.metosin.fi/blog/compojure-api-100/">Blog post</a>)</li><li><a href="https://github.com/noirbizarre/flask-restplus/">noirbizarre/flask-restplus/</a></li></ul><h3>Clients</h3><p>Providing client libraries for multiple languages can be a time-consuming commitment for API providers. Luckily, these tools can help you generate libraries automatically from an OpenAPI specification.</p><p>This may not be a panacea for all your SDK woes, but it can give you a good starting point on which you can improve with the help of your API developers and users.</p><h4>Information and Tutorials</h4><ul><li><a href="http://apievangelist.com/2015/06/06/comparison-of-automatic-api-code-generation-tools-for-swagger/">API Evangelist — Comparison of Automatic API Code Generation Tools For Swagger</a></li><li><a href="https://dzone.com/articles/aspnet-core-apis-in-the-fast-lane-with-swagger-and">DZone — ASP.NET Core APIs in the Fast Lane With Swagger and Autorest</a></li><li><a href="https://blog.couchbase.com/node-js-swagger-monitor-document-changes-couchbase-mobile/">Couchbase — Using Node.js and Swagger to Monitor Document Changes in Couchbase Mobile</a></li></ul><h4>Tools</h4><ul><li><a href="https://generator.swagger.io/">Swagger Generator</a></li><li><a href="https://apimatic.io/">APIMATIC</a></li></ul><h4>GitHub</h4><ul><li><a href="https://github.com/swagger-api/swagger-codegen">swagger-api/swagger-codegen</a></li><li><a href="https://github.com/swagger-api/swagger-js">swagger-api/swagger-js</a></li><li><a href="https://github.com/Yelp/bravado/">Yelp/bravado/</a></li><li><a href="https://github.com/mission-liao/pyswagger/">mission-liao/pyswagger/</a></li><li><a href="https://github.com/Azure/autorest">Azure/autorest</a></li></ul><h3>Testing &amp; Monitoring</h3><p>Some of the open-source projects in the previous sections will help you run unit tests against your API just with your OpenAPI specification.</p><p>These projects and tools can help you get a more comprehensive look into your OpenAPI-backed APIs, by running tests against a backend implementation of the API, and providing more information such as performance, response validation, and uptime.</p><h4>Information and Tutorials</h4><ul><li><a href="https://blog.runscope.com/posts/new-import-feature-support-for-swagger-postman">Runscope — Create Runscope Tests Instantly with New Import Test Feature: Support for Swagger, Postman Collection and HAR Files</a></li><li><a href="https://sendgrid.com/blog/stoplight-io-to-test-api-endpoints/">SendGrid — How We Use StopLight.io to Test 233 API Endpoints in Seconds</a></li></ul><h4>GitHub</h4><ul><li><a href="https://github.com/apiaryio/dredd">Dredd — HTTP API Testing Framework</a></li></ul><h4>Tools</h4><ul><li><a href="https://www.runscope.com/">Runscope</a></li><li><a href="https://www.getpostman.com/">Postman</a></li><li><a href="https://help.stoplight.io/prism/getting-started">Stoplight Prism</a></li></ul><h3>Gateway / Management</h3><p>API Gateways can help you create, publish, and implement multiple features such as rate limiting, authentication, policies and tiers, just to name a few.</p><p>Some of these tools support importing an OpenAPI definition to give you a head-start when deploying a new API, and/or exporting a specification so you can use it for docs or client generation.</p><h4>Information and Tutorials</h4><ul><li><a href="https://swaggerhub.com/blog/swaggerhub-feature/api-management-with-azure-and-swaggerhub/">SwaggerHub — API Management with Azure and SwaggerHub</a></li><li><a href="https://swaggerhub.com/blog/swaggerhub-feature/swagger-amazon-api-gateway-and-lambda/">SwaggerHub — Build, Document, and Deploy Your API with Swagger, Amazon API Gateway and Lambda (Webinar)</a></li><li><a href="https://blog.jayway.com/2016/09/18/introduction-swagger-cloudformation-api-gateway/">Jayway — Introduction to Swagger for CloudFormation and API Gateway</a></li><li><a href="https://cloudonaut.io/create-a-serverless-restful-api-with-api-gateway-swagger-lambda-and-dynamodb/">cloudonaut — Create a serverless RESTful API with API Gateway, Swagger, Lambda, and DynamoDB</a></li></ul><h4>Tools</h4><ul><li><a href="https://tyk.io/">Tyk</a></li><li><a href="https://aws.amazon.com/api-gateway/">AWS API Gateway</a> (<a href="http://docs.aws.amazon.com/apigateway/latest/developerguide/create-api-using-import-export-api.html">Docs</a>)</li><li><a href="https://cloud.google.com/endpoints/">Google Cloud Endpoints</a> (<a href="https://cloud.google.com/endpoints/docs/open-api-spec">Docs</a>)</li><li><a href="https://strongloop.com/">IBM API Connect — LoopBack</a> (formerly StrongLoop) (<a href="https://strongloop.com/strongblog/generating-swagger-openapi-specification-from-your-loopback-application/">Blog post</a>)</li><li><a href="https://azure.microsoft.com/en-us/services/api-management/">Microsoft Azure API Management</a> (<a href="https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-import-api">Docs</a>)</li><li><a href="https://swaggerhub.com/">SwaggerHub</a></li></ul><h3>Public Specifications</h3><p>Looking at how other companies have written their OpenAPI specifications can be helpful when writing your own. Here’s a list of a few specifications available on GitHub:</p><ul><li><a href="https://github.com/stripe/openapi">Stripe OpenAPI Spec</a></li><li><a href="https://github.com/NYTimes/public_api_specs">NYTimes OpenAPI Spec</a></li><li><a href="https://github.com/sendgrid/sendgrid-oai">SendGrid OpenAPI Spec</a></li><li><a href="https://github.com/square/connect-api-specification">Square OpenAPI Spec</a></li><li><a href="https://github.com/Azure/azure-rest-api-specs">Microsoft Azure REST API Specs</a></li><li><a href="https://github.com/Runscope/runscope-api-examples/blob/master/schemas/runscope-swagger.json">Runscope OpenAPI Spec</a></li><li><a href="https://github.com/bigcommerce/api">BigCommerce Open API Spec</a></li><li><a href="https://github.com/bcgov/api-specs">bcgov (British Columbia, Canada) Open API Spec</a></li></ul><p>You can also find a list of official and unofficial API specifications on APIs.guru OpenAPI directory. Check the value of the `x-unofficialSpec` parameter to differentiate between them:</p><ul><li><a href="https://apis.guru/browse-apis/">APIs.guru — Browse APIs</a></li></ul><p>And “The API Stack” project by the API Evangelist is another great resource as well:</p><ul><li><a href="http://theapistack.com/">API Evangelist — The API Stack</a></li></ul><p>Special thanks to some awesome folks:</p><ul><li>Kin Lane — <a href="http://openapi.toolbox.apievangelist.com/">API Evangelist Open API Toolbox</a>, another great resource for Open API tools and projects.</li><li>Matt Bernier</li><li><a href="https://twitter.com/thinkingserious">Elmer Thomas</a></li></ul><p>We hope this resource list helps you make the most out of your OpenAPI / Swagger specification. If you have any feedback or links to other projects, tools, and tutorials we could include here, <a href="/service/mailto:help@runscope.com">please reach out to us</a>!</p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/openapi-swagger-resource-list-for-api-developers"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f6d769d9c9d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/openapi-swagger-resource-list-for-api-developers-9f6d769d9c9d">OpenAPI / Swagger Resource List for API Developers</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing and Monitoring SOAP APIs]]></title>
            <link>https://medium.com/runscope/testing-and-monitoring-soap-apis-66745a73ac71?source=rss----b1ca1755dd85---4</link>
            <guid isPermaLink="false">https://medium.com/p/66745a73ac71</guid>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[qa-testing]]></category>
            <category><![CDATA[soap]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Heitor T. Sergent]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:31:13 GMT</pubDate>
            <atom:updated>2017-05-03T15:33:33.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*3kttz7u-lXtmNI_9YM1kgA.jpeg" /></figure><p>The <a href="http://nordicapis.com/rest-vs-soap-nordic-apis-infographic-comparison/">SOAP vs. REST</a> debate might have ended with REST as the clear winner in adoption for the most recent years, especially when we’re talking about public APIs. However, SOAP APIs are still available and being used, especially in maintaining support for legacy systems, or in specific industries, such as financial and telecommunication services. Even big tech companies still have SOAP APIs available, such as <a href="https://developer.paypal.com/docs/classic/api/PayPalSOAPAPIArchitecture/">PayPal</a>, <a href="https://www.flickr.com/services/api/request.soap.html">Flickr</a>, and <a href="https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm">Salesforce</a>.</p><p>Runscope supports testing any HTTP request, which includes making SOAP requests. In this tutorial, we’re going to walk through how to test a SOAP API that returns geolocation information based on an IP address and validate its response using assertions and post-response scripts.</p><h3>Testing a SOAP API Endpoint</h3><p>Here’s what a request to our <a href="http://ws.cdyne.com/ip2geo/ip2geo.asmx?op=ResolveIP">IP2Geo SOAP API</a> looks like:</p><pre>POST /ip2geo/ip2geo.asmx<br>HTTP/1.1 Host: ws.cdyne.com<br>Content-Type: text/xml; charset=utf-8<br>Content-Length: length<br>SOAPAction: &quot;http://ws.cdyne.com/ResolveIP&quot;</pre><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;<br>  &lt;soap:Body&gt;<br>    &lt;ResolveIP xmlns=&quot;http://ws.cdyne.com/&quot;&gt;<br>      &lt;ipAddress&gt;string&lt;/ipAddress&gt;<br>      &lt;licenseKey&gt;string&lt;/licenseKey&gt;<br>    &lt;/ResolveIP&gt;<br>  &lt;/soap:Body&gt;<br>&lt;/soap:Envelope&gt;</pre><p>We’re using SOAP 1.1 here, but the API also supports SOAP 1.2, and you can test both versions using Runscope.</p><p>For this example, I’m going to be using my IP address, which will return an address from Chicago, in the US. You can use your own public IP address in the following steps if you want, and you can find it by searching for “what’s my IP” on Google, or typing the following command in your terminal:</p><pre>curl httpbin.org/ip</pre><p>The first thing we need to do is create a new test in the Runscope interface, and set the following parameters:</p><ol><li>Method: POST</li><li>URL: <a href="https://ws.cdyne.com/ip2geo/ip2geo.asmx">https://ws.cdyne.com/ip2geo/ip2geo.asmx</a></li><li>Headers:</li></ol><ul><li>SOAPAction: “http://ws.cdyne.com/ResolveIP&quot;</li><li>Content-Length: length</li><li>Content-Type: text/xml; charset=utf-8</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-GykkCZyLGlAFNvWnnRew.png" /></figure><p>Then, we need to add our request’s envelope body by clicking on “+ Add Body”, and set two parameters:</p><ul><li>ipAddress — Change it to your IP address. In this case, I’m using my IP which is “24.148.46.195”.</li><li>licenseKey — Set this to 0 since we’re just testing the API.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z9QQtYA_jXhd-v1c3dFg6w.png" /></figure><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;<br>  &lt;soap:Body&gt;<br>    &lt;ResolveIP xmlns=&quot;http://ws.cdyne.com/&quot;&gt;<br>      &lt;ipAddress&gt;24.148.46.195&lt;/ipAddress&gt;<br>      &lt;licenseKey&gt;0&lt;/licenseKey&gt;<br>    &lt;/ResolveIP&gt;<br>  &lt;/soap:Body&gt;<br>&lt;/soap:Envelope&gt;</pre><p>Now, we just click on “Save &amp; Run” at the top to run our request.</p><p>We can see the results by clicking on the first item on the left-hand side, under “Recent Test Runs”. Our SOAP API is going to return an XML object, and it should look similar to this:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>  &lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<br>    &lt;soap:Body&gt;<br>      &lt;ResolveIPResponse xmlns=&quot;http://ws.cdyne.com/&quot;&gt;<br>        &lt;ResolveIPResult&gt;<br>          &lt;City&gt;Chicago&lt;/City&gt;<br>          &lt;StateProvince&gt;IL&lt;/StateProvince&gt;<br>          &lt;Country&gt;United States&lt;/Country&gt;<br>          &lt;Organization /&gt;<br>          &lt;Latitude&gt;41.9843&lt;/Latitude&gt;<br>          &lt;Longitude&gt;-87.6635&lt;/Longitude&gt;<br>          &lt;AreaCode&gt;773&lt;/AreaCode&gt;<br>          &lt;TimeZone /&gt; &lt;HasDaylightSavings&gt;false&lt;/HasDaylightSavings&gt; &lt;Certainty&gt;90&lt;/Certainty&gt; &lt;RegionName /&gt; &lt;CountryCode&gt;US&lt;/CountryCode&gt; &lt;/ResolveIPResult&gt; &lt;/ResolveIPResponse&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;</pre><p><strong>Note</strong>: if you get an invalid response, make sure that you’re using a valid public IP address in your request.</p><h3>Validating Response Data with Assertions</h3><p>Ok, so we know that our test and our SOAP API is working. For the next step, we want to make sure that our response is returning the correct data. There are two ways we can create <a href="https://www.runscope.com/docs/api-testing/assertions#defining-assertions">assertions</a> in the Runscope interface:</p><h4>Built-in XML Assertions</h4><p>The first way we can do that is by clicking on the “Assertion” tab in our test editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPMK1dHMsLlRgV7sCgssTw.png" /></figure><p>We already have a default assertion set up that we expect our test to return a 200 status code. Now, let’s add another assertion that will check that the `City` element is equal to the city our IP address resolves to.</p><p>To do that, we first click on “+ Add Assertion”. Then, we set our “Source” to “XML Body”, and under “Property”, we’re going to set it to: “//*[local-name()=’City’]/text()”</p><p>That is an XPath expression we’re using to search for all elements named “City”, and then extracting their text value. You can learn more about XPath expression and play around with them by <a href="http://www.freeformatter.com/xpath-tester.html">using this XPath Tester/Evaluator tool</a>.</p><p>We also need to set the Comparison field to “equals”, and the Target Value to the city your IP address resolves to. In my case, I’ll just set it to “Chicago”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-DnXe1sk5zpoF_Xou1Syg.png" /></figure><p>Now, we can rerun our test and see if it’s still passing by clicking on “Save &amp; Run” at the top, and then heading over to our test result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrktwGV2DZD2gODFn02jOA.png" /></figure><h4>Post-response Scripts</h4><p>Another way for us to test that our response data is correct is by using the <a href="https://www.runscope.com/docs/api-testing/scripts/post-response">Post-response Scripts feature</a>. We can use one of the included libraries, <a href="https://code.google.com/archive/p/marknote/wikis/DevelopersGuide.wiki">marknote XML Parser</a>, to work with the XML response and retrieve the elements we want to test.</p><p>So, if we wanted to do a similar assertion as we did in the last step, we can go to the Post-response Script tab in our test step and add the following script:</p><pre>var str = response.body;<br>var parser = new marknote.Parser();<br>var xml = parser.parse(str);<br>var body = xml.getRootElement();<br>var resp = body.getChildElement(&quot;ResolveIPResponse&quot;);<br>var result = resp.getChildElement(&quot;ResolveIPResult&quot;);<br>var city = result.getChildElement(&quot;City&quot;);<br>assert(city.getText() === &quot;Chicago&quot;, &quot;Windy City is correct!&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLm70ujtUSdTm3ApxNnUYQ.png" /></figure><p>And we can see our script output and success message in the test result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*di-CQKYCDSXppgZLhOqtqw.png" /></figure><p>Using scripts can be useful if you plan to do something more complex with the data you get back from your SOAP API. You can also combine scripts with <a href="https://www.runscope.com/docs/api-testing/scripts/snippets">snippets</a> to avoid repeating that boilerplate XML parsing code in our example script, and reuse assertions across multiple tests.</p><h3>Creating Tests with the Traffic Inspector</h3><p>One last tip before we finish this tutorial, there’s a quicker way to create tests than via the interface in case you already have an application that’s using the SOAP API.</p><p>If you have the ability to edit your application that’s using the SOAP API, you can change its URL to a Runscope Traffic Inspector URL, and capture those requests. That way, you can just go to your bucket, head over to the Traffic tab, and then convert those requests into tests. That can be a quicker and easier way to create properly formatted SOAP requests for your API.</p><p>You can <a href="https://www.runscope.com/docs/debugging">learn more about how to use the Traffic Inspector</a> in our documentation.</p><h3>Conclusion</h3><p>Testing and monitoring SOAP APIs is as easy and important as maintaining REST APIs. Whether they are legacy systems or external dependencies that you have to support, you can rely on Runscope to make sure everything is going to be 200 OK®.</p><p>If you need any help creating your SOAP API tests, <a href="https://www.runscope.com/support">please reach out to our awesome support team</a>.</p><p>Everything is going to be 200 OK®</p><p><em>Originally published at </em><a href="https://blog.runscope.com/posts/introduction-to-monitoring-soap-apis-tutorial"><em>blog.runscope.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66745a73ac71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runscope/testing-and-monitoring-soap-apis-66745a73ac71">Testing and Monitoring SOAP APIs</a> was originally published in <a href="https://medium.com/runscope">Runscope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>