<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: James Perkins</title>
    <description>The latest articles on DEV Community by James Perkins (@jam3sperkins).</description>
    <link>https://dev.to/jam3sperkins</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1523142%2F2e8c2127-8f91-4141-bf85-5c917eb58356.jpg</url>
      <title>DEV Community: James Perkins</title>
      <link>https://dev.to/jam3sperkins</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jam3sperkins"/>
    <language>en</language>
    <item>
      <title>Getting started with Drata.com APIs</title>
      <dc:creator>James Perkins</dc:creator>
      <pubDate>Tue, 04 Jun 2024 12:50:00 +0000</pubDate>
      <link>https://dev.to/jam3sperkins/getting-started-with-dratacom-apis-2j7l</link>
      <guid>https://dev.to/jam3sperkins/getting-started-with-dratacom-apis-2j7l</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Integrating Drata's compliance automation tool can significantly streamline your compliance processes. This tutorial will guide you through utilising Drata's APIs with Postman. We'll cover importing the Drata Postman collection, setting an environment and making an API call.&lt;/p&gt;

&lt;p&gt;We won't cover first time installation of Postman or Drata, this doc will assume a basic understanding of the two.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/sVSRQ9xx-Go"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Importing Postman Collection
&lt;/h3&gt;

&lt;p&gt;We need to download the &lt;a href="https://developers.drata.com/docs/openapi/reference/overview/"&gt;Drata Postman Collection&lt;br&gt;
&lt;/a&gt; and following the documentation on Drata, to import the collection into Postman.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Import&lt;/strong&gt;, select the &lt;strong&gt;swagger.json&lt;/strong&gt; file you just downloaded, next make sure we click &lt;strong&gt;View Import Settings&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81ajmpxcwpncprzf2q5c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81ajmpxcwpncprzf2q5c.png" alt="Importing the Postman Collection" width="800" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Folder organization&lt;/strong&gt; click the drop down and select &lt;strong&gt;Tags&lt;/strong&gt; (the default is likely set to Paths&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F80tiu0k8gk3ojfgy6fqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F80tiu0k8gk3ojfgy6fqc.png" alt="Changing Postman to Tags" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a new Postman Environment
&lt;/h3&gt;

&lt;p&gt;Create a new environment in Postman&lt;br&gt;
On the left hand navigation, select &lt;strong&gt;Environments&lt;/strong&gt;, and at the top click &lt;strong&gt;+&lt;/strong&gt; the plus&lt;br&gt;
Add two new &lt;strong&gt;Variables&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;baseUrl&lt;/code&gt;&lt;br&gt;
&lt;code&gt;bearerToken&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenp1m0yuhvazs4svra6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenp1m0yuhvazs4svra6r.png" alt="Adding environment variables" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;baseUrl&lt;/strong&gt;, set the value depending on the location of your Drata instance (&lt;a href="https://developers.drata.com/docs/#base-url"&gt;reference documentation&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating our Drata API token
&lt;/h3&gt;

&lt;p&gt;We need to generate an API token within Drata and update the bearerToken in the Postman environment.&lt;br&gt;
To do this, login to Drata and click &lt;strong&gt;your name&lt;/strong&gt; at the bottom left corner and then click &lt;strong&gt;Settings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr18fai7i31izagi1mqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr18fai7i31izagi1mqx.png" alt="Settings in Drata" width="536" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;API Keys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk54kpzm9vw2uj6veh6gd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk54kpzm9vw2uj6veh6gd.png" alt="Settings &amp;gt; API Keys" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we need to &lt;strong&gt;Create API Key&lt;/strong&gt;&lt;br&gt;
Follow the details on screen, including a Name, expiration and the scopes required.&lt;br&gt;
Best practice is to limit the time of the token for how long you need it, limiting certain IP addresses to use the token and limiting the scope to what you need.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol7i7e2rz25632y7qkd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol7i7e2rz25632y7qkd4.png" alt="Creating an API key in Drata" width="714" height="988"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take the API Key you are given and update the &lt;code&gt;bearerToken&lt;/code&gt; value in the Postman environment. Don't forget to click &lt;strong&gt;Save&lt;/strong&gt; for the Enviornment&lt;/p&gt;

&lt;p&gt;It should now look something like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0m3jx9ft96ax5po5onc3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0m3jx9ft96ax5po5onc3.png" alt="Setting environment variables" width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's run a request!
&lt;/h3&gt;

&lt;p&gt;Go to the collection, and let's run a basic request. Expand &lt;strong&gt;Drata API Documentation &amp;gt; Personnel&lt;/strong&gt; and select &lt;strong&gt;Get personnel by id&lt;/strong&gt;&lt;br&gt;
Update the &lt;strong&gt;:id&lt;/strong&gt; with a personnel ID (1 should be fine)&lt;/p&gt;

&lt;p&gt;If you want to check what the &lt;code&gt;id&lt;/code&gt; should be set to, you can open up the Drata app, go to &lt;strong&gt;Personnel&lt;/strong&gt; and open the user, you'll find their ID in the URL bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fggp80s39r2ehabcbz8qq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fggp80s39r2ehabcbz8qq.png" alt="Personnel ID in Drata" width="800" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure we have selected an Environment within Postman (top right corner) and click &lt;strong&gt;Send&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5n8i3p79n1e90s9n7ogi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5n8i3p79n1e90s9n7ogi.png" alt="Successful Postman request" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚀 Congratulations, we have now made an API call to Drata using Postman&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;We have successfully setup the Drata Postman collection and are now able to make Postman requests against the Drata API.&lt;/p&gt;

&lt;p&gt;What features of the Drata API would you like to know more about or see examples of?&lt;/p&gt;

</description>
      <category>compliance</category>
      <category>drata</category>
      <category>iso27001</category>
      <category>postman</category>
    </item>
    <item>
      <title>This is my first post</title>
      <dc:creator>James Perkins</dc:creator>
      <pubDate>Fri, 31 May 2024 16:27:49 +0000</pubDate>
      <link>https://dev.to/jam3sperkins/this-is-my-first-post-2mln</link>
      <guid>https://dev.to/jam3sperkins/this-is-my-first-post-2mln</guid>
      <description>&lt;p&gt;This is my first post to see what it looks like&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
